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> 2013-01-30 Richard Biener <rguenther@suse.de>
* sparseset.h (sparseset_bit_p): Use gcc_checking_assert. * sparseset.h (sparseset_bit_p): Use gcc_checking_assert.
......
...@@ -414,11 +414,13 @@ get_reload_reg (enum op_type type, enum machine_mode mode, rtx original, ...@@ -414,11 +414,13 @@ get_reload_reg (enum op_type type, enum machine_mode mode, rtx original,
= lra_create_new_reg_with_unique_value (mode, original, rclass, title); = lra_create_new_reg_with_unique_value (mode, original, rclass, title);
return true; return true;
} }
/* 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++) for (i = 0; i < curr_insn_input_reloads_num; i++)
if (rtx_equal_p (curr_insn_input_reloads[i].input, original) if (rtx_equal_p (curr_insn_input_reloads[i].input, original)
&& in_class_p (curr_insn_input_reloads[i].reg, rclass, &new_class)) && 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; *result_reg = curr_insn_input_reloads[i].reg;
regno = REGNO (*result_reg); regno = REGNO (*result_reg);
if (lra_dump_file != NULL) if (lra_dump_file != NULL)
......
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> 2013-01-30 David Edelsohn <dje.gcc@gmail.com>
* g++.dg/cpp0x/constexpr-53094-2.C: Ignore non-standard ABI * g++.dg/cpp0x/constexpr-53094-2.C: Ignore non-standard ABI
......
/* 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