This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, middle-end]: Committed: Fix PR middle-end/33794: Wrong code w/ -ffast-math


Hello!

This is basically a trivial one-liner patch that fixes a recently
exposed failure with Polyhedron benchmark. The problem distilled into
missing regstack swap insn that is needed for x87 fptan insn.

The patch was bootstrapped and regression tested on i686-pc-linux-gnu.

Patch is committed to mainline because it is trivial and because the
regression was introduced by me when fptan pattern was
improved^Wrewritten ;)

2007-10-17  Uros Bizjak  <ubizjak@gmail.com>

	PR middle-end/33794
	* reg-stack.c (move_for_stack_reg): Swap input argument of
	UNSPEC_TAN insn to the top of the stack.

Uros.

Index: reg-stack.c
===================================================================
--- reg-stack.c (revision 129402)
+++ reg-stack.c (working copy)
@@ -1085,11 +1085,13 @@ move_for_stack_reg (rtx insn, stack regs
         special case with i387 UNSPEC_TAN, where destination is live
         (an argument to fptan) but inherent load of 1.0 is modelled
         as a load from a constant.  */
-      if (! (GET_CODE (pat) == PARALLEL
-            && XVECLEN (pat, 0) == 2
-            && GET_CODE (XVECEXP (pat, 0, 1)) == SET
-            && GET_CODE (SET_SRC (XVECEXP (pat, 0, 1))) == UNSPEC
-            && XINT (SET_SRC (XVECEXP (pat, 0, 1)), 1) == UNSPEC_TAN))
+      if (GET_CODE (pat) == PARALLEL
+         && XVECLEN (pat, 0) == 2
+         && GET_CODE (XVECEXP (pat, 0, 1)) == SET
+         && GET_CODE (SET_SRC (XVECEXP (pat, 0, 1))) == UNSPEC
+         && XINT (SET_SRC (XVECEXP (pat, 0, 1)), 1) == UNSPEC_TAN)
+       emit_swap_insn (insn, regstack, dest);
+      else
        gcc_assert (get_hard_regnum (regstack, dest) < FIRST_STACK_REG);

       gcc_assert (regstack->top < REG_STACK_SIZE);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]