-freduce-all-givs and fortran
Richard Henderson
rth@redhat.com
Thu Sep 6 14:47:00 GMT 2001
On Thu, Sep 06, 2001 at 10:28:08PM +0200, Toon Moene wrote:
> Somehow, the giv-combine code doesn't examine the base addresses of
> these arrays [quoting swim.f.11.loop]:
[...]
> Giv 80: insn 40 src reg 69 benefit 4 lifetime 8 replaceable
> mult (4)
> add (const (plus (symbol_ref ("com_")) (-4)))
> Giv 88: insn 51 src reg 69 benefit 4 lifetime 3 replaceable
> mult (4)
> add (const (plus (symbol_ref ("com_")) (396)))
Whee.
r~
Index: simplify-rtx.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/simplify-rtx.c,v
retrieving revision 1.41.2.3
diff -c -p -d -r1.41.2.3 simplify-rtx.c
*** simplify-rtx.c 2001/04/05 00:52:19 1.41.2.3
--- simplify-rtx.c 2001/09/06 21:45:16
*************** simplify_binary_operation (code, mode, o
*** 1110,1115 ****
--- 1110,1137 ----
return simplify_gen_binary (AND, mode, op0,
gen_rtx_NOT (mode, XEXP (op1, 0)));
}
+
+ /* Simplify operations with constants containing embedded offsets. */
+ if (GET_CODE (op0) == CONST)
+ {
+ tem = simplify_binary_operation (code, mode, XEXP (op0, 0), op1);
+ if (tem)
+ {
+ if (CONSTANT_P (op1) && ! CONSTANT_P (tem))
+ tem = gen_rtx_CONST (mode, tem);
+ return tem;
+ }
+ }
+ if (GET_CODE (op1) == CONST)
+ {
+ tem = simplify_binary_operation (code, mode, op0, XEXP (op1, 0));
+ if (tem)
+ {
+ if (CONSTANT_P (op0) && ! CONSTANT_P (tem))
+ tem = gen_rtx_CONST (mode, tem);
+ return tem;
+ }
+ }
break;
case MULT:
More information about the Gcc
mailing list