public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] c/105151 - move early walloca pass
@ 2022-04-05  7:54 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2022-04-05  7:54 UTC (permalink / raw)
  To: gcc-patches

When the walloca pass gained support for ranger the early pass
was not moved to a place where SSA form is available but remained
in the lowering pipeline.  For the testcase in this bug this is
a problem because for errorneous input we still run the lowering
pipeline but here have broken SSA form which ranger does not like.
The solution is to rectify the mistake with using ranger without
SSA form and move the pass which solves both issues.

Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.

2022-04-05  Richard Biener  <rguenther@suse.de>

	PR c/105151
	* passes.def (pass_walloca): Move early instance into
	pass_build_ssa_passes to make SSA form available.

	* gcc.dg/gimplefe-error-14.c: New testcase.
---
 gcc/passes.def                           | 2 +-
 gcc/testsuite/gcc.dg/gimplefe-error-14.c | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)
 create mode 100644 gcc/testsuite/gcc.dg/gimplefe-error-14.c

diff --git a/gcc/passes.def b/gcc/passes.def
index 3e44797b10f..375d3d62d51 100644
--- a/gcc/passes.def
+++ b/gcc/passes.def
@@ -45,7 +45,6 @@ along with GCC; see the file COPYING3.  If not see
   NEXT_PASS (pass_warn_function_return);
   NEXT_PASS (pass_coroutine_early_expand_ifns);
   NEXT_PASS (pass_expand_omp);
-  NEXT_PASS (pass_walloca, /*strict_mode_p=*/true);
   NEXT_PASS (pass_build_cgraph_edges);
   TERMINATE_PASS_LIST (all_lowering_passes)
 
@@ -57,6 +56,7 @@ along with GCC; see the file COPYING3.  If not see
   PUSH_INSERT_PASSES_WITHIN (pass_build_ssa_passes)
       NEXT_PASS (pass_fixup_cfg);
       NEXT_PASS (pass_build_ssa);
+      NEXT_PASS (pass_walloca, /*strict_mode_p=*/true);
       NEXT_PASS (pass_warn_printf);
       NEXT_PASS (pass_warn_nonnull_compare);
       NEXT_PASS (pass_early_warn_uninitialized);
diff --git a/gcc/testsuite/gcc.dg/gimplefe-error-14.c b/gcc/testsuite/gcc.dg/gimplefe-error-14.c
new file mode 100644
index 00000000000..3e1a13219b1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gimplefe-error-14.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-fgimple" } */
+
+int __GIMPLE () foo ()
+{
+  int _1;
+  return a_1(D);  /* { dg-error "cannot have default definition" } */
+}
-- 
2.34.1

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

only message in thread, other threads:[~2022-04-05  7:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-05  7:54 [PATCH] c/105151 - move early walloca pass Richard Biener

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