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
This commit is contained in:
Jakub Jelinek 2018-01-26 12:48:05 +01:00 committed by Jakub Jelinek
parent 79fbdeb87e
commit 45399fdc7c
4 changed files with 40 additions and 9 deletions

View File

@ -1,5 +1,11 @@
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
* 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.

View File

@ -131,6 +131,12 @@ deletable_insn_p (rtx_insn *insn, bool fast, bitmap arg_stores)
&& REGNO (pic_offset_table_rtx) >= FIRST_PSEUDO_REGISTER)
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);
switch (GET_CODE (body))
{
@ -592,15 +598,6 @@ delete_unmarked_insns (void)
if (!dbg_cnt (dce))
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)
fprintf (dump_file, "DCE: Deleting insn %d\n", INSN_UID (insn));

View File

@ -1,5 +1,8 @@
2018-01-26 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/83985
* gcc.dg/pr83985.c: New test.
PR c/83989
* c-c++-common/Wrestrict-3.c: New test.

View File

@ -0,0 +1,25 @@
/* 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)
;
}