aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2022-04-05 09:51:32 +0200
committerRichard Biener <rguenther@suse.de>2022-04-05 09:54:46 +0200
commite68f5c90bae44e886bd1b13a135dbfd00bceea0a (patch)
treeb8f7bacc12e0f609e27f4ace51990b4ff3016389 /gcc
parent2874772c4b597daa66ace0ef28b401d597307a03 (diff)
downloadgcc-e68f5c90bae44e886bd1b13a135dbfd00bceea0a.zip
gcc-e68f5c90bae44e886bd1b13a135dbfd00bceea0a.tar.gz
gcc-e68f5c90bae44e886bd1b13a135dbfd00bceea0a.tar.bz2
c/105151 - move early walloca pass
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. 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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/passes.def2
-rw-r--r--gcc/testsuite/gcc.dg/gimplefe-error-14.c8
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/passes.def b/gcc/passes.def
index 3e44797..375d3d6 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 0000000..3e1a132
--- /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" } */
+}