Commit ce8b1a1f by Jakub Jelinek Committed by Jakub Jelinek

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
parent 686faaec
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.
......
/* 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);
}
......@@ -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. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment