aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-switch-conversion.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2018-03-08 08:29:42 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2018-03-08 08:29:42 +0100
commitce8b1a1f132aff97d670bd326dd89ae318cd3c68 (patch)
tree61dc23f5b9e429cfa27f5a1b470df71301004c45 /gcc/tree-switch-conversion.c
parent686faaece353242d733dec4eb47647ef0ae1335f (diff)
re PR tree-optimization/84740 (ICE in build_constructors, at tree-switch-conversion.c:965)
PR tree-optimization/84740 * tree-switch-conversion.c (process_switch): Call build_constructors only if info.phi_count is non-zero. * gcc.dg/torture/pr84740.c: New test. From-SVN: r258354
Diffstat (limited to 'gcc/tree-switch-conversion.c')
-rw-r--r--gcc/tree-switch-conversion.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c
index c2538908340..2da7068345c 100644
--- a/gcc/tree-switch-conversion.c
+++ b/gcc/tree-switch-conversion.c
@@ -1563,7 +1563,8 @@ process_switch (gswitch *swtch)
gather_default_values (info.default_case_nonstandard
? gimple_switch_label (swtch, 1)
: gimple_switch_default_label (swtch), &info);
- build_constructors (swtch, &info);
+ if (info.phi_count)
+ build_constructors (swtch, &info);
build_arrays (swtch, &info); /* Build the static arrays and assignments. */
gen_inbound_check (swtch, &info); /* Build the bounds check. */