re PR rtl-optimization/77416 (LRA rematerializing use of CA reg across function call)

2016-09-19  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/77416
	* lra-remat.c (operand_to_remat): Process hard coded insn
	registers.

2016-09-19  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/77416
	* gcc.target/powerpc/pr77416.c: New.

From-SVN: r240247
This commit is contained in:
Vladimir Makarov 2016-09-19 21:38:27 +00:00 committed by Vladimir Makarov
parent 6101a7ab87
commit 0241082625
4 changed files with 61 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2016-09-19 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/77416
* lra-remat.c (operand_to_remat): Process hard coded insn
registers.
2016-09-19 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* simplify-rtx.c (simplify_relational_operation_1): Add transformation

View File

@ -370,6 +370,22 @@ operand_to_remat (rtx_insn *insn)
+ hard_regno_nregs[reg->regno][reg->biggest_mode])))
return -1;
}
/* Check hard coded insn registers. */
for (struct lra_insn_reg *reg = static_id->hard_regs;
reg != NULL;
reg = reg->next)
if (reg->type == OP_INOUT)
return -1;
else if (reg->type == OP_IN)
{
/* Check that there is no output hard reg as the input
one. */
for (struct lra_insn_reg *reg2 = static_id->hard_regs;
reg2 != NULL;
reg2 = reg2->next)
if (reg2->type == OP_OUT && reg->regno == reg2->regno)
return -1;
}
/* Find the rematerialization operand. */
int nop = static_id->n_operands;
for (int i = 0; i < nop; i++)

View File

@ -1,3 +1,8 @@
2016-09-19 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/77416
* gcc.target/powerpc/pr77416.c: New.
2016-09-19 Patrick Palka <ppalka@gcc.gnu.org>
PR c++/77639

View File

@ -0,0 +1,34 @@
/* { dg-do compile { target { powerpc64*-*-*} } } */
/* { dg-skip-if "" { powerpc64-*-aix* } { "*" } { "" } } */
/* { dg-skip-if "do not override -mcpu" { powerpc64*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */
/* { dg-options "-mcpu=power7 -O2 -m32" } */
/* { dg-final { scan-assembler-times "addze" 1 } } */
extern int fn2 ();
extern void fn3 ();
extern void fn4 (int);
int a, c, d, f, g, h, i, j, k, l, m, n;
struct
{
int escape;
} *b;
int e[8];
void
fn1 (int p1, int p2)
{
int o = a;
for (; f; f++)
{
int p;
if (e[h])
continue;
if (fn2 (o, d, l, n, p1, i, j, k, 0==0))
continue;
p = p2;
if (b[g].escape)
p++;
fn3 ("", c, m);
if (k)
fn4 (p);
}
}