diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-06-26 10:37:35 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-06-26 10:37:35 +0000 |
commit | e7722bd52ddf9ab1cc7f9f3b091d7d2f810c7d12 (patch) | |
tree | 14b89f3251bb5d788e34146c737c60cdcc20685b /gcc/testsuite/gcc.dg | |
parent | bcfc8110befd54ec89acc441e74c8b3f1558351d (diff) | |
download | gcc-e7722bd52ddf9ab1cc7f9f3b091d7d2f810c7d12.tar.gz |
PR optimization/11210
* fold-const (decode_field_reference): Strip only NOPs that
don't affect the sign.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@68524 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r-- | gcc/testsuite/gcc.dg/20030626-1.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/20030626-1.c b/gcc/testsuite/gcc.dg/20030626-1.c new file mode 100644 index 00000000000..7d356e0050b --- /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" } */ +} |