Commit 45399fdc by Jakub Jelinek Committed by Jakub Jelinek

re PR rtl-optimization/83985 (Compile time hog for 32-bit BE powerpc targets)

	PR rtl-optimization/83985
	* dce.c (deletable_insn_p): Return false for separate shrink wrapping
	REG_CFA_RESTORE insns.
	(delete_unmarked_insns): Don't ignore separate shrink wrapping
	REG_CFA_RESTORE insns here.

	* gcc.dg/pr83985.c: New test.

From-SVN: r257087
parent 79fbdeb8
2018-01-26 Jakub Jelinek <jakub@redhat.com> 2018-01-26 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/83985
* dce.c (deletable_insn_p): Return false for separate shrink wrapping
REG_CFA_RESTORE insns.
(delete_unmarked_insns): Don't ignore separate shrink wrapping
REG_CFA_RESTORE insns here.
PR c/83989 PR c/83989
* gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref): Don't * gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref): Don't
use SSA_NAME_VAR as base for SSA_NAMEs with non-NULL SSA_NAME_VAR. use SSA_NAME_VAR as base for SSA_NAMEs with non-NULL SSA_NAME_VAR.
......
...@@ -131,6 +131,12 @@ deletable_insn_p (rtx_insn *insn, bool fast, bitmap arg_stores) ...@@ -131,6 +131,12 @@ deletable_insn_p (rtx_insn *insn, bool fast, bitmap arg_stores)
&& REGNO (pic_offset_table_rtx) >= FIRST_PSEUDO_REGISTER) && REGNO (pic_offset_table_rtx) >= FIRST_PSEUDO_REGISTER)
return false; return false;
/* Callee-save restores are needed. */
if (RTX_FRAME_RELATED_P (insn)
&& crtl->shrink_wrapped_separate
&& find_reg_note (insn, REG_CFA_RESTORE, NULL))
return false;
body = PATTERN (insn); body = PATTERN (insn);
switch (GET_CODE (body)) switch (GET_CODE (body))
{ {
...@@ -592,15 +598,6 @@ delete_unmarked_insns (void) ...@@ -592,15 +598,6 @@ delete_unmarked_insns (void)
if (!dbg_cnt (dce)) if (!dbg_cnt (dce))
continue; continue;
if (crtl->shrink_wrapped_separate
&& find_reg_note (insn, REG_CFA_RESTORE, NULL))
{
if (dump_file)
fprintf (dump_file, "DCE: NOT deleting insn %d, it's a "
"callee-save restore\n", INSN_UID (insn));
continue;
}
if (dump_file) if (dump_file)
fprintf (dump_file, "DCE: Deleting insn %d\n", INSN_UID (insn)); fprintf (dump_file, "DCE: Deleting insn %d\n", INSN_UID (insn));
......
2018-01-26 Jakub Jelinek <jakub@redhat.com> 2018-01-26 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/83985
* gcc.dg/pr83985.c: New test.
PR c/83989 PR c/83989
* c-c++-common/Wrestrict-3.c: New test. * c-c++-common/Wrestrict-3.c: New test.
......
/* PR rtl-optimization/83985 */
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-additional-options "-mcpu=e300c3 -mtune=e300c3" { target { powerpc*-*-* && ilp32 } } } */
long long int v;
void
foo (int x)
{
if (x == 0)
return;
while (v < 2)
{
signed char *a;
v /= x;
a = v == 0 ? (signed char *) &x : (signed char *) &v;
++*a;
++v;
}
while (1)
;
}
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