Commit 1c653a41 by Jakub Jelinek Committed by Jakub Jelinek

re PR rtl-optimization/23098 (store of 0.0 to float)

	PR rtl-optimization/23098
	* cse.c (fold_rtx_mem): Call delegitimize_address target hook.
	* simplify-rtx.c (constant_pool_reference_p): New function.
	* rtl.h (constant_pool_reference_p): New prototype.
	* config/i386/i386.md (pushf split, mov[sdx]f split): Use
	constant_pool_reference_p in condition and
	avoid_constant_pool_reference in preparation statements.

	* gcc.target/i386/pr23098.c: New test.

From-SVN: r103935
parent 70a640af
2005-09-06 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/23098
* cse.c (fold_rtx_mem): Call delegitimize_address target hook.
* simplify-rtx.c (constant_pool_reference_p): New function.
* rtl.h (constant_pool_reference_p): New prototype.
* config/i386/i386.md (pushf split, mov[sdx]f split): Use
constant_pool_reference_p in condition and
avoid_constant_pool_reference in preparation statements.
2005-09-06 Andreas Krebbel <krebbel1@de.ibm.com>
* gcse.c (try_replace_reg): Disallow REG_EQUAL notes for
......
......@@ -2247,11 +2247,10 @@
(match_operand:SF 1 "memory_operand" ""))]
"reload_completed
&& GET_CODE (operands[1]) == MEM
&& GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF
&& CONSTANT_POOL_ADDRESS_P (XEXP (operands[1], 0))"
&& constant_pool_reference_p (operands[1])"
[(set (match_dup 0)
(match_dup 1))]
"operands[1] = get_pool_constant (XEXP (operands[1], 0));")
"operands[1] = avoid_constant_pool_reference (operands[1]);")
;; %%% Kill this when call knows how to work this out.
......@@ -2861,11 +2860,10 @@
&& GET_CODE (operands[1]) == MEM
&& (GET_MODE (operands[0]) == XFmode
|| GET_MODE (operands[0]) == SFmode || GET_MODE (operands[0]) == DFmode)
&& GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF
&& CONSTANT_POOL_ADDRESS_P (XEXP (operands[1], 0))"
&& constant_pool_reference_p (operands[1])"
[(set (match_dup 0) (match_dup 1))]
{
rtx c = get_pool_constant (XEXP (operands[1], 0));
rtx c = avoid_constant_pool_reference (operands[1]);
rtx r = operands[0];
if (GET_CODE (r) == SUBREG)
......
......@@ -3462,6 +3462,9 @@ fold_rtx_mem (rtx x, rtx insn)
addr = addr_ent->const_rtx;
}
/* Call target hook to avoid the effects of -fpic etc.... */
addr = targetm.delegitimize_address (addr);
/* If address is constant, split it into a base and integer
offset. */
if (GET_CODE (addr) == SYMBOL_REF || GET_CODE (addr) == LABEL_REF)
......
......@@ -1542,6 +1542,7 @@ extern rtx simplify_gen_subreg (enum machine_mode, rtx, enum machine_mode,
extern rtx simplify_replace_rtx (rtx, rtx, rtx);
extern rtx simplify_rtx (rtx);
extern rtx avoid_constant_pool_reference (rtx);
extern bool constant_pool_reference_p (rtx x);
extern bool mode_signbit_p (enum machine_mode, rtx);
/* In regclass.c */
......
......@@ -209,6 +209,14 @@ avoid_constant_pool_reference (rtx x)
return x;
}
/* Return true if X is a MEM referencing the constant pool. */
bool
constant_pool_reference_p (rtx x)
{
return avoid_constant_pool_reference (x) != x;
}
/* Make a unary operation by first seeing if it folds and otherwise making
the specified operation. */
......
2005-09-06 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/23098
* gcc.target/i386/pr23098.c: New test.
2005-09-05 Mark Mitchell <mark@codesourcery.com>
PR c++/23667
/* PR rtl-optimization/23098 */
/* { dg-do compile } */
/* { dg-options "-O2 -fPIC" } */
/* { dg-final { scan-assembler-not "\.LC\[0-9\]" } } */
double foo (float);
double
f1 (void)
{
return foo (1.0);
}
double
f2 (void)
{
return foo (0.0);
}
void
f3 (float *x, float t)
{
*x = 0.0 + t;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment