public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [pushed]LRA]: Fix asserts for output stack pointer reloads
@ 2023-08-14  1:09 Vladimir Makarov
  2023-08-14 18:37 ` Prathamesh Kulkarni
  0 siblings, 1 reply; 3+ messages in thread
From: Vladimir Makarov @ 2023-08-14  1:09 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 105 bytes --]

The following patch fixes useless asserts in my latest patch 
implementing output stack pointer reloads.

[-- Attachment #2: z --]
[-- Type: text/plain, Size: 1215 bytes --]

commit 18b417fe1a46d37738243267c1f559cd0acc4886
Author: Vladimir N. Makarov <vmakarov@redhat.com>
Date:   Sun Aug 13 20:54:58 2023 -0400

    [LRA]: Fix asserts for output stack pointer reloads
    
    The patch implementing output stack pointer reloads contained superfluous
    asserts.  The patch makes them useful.
    
    gcc/ChangeLog:
    
            * lra-constraints.cc (curr_insn_transform): Set done_p up and
            check it on true after processing output stack pointer reload.

diff --git a/gcc/lra-constraints.cc b/gcc/lra-constraints.cc
index 26239908747..8d9443adeb6 100644
--- a/gcc/lra-constraints.cc
+++ b/gcc/lra-constraints.cc
@@ -4852,6 +4852,7 @@ curr_insn_transform (bool check_only_p)
 	    && SET_DEST (set) == stack_pointer_rtx)
 	  {
 	    lra_assert (!done_p);
+	    done_p = true;
 	    curr_id->sp_offset = 0;
 	    lra_insn_recog_data_t id = lra_get_insn_recog_data (insn);
 	    id->sp_offset = sp_offset;
@@ -4860,7 +4861,7 @@ curr_insn_transform (bool check_only_p)
 		       "            Moving sp offset from insn %u to %u\n",
 		       INSN_UID (curr_insn), INSN_UID (insn));
 	  }
-      lra_assert (!done_p);
+      lra_assert (done_p);
     }
   return change_p;
 }

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-14 19:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-14  1:09 [pushed]LRA]: Fix asserts for output stack pointer reloads Vladimir Makarov
2023-08-14 18:37 ` Prathamesh Kulkarni
2023-08-14 19:15   ` Vladimir Makarov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).