+2005-12-30 Roger Sayle <roger@eyesopen.com>
+
+ PR target/25213
+ Backport from mainline
+ 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-12-30 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
PR fortran/25586
(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.
&& 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)
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)
base = addr;
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);
/* In function.c */
extern rtx gen_mem_addressof (rtx, tree, int);
return gen_rtx_fmt_eee (code, mode, op0, op1, op2);
}
+
+/* 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;
+}
\f
/* Likewise, for relational operations.
CMP_MODE specifies mode comparison is done in.
+2005-12-30 Roger Sayle <roger@eyesopen.com>
+
+ PR target/25213
+ * gcc.dg/pr23098.c: Backport testcase from mainline.
+
2005-12-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* g++.dg/rtti/tinfo1.C: Scan for ".global" also.
--- /dev/null
+/* PR rtl-optimization/23098 */
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -fPIC" } */
+/* { dg-final { scan-assembler-not "\.LC\[0-9\]" } } */
+/* { dg-require-effective-target ilp32 } */
+
+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;
+}