public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Committed] RISC-V: Fix PR112888 ICE
@ 2023-12-06 22:35 Juzhe-Zhong
  2023-12-06 23:34 ` Patrick O'Neill
  0 siblings, 1 reply; 2+ messages in thread
From: Juzhe-Zhong @ 2023-12-06 22:35 UTC (permalink / raw)
  To: gcc-patches; +Cc: Juzhe-Zhong

Committed as it is ovbious.

gcc/ChangeLog:

	* config/riscv/riscv-vsetvl.cc (extract_single_source): new function.
	(pre_vsetvl::compute_lcm_local_properties): Fix ICE.

---
 gcc/config/riscv/riscv-vsetvl.cc | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/gcc/config/riscv/riscv-vsetvl.cc b/gcc/config/riscv/riscv-vsetvl.cc
index 68f0be7e81d..90477f331d7 100644
--- a/gcc/config/riscv/riscv-vsetvl.cc
+++ b/gcc/config/riscv/riscv-vsetvl.cc
@@ -596,6 +596,14 @@ extract_single_source (set_info *set)
   return first_insn;
 }
 
+static insn_info *
+extract_single_source (def_info *def)
+{
+  if (!def)
+    return nullptr;
+  return extract_single_source (dyn_cast<set_info *> (def));
+}
+
 static bool
 same_equiv_note_p (set_info *set1, set_info *set2)
 {
@@ -2692,9 +2700,7 @@ pre_vsetvl::compute_lcm_local_properties ()
 			  def_lookup dl = crtl->ssa->find_def (resource, insn);
 			  def_info *def
 			    = dl.matching_set_or_last_def_of_prev_group ();
-			  gcc_assert (def);
-			  insn_info *def_insn = extract_single_source (
-			    dyn_cast<set_info *> (def));
+			  insn_info *def_insn = extract_single_source (def);
 			  if (def_insn && vsetvl_insn_p (def_insn->rtl ()))
 			    {
 			      vsetvl_info def_info = vsetvl_info (def_insn);
-- 
2.36.3


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

* Re: [Committed] RISC-V: Fix PR112888 ICE
  2023-12-06 22:35 [Committed] RISC-V: Fix PR112888 ICE Juzhe-Zhong
@ 2023-12-06 23:34 ` Patrick O'Neill
  0 siblings, 0 replies; 2+ messages in thread
From: Patrick O'Neill @ 2023-12-06 23:34 UTC (permalink / raw)
  To: Juzhe-Zhong, gcc-patches

Committed on behalf of Juzhe since he was having internet issues.

Thanks,
Patrick

On 12/6/23 14:35, Juzhe-Zhong wrote:
> Committed as it is ovbious.
>
> gcc/ChangeLog:
>
> 	* config/riscv/riscv-vsetvl.cc (extract_single_source): new function.
> 	(pre_vsetvl::compute_lcm_local_properties): Fix ICE.
>
> ---
>   gcc/config/riscv/riscv-vsetvl.cc | 12 +++++++++---
>   1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/gcc/config/riscv/riscv-vsetvl.cc b/gcc/config/riscv/riscv-vsetvl.cc
> index 68f0be7e81d..90477f331d7 100644
> --- a/gcc/config/riscv/riscv-vsetvl.cc
> +++ b/gcc/config/riscv/riscv-vsetvl.cc
> @@ -596,6 +596,14 @@ extract_single_source (set_info *set)
>     return first_insn;
>   }
>   
> +static insn_info *
> +extract_single_source (def_info *def)
> +{
> +  if (!def)
> +    return nullptr;
> +  return extract_single_source (dyn_cast<set_info *> (def));
> +}
> +
>   static bool
>   same_equiv_note_p (set_info *set1, set_info *set2)
>   {
> @@ -2692,9 +2700,7 @@ pre_vsetvl::compute_lcm_local_properties ()
>   			  def_lookup dl = crtl->ssa->find_def (resource, insn);
>   			  def_info *def
>   			    = dl.matching_set_or_last_def_of_prev_group ();
> -			  gcc_assert (def);
> -			  insn_info *def_insn = extract_single_source (
> -			    dyn_cast<set_info *> (def));
> +			  insn_info *def_insn = extract_single_source (def);
>   			  if (def_insn && vsetvl_insn_p (def_insn->rtl ()))
>   			    {
>   			      vsetvl_info def_info = vsetvl_info (def_insn);

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

end of thread, other threads:[~2023-12-06 23:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-06 22:35 [Committed] RISC-V: Fix PR112888 ICE Juzhe-Zhong
2023-12-06 23:34 ` Patrick O'Neill

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