diff options
author | Eric Botcazou <ebotcazou@libertysurf.fr> | 2003-06-26 12:37:35 +0200 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2003-06-26 10:37:35 +0000 |
commit | 6dc208a1ed88e40e359173ece8a3f9441001fd6c (patch) | |
tree | 14b89f3251bb5d788e34146c737c60cdcc20685b /gcc/testsuite | |
parent | fc5eb4a11164a00abe56f16d14b3f5264434339a (diff) | |
download | gcc-6dc208a1ed88e40e359173ece8a3f9441001fd6c.zip gcc-6dc208a1ed88e40e359173ece8a3f9441001fd6c.tar.gz gcc-6dc208a1ed88e40e359173ece8a3f9441001fd6c.tar.bz2 |
re PR rtl-optimization/11210 (optimizer drops conditional with typecast from signed to unsigned char)
PR optimization/11210
* fold-const (decode_field_reference): Strip only NOPs that
don't affect the sign.
From-SVN: r68524
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/20030626-1.c | 18 |
2 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e5f9541..c988401 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2003-06-26 Eric Botcazou <ebotcazou@libertysurf.fr> + + * gcc.dg/20030626-1.c: New test. + 2003-06-26 Neil Booth <neil@daikokuya.co.uk> * const-str-2.m: Update. diff --git a/gcc/testsuite/gcc.dg/20030626-1.c b/gcc/testsuite/gcc.dg/20030626-1.c new file mode 100644 index 0000000..7d356e0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/20030626-1.c @@ -0,0 +1,18 @@ +/* PR optimization/11210 */ +/* Originator: Guido Classen <guido@clagi.de> */ +/* Reduced testcase by Falk Hueffner <falk@debian.org> */ +/* { dg-do compile } */ +/* { dg-options "-O" } */ + +/* Verify that the constant expressions folder doesn't + throw away the cast operation in the comparison. */ + +struct str { + int head; + char data[8]; +}; + +int foo(struct str t) +{ + return t.data[0] || (unsigned char) t.data[2] != 130; /* { dg-bogus "comparison is always 1" } */ +} |