summaryrefslogtreecommitdiff
path: root/gcc/explow.c
diff options
context:
space:
mode:
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>1998-12-08 14:35:18 +0000
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>1998-12-08 14:35:18 +0000
commit986b0677c64b8131adbea466c0f6067b8dc15d24 (patch)
tree222aae21b16e1511fec6ca321219f63b15782abf /gcc/explow.c
parentd63ea2f2662df984f448bd99527dd0d97ccc0f75 (diff)
downloadgcc-986b0677c64b8131adbea466c0f6067b8dc15d24.tar.gz
* explow.c (plus_constant_wide): Don't immediately return with
result of recursive call. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@24195 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/explow.c')
-rw-r--r--gcc/explow.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/gcc/explow.c b/gcc/explow.c
index e4ef27dc37f..c11ec9130b8 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -116,19 +116,32 @@ plus_constant_wide (x, c)
integer. For a constant term that is not an explicit integer,
we cannot really combine, but group them together anyway.
- Use a recursive call in case the remaining operand is something
- that we handle specially, such as a SYMBOL_REF. */
+ Restart or use a recursive call in case the remaining operand is
+ something that we handle specially, such as a SYMBOL_REF.
+
+ We may not immediately return from the recursive call here, lest
+ all_constant gets lost. */
if (GET_CODE (XEXP (x, 1)) == CONST_INT)
- return plus_constant (XEXP (x, 0), c + INTVAL (XEXP (x, 1)));
+ {
+ c += INTVAL (XEXP (x, 1));
+ x = XEXP (x, 0);
+ goto restart;
+ }
else if (CONSTANT_P (XEXP (x, 0)))
- return gen_rtx_PLUS (mode,
- plus_constant (XEXP (x, 0), c),
- XEXP (x, 1));
+ {
+ x = gen_rtx_PLUS (mode,
+ plus_constant (XEXP (x, 0), c),
+ XEXP (x, 1));
+ c = 0;
+ }
else if (CONSTANT_P (XEXP (x, 1)))
- return gen_rtx_PLUS (mode,
- XEXP (x, 0),
- plus_constant (XEXP (x, 1), c));
+ {
+ x = gen_rtx_PLUS (mode,
+ XEXP (x, 0),
+ plus_constant (XEXP (x, 1), c));
+ c = 0;
+ }
break;
default: