diff options
author | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-15 03:09:50 +0000 |
---|---|---|
committer | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-15 03:09:50 +0000 |
commit | 4e768ca79a69fb9f8fb80b4e26e4332df89de2e7 (patch) | |
tree | 8ddc3fce146e31931ab600c4c4208ee2f443eb04 /gcc/testsuite | |
parent | 1392b15e20d7c483d8ea8233fa2945dd6f89abe7 (diff) | |
download | gcc-4e768ca79a69fb9f8fb80b4e26e4332df89de2e7.tar.gz |
gcc/ChangeLog:
PR middle-end/20739
* gimplify.c (gimplify_addr_expr): Compensate for removal of
e.g. cv-qualification conversions.
gcc/testsuite/ChangeLog:
PR middle-end/20739
* gcc.dg/tree-ssa/pr20739.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98167 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/pr20739.c | 24 |
2 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b480eeafd48..5d78e17783d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-04-15 Alexandre Oliva <aoliva@redhat.com> + + PR middle-end/20739 + * gcc.dg/tree-ssa/pr20739.c: New test. + 2005-04-14 Mike Stump <mrs@apple.com> * gcc.dg/Foundation.framework/empty: New. diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr20739.c b/gcc/testsuite/gcc.dg/tree-ssa/pr20739.c new file mode 100644 index 00000000000..c1e7b58e385 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr20739.c @@ -0,0 +1,24 @@ +/* PR middle-end/20739 */ + +/* dg-do compile */ +/* dg-options "-O" */ + +/* We used to fail to compile this because gimplification dropped the + conversion that added the const qualifier to the sub-expression + involving baz, and then immediately noticed and reported its + absence. */ + +typedef struct +{ + char chars[5]; +} +baz_t; + +extern baz_t * baz; + +extern void foo (baz_t); +int +bar (const baz_t * ls) +{ + foo (ls == 0 ? *(&baz[0]) : *ls); +} |