From: Richard Guenther Date: Thu, 4 Feb 2010 16:21:47 +0000 (+0000) Subject: re PR rtl-optimization/42952 (possible integer wrong code bug) X-Git-Tag: releases/gcc-4.3.5~190 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=532600833fbc3f30a9556177519379b7b60f7442;p=thirdparty%2Fgcc.git re PR rtl-optimization/42952 (possible integer wrong code bug) 2010-02-04 Richard Guenther PR rtl-optimization/42952 * dse.c (const_or_frame_p): Remove MEM handling. * gcc.dg/torture/pr42952.c: New testcase. From-SVN: r156496 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 67438610a930..750cd0b65d20 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2010-02-04 Richard Guenther + + PR rtl-optimization/42952 + * dse.c (const_or_frame_p): Remove MEM handling. + 2010-01-31 Eric Botcazou PR middle-end/42898 diff --git a/gcc/dse.c b/gcc/dse.c index a6de40b51d1a..9cd2948c4ab3 100644 --- a/gcc/dse.c +++ b/gcc/dse.c @@ -964,9 +964,6 @@ const_or_frame_p (rtx x) { switch (GET_CODE (x)) { - case MEM: - return MEM_READONLY_P (x); - case CONST: case CONST_INT: case CONST_DOUBLE: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ca235f90799f..bdebbf61556b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-02-04 Richard Guenther + + PR rtl-optimization/42952 + * gcc.dg/torture/pr42952.c: New testcase. + 2010-01-31 Eric Botcazou PR middle-end/42898 diff --git a/gcc/testsuite/gcc.dg/torture/pr42952.c b/gcc/testsuite/gcc.dg/torture/pr42952.c new file mode 100644 index 000000000000..db8782af3b9e --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr42952.c @@ -0,0 +1,19 @@ +/* { dg-do run } */ +/* { dg-options "-fno-tree-ccp -fno-tree-fre" } */ + +extern void abort (void); + +static int g[1]; + +static int * const p = &g[0]; +static int * const q = &g[0]; + +int main(void) +{ + g[0] = 1; + *p = 0; + *p = *q; + if (g[0] != 0) + abort (); + return 0; +}