From b0f19292d253b8e885073eb6c93900834c5d59d5 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Thu, 4 Feb 2010 16:14:17 +0000 Subject: 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: r156494 --- gcc/ChangeLog | 5 +++++ gcc/dse.c | 3 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/torture/pr42952.c | 19 +++++++++++++++++++ 4 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/torture/pr42952.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 072261e..35a10e6 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-02-04 Nick Clifton * config/mn10300/mn10300.c (TARGET_ASM_OUTPUT_MI_THUNK): Define. diff --git a/gcc/dse.c b/gcc/dse.c index e72b998..239d0fb 100644 --- a/gcc/dse.c +++ b/gcc/dse.c @@ -1015,9 +1015,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 0e84ff6..4a4273e 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-02-03 Jerry DeLisle PR libfortran/42901 diff --git a/gcc/testsuite/gcc.dg/torture/pr42952.c b/gcc/testsuite/gcc.dg/torture/pr42952.c new file mode 100644 index 0000000..db8782a --- /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; +} -- cgit v1.1