gcc/testsuite/g++.dg/tree-ssa/pr54515.C
raw| 1 | // { dg-do compile } |
| 2 | // { dg-options "-O2" } |
| 3 | |
| 4 | template < typename T > T h2le (T) |
| 5 | { |
| 6 | T a; |
| 7 | unsigned short &b = a; |
| 8 | short c = 0; |
| 9 | unsigned char (&d)[2] = reinterpret_cast < unsigned char (&)[2] > (c); |
| 10 | unsigned char (&e)[2] = reinterpret_cast < unsigned char (&)[2] > (b); |
| 11 | e[0] = d[0]; |
| 12 | return a; |
| 13 | } |
| 14 | |
| 15 | void |
| 16 | bar () |
| 17 | { |
| 18 | h2le ((unsigned short) 0); |
| 19 | } |