summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2002-11-11 05:38:22 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2002-11-11 05:38:22 +0000
commit458bb87144649179b6858179747bd3f7a35d278e (patch)
tree40da459ba25373c9a9c3df50aa7ee84d2b280291 /gcc
parent0a4e817fb29aebb4c3d66d69ac28829fba579011 (diff)
downloadgcc-458bb87144649179b6858179747bd3f7a35d278e.tar.gz
PR c/8439
* recog.c (validate_replace_rtx_1) [PLUS]: Simplify only if there is something new to be simplified. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59005 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/recog.c4
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/20021110.c10
4 files changed, 23 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 308e81747f8..b29de8927ff 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2002-11-09 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR c/8439
+ * recog.c (validate_replace_rtx_1) [PLUS]: Simplify only
+ if there is something new to be simplified.
+
2002-11-10 H.J. Lu <hjl@gnu.org>
* calls.c (PUSH_ARGS_REVERSED): Define only if not defined.
diff --git a/gcc/recog.c b/gcc/recog.c
index b40867bf7a3..649f3665d10 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -522,10 +522,10 @@ validate_replace_rtx_1 (loc, from, to, object)
{
case PLUS:
/* If we have a PLUS whose second operand is now a CONST_INT, use
- plus_constant to try to simplify it.
+ simplify_gen_binary to try to simplify it.
??? We may want later to remove this, once simplification is
separated from this function. */
- if (GET_CODE (XEXP (x, 1)) == CONST_INT)
+ if (GET_CODE (XEXP (x, 1)) == CONST_INT && XEXP (x, 1) == to)
validate_change (object, loc,
simplify_gen_binary
(PLUS, GET_MODE (x), XEXP (x, 0), XEXP (x, 1)), 1);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index e67e784d0e3..99af5fe5eeb 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2002-11-09 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR c/8439
+ * gcc.dg/testsuite/20021110.c: New test.
+
2002-11-10 Mark Mitchell <mark@codesourcery.com>
* g++.dg/abi/vthunk3.C: Run only on x86.
diff --git a/gcc/testsuite/gcc.dg/20021110.c b/gcc/testsuite/gcc.dg/20021110.c
new file mode 100644
index 00000000000..dd2aa7e09dd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20021110.c
@@ -0,0 +1,10 @@
+/* PR c/8439 */
+/* Verify that GCC properly handles null increments. */
+
+struct empty {
+};
+
+void foo(struct empty *p)
+{
+ p++;
+}