diff options
author | Andreas Krebbel <krebbel1@de.ibm.com> | 2006-04-25 12:11:25 +0000 |
---|---|---|
committer | Andreas Krebbel <krebbel@gcc.gnu.org> | 2006-04-25 12:11:25 +0000 |
commit | 495db1a1155904059e4239dc124c85717245d761 (patch) | |
tree | d52d7694a2925756c7a06010431f2e6f09f3fa68 /gcc/testsuite/gcc.dg/20060425-1.c | |
parent | 6d75cd5f57c4d23cdbd5acf9da32daf5265c07af (diff) | |
download | gcc-495db1a1155904059e4239dc124c85717245d761.tar.gz |
expmed.c (store_bit_field): Handle paradoxical subregs on big endian machines.
2006-04-25 Andreas Krebbel <krebbel1@de.ibm.com>
* expmed.c (store_bit_field): Handle paradoxical subregs on big endian
machines.
2006-04-25 Andreas Krebbel <krebbel1@de.ibm.com>
* gcc.dg/20060425-1.c: New testcase.
From-SVN: r113248
Diffstat (limited to 'gcc/testsuite/gcc.dg/20060425-1.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/20060425-1.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/20060425-1.c b/gcc/testsuite/gcc.dg/20060425-1.c new file mode 100644 index 00000000000..7d899b2bba6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/20060425-1.c @@ -0,0 +1,38 @@ +/* { dg-do run } */ +/* { dg-options "-O1" } */ + +/* This failed because if conversion didn't handle insv patterns properly. */ + +void abort (void); + +union y +{ + int a; + unsigned short b; +}; + +void __attribute__ ((noinline)) +bar (unsigned short u, union y v) +{ + if (u != 1) + abort (); +} + +void __attribute__ ((noinline)) +foo (int check) +{ + union y x; + + if (check != 0) + x.b = 1; + else + x.b = 2; + bar (x.b, x); +} + +int +main () +{ + foo (1); + return 0; +} |