https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63620

--- Comment #19 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Vladimir Makarov from comment #18)
> (In reply to Jeffrey A. Law from comment #17)
> > So would it work (and I realize this is a horrid hack) to have a way for the
> > backend to set the pic-pseudo as live at the key points during IRA?  It'll
> > be overly conservative, but it may still be better than going back to a
> > fixed PIC register.  If we had the conservative live information during IRA,
> > presumably it would flow through to LRA and avoid this problem?
> 
> I believe it will disable the optimization completely too.  It is up to
> Intel guys to decide how to disable the optimization *temporarily* with
> minimal efforts most probably only for 2 weeks.

Following patch mitigates bootstrap problems:

--cut here--
Index: config/i386/i386.md
===================================================================
--- config/i386/i386.md (revision 216952)
+++ config/i386/i386.md (working copy)
@@ -2736,7 +2736,10 @@
 (define_insn "*pushtf"
   [(set (match_operand:TF 0 "push_operand" "=<,<")
        (match_operand:TF 1 "general_no_elim_operand" "x,*roF"))]
-  "TARGET_64BIT || TARGET_SSE"
+  "(TARGET_64BIT || TARGET_SSE)
+   && (!can_create_pseudo_p ()
+       || GET_CODE (operands[1]) != CONST_DOUBLE
+       || standard_sse_constant_p (operands[1]))"
 {
   /* This insn should be already split before reg-stack.  */
   gcc_unreachable ();
@@ -2761,7 +2764,9 @@
 (define_insn "*pushxf"
   [(set (match_operand:XF 0 "push_operand" "=<,<")
        (match_operand:XF 1 "general_no_elim_operand" "f,Yx*roF"))]
-  ""
+  "!can_create_pseudo_p ()
+   || GET_CODE (operands[1]) != CONST_DOUBLE
+   || standard_80387_constant_p (operands[1]) > 0"
 {
   /* This insn should be already split before reg-stack.  */
   gcc_unreachable ();
@@ -2792,7 +2797,12 @@
 (define_insn "*pushdf"
   [(set (match_operand:DF 0 "push_operand" "=<,<,<,<")
        (match_operand:DF 1 "general_no_elim_operand" "f,Yd*roF,rmF,x"))]
-  ""
+  "!can_create_pseudo_p ()
+   || GET_CODE (operands[1]) != CONST_DOUBLE
+   || (!(TARGET_SSE2 && TARGET_SSE_MATH)
+       && standard_80387_constant_p (operands[1]) > 0)
+   || (TARGET_SSE2 && TARGET_SSE_MATH
+       && standard_sse_constant_p (operands[1]))"
 {
   /* This insn should be already split before reg-stack.  */
   gcc_unreachable ();
--cut here--

The above patch solves all but corner problems, but generates non-optimal push
sequences for constants when general registers are available.

So, we can refer to the above hacky patch to "fix" current bootstrap problems.
This way it is possible to survive a couple of weeks, until the real fix is
available.

Reply via email to