Commit 73cca0cc by Vladimir Makarov Committed by Vladimir Makarov

re PR rtl-optimization/56144 (ICE in get_reload_reg, at lra-constraints.c:421)

2013-01-30  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/56144
	* lra-constraints.c (get_reload_reg): Don't reuse reload pseudo
	for values with side effects.

2013-01-30  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/56144
	* gcc.dg/pr56144.c: New.

From-SVN: r195582
parent 162b4e41
2013-01-30 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/56144
* lra-constraints.c (get_reload_reg): Don't reuse reload pseudo
for values with side effects.
2013-01-30 Richard Biener <rguenther@suse.de>
* sparseset.h (sparseset_bit_p): Use gcc_checking_assert.
......
......@@ -414,24 +414,26 @@ get_reload_reg (enum op_type type, enum machine_mode mode, rtx original,
= lra_create_new_reg_with_unique_value (mode, original, rclass, title);
return true;
}
for (i = 0; i < curr_insn_input_reloads_num; i++)
if (rtx_equal_p (curr_insn_input_reloads[i].input, original)
&& in_class_p (curr_insn_input_reloads[i].reg, rclass, &new_class))
{
lra_assert (! side_effects_p (original));
*result_reg = curr_insn_input_reloads[i].reg;
regno = REGNO (*result_reg);
if (lra_dump_file != NULL)
{
fprintf (lra_dump_file, " Reuse r%d for reload ", regno);
dump_value_slim (lra_dump_file, original, 1);
}
if (new_class != lra_get_allocno_class (regno))
change_class (regno, new_class, ", change", false);
if (lra_dump_file != NULL)
fprintf (lra_dump_file, "\n");
return false;
}
/* Prevent reuse value of expression with side effects,
e.g. volatile memory. */
if (! side_effects_p (original))
for (i = 0; i < curr_insn_input_reloads_num; i++)
if (rtx_equal_p (curr_insn_input_reloads[i].input, original)
&& in_class_p (curr_insn_input_reloads[i].reg, rclass, &new_class))
{
*result_reg = curr_insn_input_reloads[i].reg;
regno = REGNO (*result_reg);
if (lra_dump_file != NULL)
{
fprintf (lra_dump_file, " Reuse r%d for reload ", regno);
dump_value_slim (lra_dump_file, original, 1);
}
if (new_class != lra_get_allocno_class (regno))
change_class (regno, new_class, ", change", false);
if (lra_dump_file != NULL)
fprintf (lra_dump_file, "\n");
return false;
}
*result_reg = lra_create_new_reg (mode, original, rclass, title);
lra_assert (curr_insn_input_reloads_num < LRA_MAX_INSN_RELOADS);
curr_insn_input_reloads[curr_insn_input_reloads_num].input = original;
......
2013-01-30 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/56144
* gcc.dg/pr56144.c: New.
2013-01-30 David Edelsohn <dje.gcc@gmail.com>
* g++.dg/cpp0x/constexpr-53094-2.C: Ignore non-standard ABI
message.
* g++.dg/cpp0x/constexpr-53094-3.C: Same.
* g++.dg/cpp0x/constexpr-55573.C: Same
2013-01-30 Georg-Johann Lay <avr@gjlay.de>
PR tree-optimization/56064
......
/* PR rtl-optimization/56144 */
/* { dg-do compile } */
/* { dg-options "-O" } */
int a;
union U0 { volatile unsigned f2, f4; };
volatile int b;
static union U0 c;
volatile unsigned d, f;
volatile int e, g, h, i, j, k, l, m, n, o, p;
int
main ()
{
a = b;
a += c.f2;
a += c.f4;
unsigned q = h;
a += q;
q = g;
a += q;
a += f;
q = e;
a += q;
a += d;
a += 2L;
a += j;
a += i;
a += k;
a += p;
a += o;
a += n;
a += m;
a += l;
return 0;
}
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