]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
aarch64: Don't update EH info when folding [PR107209]
authorRichard Biener <rguenther@suse.de>
Fri, 13 Jan 2023 10:01:32 +0000 (10:01 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Fri, 13 Jan 2023 10:01:32 +0000 (10:01 +0000)
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.

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
gcc/testsuite/gcc.target/aarch64/pr107209.c [new file with mode: 0644]

index c8335e7def7ce6c520a4968868f477d09f55bcc7..80b71a7b612fa62a4b14ed63a7a296bef8d3b60c 100644 (file)
@@ -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 (file)
index 0000000..b86a6ea
--- /dev/null
@@ -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);
+}