public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-8826] RISC-V: Fix infinite compilation of VSETVL PASS
@ 2024-02-06 12:49 Pan Li
  0 siblings, 0 replies; only message in thread
From: Pan Li @ 2024-02-06 12:49 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:d29136ad3282905145e24d7ec10b6efe4ab5d2f1

commit r14-8826-gd29136ad3282905145e24d7ec10b6efe4ab5d2f1
Author: Juzhe-Zhong <juzhe.zhong@rivai.ai>
Date:   Tue Feb 6 07:12:24 2024 +0800

    RISC-V: Fix infinite compilation of VSETVL PASS
    
    This patch fixes issue reported by Jeff.
    
    Testing is running. Ok for trunk if I passed the testing with no regression ?
    
    gcc/ChangeLog:
    
            * config/riscv/riscv-vsetvl.cc (pre_vsetvl::emit_vsetvl): Fix inifinite compilation.
            (pre_vsetvl::remove_vsetvl_pre_insns): Ditto.

Diff:
---
 gcc/config/riscv/riscv-vsetvl.cc | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/gcc/config/riscv/riscv-vsetvl.cc b/gcc/config/riscv/riscv-vsetvl.cc
index 2c0dcdf18c56..32f262de199f 100644
--- a/gcc/config/riscv/riscv-vsetvl.cc
+++ b/gcc/config/riscv/riscv-vsetvl.cc
@@ -2281,9 +2281,8 @@ private:
       }
   }
 
-  void remove_vsetvl_insn (const vsetvl_info &info)
+  void remove_vsetvl_insn (rtx_insn *rinsn)
   {
-    rtx_insn *rinsn = info.get_insn ()->rtl ();
     if (dump_file)
       {
 	fprintf (dump_file, "  Eliminate insn %d:\n", INSN_UID (rinsn));
@@ -3231,7 +3230,7 @@ pre_vsetvl::emit_vsetvl ()
 	  if (curr_info.delete_p ())
 	    {
 	      if (vsetvl_insn_p (insn->rtl ()))
-		remove_vsetvl_insn (curr_info);
+		remove_vsetvl_insn (curr_info.get_insn ()->rtl ());
 	      continue;
 	    }
 	  else if (curr_info.valid_p ())
@@ -3269,7 +3268,7 @@ pre_vsetvl::emit_vsetvl ()
   for (const vsetvl_info &item : m_delete_list)
     {
       gcc_assert (vsetvl_insn_p (item.get_insn ()->rtl ()));
-      remove_vsetvl_insn (item);
+      remove_vsetvl_insn (item.get_insn ()->rtl ());
     }
 
   /* Insert vsetvl info that was not deleted after lift up.  */
@@ -3434,7 +3433,7 @@ pre_vsetvl::remove_vsetvl_pre_insns ()
 		       INSN_UID (rinsn));
 	      print_rtl_single (dump_file, rinsn);
 	    }
-	  remove_insn (rinsn);
+	  remove_vsetvl_insn (rinsn);
 	}
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-02-06 12:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-06 12:49 [gcc r14-8826] RISC-V: Fix infinite compilation of VSETVL PASS Pan Li

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).