diff mbox series

[pushed,LRA] : Process output stack pointer reloads before emitting reload insns

Message ID 780e30e6-6005-5ff8-bf30-8e65a573d4c3@redhat.com
State New
Headers show
Series [pushed,LRA] : Process output stack pointer reloads before emitting reload insns | expand

Commit Message

Vladimir Makarov Aug. 14, 2023, 8:14 p.m. UTC
The patch fixes a failure of building aarch64 port with my yesterday patch.

The patch was successfully bootstrapped on x86-64 and aarch64.
commit c4760c0161f92b92361feba11836e3d066bb330c
Author: Vladimir N. Makarov <vmakarov@redhat.com>
Date:   Mon Aug 14 16:06:27 2023 -0400

    [LRA]: Process output stack pointer reloads before emitting reload insns
    
    Previous patch setting up asserts for processing stack pointer reloads
    caught an error in code moving sp offset.  This resulted in failure of
    building aarch64 port. The code wrongly processed insns beyond the
    output reloads of the current insn.  This patch fixes it.
    
    gcc/ChangeLog:
    
            * lra-constraints.cc (curr_insn_transform): Process output stack
            pointer reloads before emitting reload insns.
diff mbox series

Patch

diff --git a/gcc/lra-constraints.cc b/gcc/lra-constraints.cc
index 8d9443adeb6..c718bedff32 100644
--- a/gcc/lra-constraints.cc
+++ b/gcc/lra-constraints.cc
@@ -4840,7 +4840,6 @@  curr_insn_transform (bool check_only_p)
 	/* Most probably there are no enough registers to satisfy asm insn: */
 	lra_asm_insn_error (curr_insn);
     }
-  lra_process_new_insns (curr_insn, before, after, "Inserting insn reload");
   if (goal_alt_out_sp_reload_p)
     {
       /* We have an output stack pointer reload -- update sp offset: */
@@ -4863,6 +4862,7 @@  curr_insn_transform (bool check_only_p)
 	  }
       lra_assert (done_p);
     }
+  lra_process_new_insns (curr_insn, before, after, "Inserting insn reload");
   return change_p;
 }