loop.c (remove_constant_addition): Avoid clobbering a shared CONST expression.
* loop.c (remove_constant_addition): Avoid clobbering a shared CONST expression. Co-Authored-By: Jan Hubicka <jh@suse.cz> From-SVN: r49556
This commit is contained in:
parent
199ecb183b
commit
a2cd028f5f
@ -1,3 +1,9 @@
|
||||
2002-02-06 Janis Johnson <janis187@us.ibm.com>
|
||||
Jan Hubicka <jh@suse.cz>
|
||||
|
||||
* loop.c (remove_constant_addition): Avoid clobbering a shared
|
||||
CONST expression.
|
||||
|
||||
2002-02-06 Ulrich Weigand <uweigand@de.ibm.com>
|
||||
|
||||
* config.gcc (s390x-*-linux*): Add t-linux64 makefile fragment.
|
||||
|
13
gcc/loop.c
13
gcc/loop.c
@ -3683,8 +3683,19 @@ remove_constant_addition (x)
|
||||
HOST_WIDE_INT addval = 0;
|
||||
rtx exp = *x;
|
||||
|
||||
/* Avoid clobbering a shared CONST expression. */
|
||||
if (GET_CODE (exp) == CONST)
|
||||
exp = XEXP (exp, 0);
|
||||
{
|
||||
if (GET_CODE (XEXP (exp, 0)) == PLUS
|
||||
&& GET_CODE (XEXP (XEXP (exp, 0), 0)) == SYMBOL_REF
|
||||
&& GET_CODE (XEXP (XEXP (exp, 0), 1)) == CONST_INT)
|
||||
{
|
||||
*x = XEXP (XEXP (exp, 0), 0);
|
||||
return INTVAL (XEXP (XEXP (exp, 0), 1));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (GET_CODE (exp) == CONST_INT)
|
||||
{
|
||||
addval = INTVAL (exp);
|
||||
|
Loading…
Reference in New Issue
Block a user