2018-03-08 Jakub Jelinek <jakub@redhat.com>
+ PR tree-optimization/84740
+ * tree-switch-conversion.c (process_switch): Call build_constructors
+ only if info.phi_count is non-zero.
+
PR tree-optimization/84739
* tree-tailcall.c (find_tail_calls): Check call arguments against
DECL_ARGUMENTS (current_function_decl) rather than
2018-03-08 Jakub Jelinek <jakub@redhat.com>
+ PR tree-optimization/84740
+ * gcc.dg/torture/pr84740.c: New test.
+
PR tree-optimization/84739
* gcc.dg/pr84739.c: New test.
--- /dev/null
+/* PR tree-optimization/84740 */
+
+void
+frobulate_for_gcc (unsigned int v)
+{
+ const char *s;
+ switch (v)
+ {
+ case 0:
+ s = "foo";
+ break;
+ case 1:
+ s = "bar";
+ break;
+ case 2:
+ s = "spam";
+ break;
+ default:
+ s = (const char *) 0;
+ break;
+ }
+ if (!s)
+ __builtin_printf ("%s\n", s);
+}
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. */