diff options
author | J"orn Rennecke <amylaar@cygnus.co.uk> | 1998-12-08 14:35:18 +0000 |
---|---|---|
committer | Joern Rennecke <amylaar@gcc.gnu.org> | 1998-12-08 14:35:18 +0000 |
commit | 03d937fcebea686f9d4f456daa0f8251e0de67c8 (patch) | |
tree | 222aae21b16e1511fec6ca321219f63b15782abf /gcc/explow.c | |
parent | e6cfb550ab17484da95c0a3e94773fa42dccd27c (diff) | |
download | gcc-03d937fcebea686f9d4f456daa0f8251e0de67c8.zip gcc-03d937fcebea686f9d4f456daa0f8251e0de67c8.tar.gz gcc-03d937fcebea686f9d4f456daa0f8251e0de67c8.tar.bz2 |
explow.c (plus_constant_wide): Don't immediately return with result of recursive call.
* explow.c (plus_constant_wide): Don't immediately return with
result of recursive call.
From-SVN: r24195
Diffstat (limited to 'gcc/explow.c')
-rw-r--r-- | gcc/explow.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/gcc/explow.c b/gcc/explow.c index e4ef27d..c11ec91 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: |