public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Cc: Richard Biener <rguenther@suse.de>
Subject: [pushed] aarch64: Don't update EH info when folding [PR107209]
Date: Fri, 13 Jan 2023 10:03:34 +0000	[thread overview]
Message-ID: <mpt8ri6u4y1.fsf@arm.com> (raw)

The AArch64 folders tried to update EH info on the fly, bypassing
the folder's attempts to remove dead EH edges later.  This triggered
an ICE when folding a potentially-trapping call to a constant.

Thanks to Richard for the patch.  Tested on aarch64-linux-gnu & pushed.

gcc/
	PR target/107209
	* config/aarch64/aarch64.cc (aarch64_gimple_fold_builtin): Don't
	update EH info on the fly.

gcc/testsuite/
	* gcc.target/aarch64/pr107209.c: New test.

Co-Authored-By: Richard Biener <rguenther@suse.de>
---
 gcc/config/aarch64/aarch64.cc               |  2 +-
 gcc/testsuite/gcc.target/aarch64/pr107209.c | 16 ++++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)
 create mode 100644 gcc/testsuite/gcc.target/aarch64/pr107209.c

diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
index c8335e7def7..80b71a7b612 100644
--- a/gcc/config/aarch64/aarch64.cc
+++ b/gcc/config/aarch64/aarch64.cc
@@ -15348,7 +15348,7 @@ aarch64_gimple_fold_builtin (gimple_stmt_iterator *gsi)
   if (!new_stmt)
     return false;
 
-  gsi_replace (gsi, new_stmt, true);
+  gsi_replace (gsi, new_stmt, false);
   return true;
 }
 
diff --git a/gcc/testsuite/gcc.target/aarch64/pr107209.c b/gcc/testsuite/gcc.target/aarch64/pr107209.c
new file mode 100644
index 00000000000..b86a6ea9036
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/pr107209.c
@@ -0,0 +1,16 @@
+/* { dg-options "-O2 -fnon-call-exceptions -fno-tree-fre" } */
+
+#include <arm_neon.h>
+
+float64x1_t
+foo (void)
+{
+  float64_t v1 = 3.14159265359;
+  float64_t v2 = 1.383894;
+  float64_t vec_1_data[] = {v1};
+  float64_t vec_2_data[] = {v2};
+  float64x1_t vec_1 = vld1_f64 (vec_1_data);
+  float64x1_t vec_2 = vld1_f64 (vec_2_data);
+
+  return vmulx_f64 (vec_1, vec_2);
+}
-- 
2.25.1


                 reply	other threads:[~2023-01-13 10:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=mpt8ri6u4y1.fsf@arm.com \
    --to=rguenther@suse.de \
    --cc=gcc-patches@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).