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

--- Comment #10 from Bernd Schmidt <bernds at gcc dot gnu.org> ---
Looks to me like epilogue_completed would be a good predicate. I'll put the
following in a bootstrap, let me know if you're OK with this patch.

Index: i386.md
===================================================================
--- i386.md     (revision 235808)
+++ i386.md     (working copy)
@@ -5196,12 +5196,13 @@ (define_split

 ;; Break partial reg stall for cvtsd2ss.

-(define_peephole2
+(define_split
   [(set (match_operand:SF 0 "register_operand")
         (float_truncate:SF
          (match_operand:DF 1 "nonimmediate_operand")))]
   "TARGET_SSE2 && TARGET_SSE_MATH
    && TARGET_SSE_PARTIAL_REG_DEPENDENCY
+   && epilogue_completed
    && optimize_function_for_speed_p (cfun)
    && SSE_REG_P (operands[0])
    && (!SSE_REG_P (operands[1])
@@ -5223,13 +5224,14 @@ (define_peephole2

 ;; Break partial reg stall for cvtss2sd.

-(define_peephole2
+(define_split
   [(set (match_operand:DF 0 "register_operand")
         (float_extend:DF
           (match_operand:SF 1 "nonimmediate_operand")))]
   "TARGET_SSE2 && TARGET_SSE_MATH
    && TARGET_SSE_PARTIAL_REG_DEPENDENCY
+   && epilogue_completed
    && optimize_function_for_speed_p (cfun)
    && SSE_REG_P (operands[0])
    && (!SSE_REG_P (operands[1])
        || REGNO (operands[0]) != REGNO (operands[1]))

Reply via email to