public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/107920] [13 Regression] ICE in execute_todo, at passes.cc:2140
Date: Wed, 30 Nov 2022 11:51:37 +0000	[thread overview]
Message-ID: <bug-107920-4-Ko4hkgGHpb@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-107920-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #7)
> Something like this should fix the issue (note setting the location should
> be done also):
> diff --git a/gcc/config/aarch64/aarch64-sve-builtins-base.cc
> b/gcc/config/aarch64/aarch64-sve-builtins-base.cc
> index 6347407555f..d0a0a3a0a46 100644
> --- a/gcc/config/aarch64/aarch64-sve-builtins-base.cc
> +++ b/gcc/config/aarch64/aarch64-sve-builtins-base.cc
> @@ -1232,6 +1232,15 @@ public:
>         tree mem_ref_op = fold_build2 (MEM_REF, access_type, arg1, zero);
>         gimple *mem_ref_stmt
>           = gimple_build_assign (mem_ref_lhs, mem_ref_op);
> +
> +       // Set the location of load
> +       gimple_set_location (mem_ref_stmt, gimple_location (f.call));
> +
> +       // Set the vuse for the load from the call
> +       tree reaching_vuse = gimple_vuse (f.call);
> +       gcc_assert (reaching_vuse && TREE_CODE (reaching_vuse) == SSA_NAME);
> +       gimple_set_vuse (mem_ref_stmt, reaching_vuse);
> +
>         gsi_insert_before (f.gsi, mem_ref_stmt, GSI_SAME_STMT);
> 
>         int source_nelts = TYPE_VECTOR_SUBPARTS (access_type).to_constant ();

All this should build a sequence of the replacement stmts and then use
gsi_replace_with_seq.

Note transfering EH will not work during folding since that would require
splitting the block.  Does the builtin even throw with non-call EH?  Why
does it throw without?

  parent reply	other threads:[~2022-11-30 11:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29 16:53 [Bug tree-optimization/107920] New: " asolokha at gmx dot com
2022-11-29 18:42 ` [Bug tree-optimization/107920] " pinskia at gcc dot gnu.org
2022-11-29 18:46 ` pinskia at gcc dot gnu.org
2022-11-29 18:50 ` pinskia at gcc dot gnu.org
2022-11-29 18:51 ` pinskia at gcc dot gnu.org
2022-11-29 19:18 ` pinskia at gcc dot gnu.org
2022-11-29 19:54 ` pinskia at gcc dot gnu.org
2022-11-29 19:59 ` [Bug target/107920] " pinskia at gcc dot gnu.org
2022-11-29 20:12 ` pinskia at gcc dot gnu.org
2022-11-29 20:36 ` pinskia at gcc dot gnu.org
2022-11-30 11:48 ` rguenth at gcc dot gnu.org
2022-11-30 11:51 ` rguenth at gcc dot gnu.org [this message]
2022-11-30 16:56 ` prathamesh3492 at gcc dot gnu.org
2022-12-01 12:22 ` jakub at gcc dot gnu.org
2022-12-01 18:06 ` prathamesh3492 at gcc dot gnu.org
2022-12-02  9:13 ` prathamesh3492 at gcc dot gnu.org
2022-12-07  8:06 ` cvs-commit at gcc dot gnu.org
2022-12-08 15:55 ` jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-107920-4-Ko4hkgGHpb@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).