diff options
author | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-04 19:03:13 +0000 |
---|---|---|
committer | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-04 19:03:13 +0000 |
commit | 626b33bbb4413c12337b31ecbacaf32137146376 (patch) | |
tree | a609ca95a2be9b1ca5061bfa82fdba65079759d8 /gcc/testsuite/gcc.dg | |
parent | 13f97a32663b7d1cef14f0c1976f14c920b73381 (diff) | |
download | gcc-626b33bbb4413c12337b31ecbacaf32137146376.tar.gz |
PR middle-end/30744
* fold-const.c (fold_comparison): Enforce type consistency when
transforming ~X op ~Y to Y op X, and ~X op C to X op' ~C.
* gcc.dg/pr30744-1.c: New test case.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122531 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r-- | gcc/testsuite/gcc.dg/pr30744-1.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr30744-1.c b/gcc/testsuite/gcc.dg/pr30744-1.c new file mode 100644 index 00000000000..f0734db60f2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr30744-1.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +typedef struct { + unsigned long unique; +} G; + +void r(G* n) +{ + unsigned long p; + if (((G *) ((void *)((~(unsigned long)(p))))) != ((void *)0)) { + ((G *) ((void *)((~(unsigned long)(p)))))->unique = n->unique; + } +} + |