re PR rtl-optimization/84878 (ICE: Segmentation fault (in add_cross_iteration_register_deps))

gcc/
	PR rtl-optimization/84878
	* ddg.c (add_cross_iteration_register_deps): Use DF_REF_BB to determine
	the basic block.  Assert the use reference is not artificial and that
	it has an associated insn.

gcc/testsuite/
	PR rtl-optimization/84878
	* gcc.target/powerpc/pr84878.c: New test.

From-SVN: r259085
This commit is contained in:
Peter Bergner 2018-04-04 10:35:03 -05:00 committed by Peter Bergner
parent f1acdcd066
commit 8c760464d0
4 changed files with 36 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2018-04-04 Peter Bergner <bergner@vnet.ibm.com>
PR rtl-optimization/84878
* ddg.c (add_cross_iteration_register_deps): Use DF_REF_BB to determine
the basic block. Assert the use reference is not artificial and that
it has an associated insn.
2018-04-04 Michael Matz <matz@suse.de>
* builtins.c (compute_objsize): Pass correct operand

View File

@ -295,11 +295,14 @@ add_cross_iteration_register_deps (ddg_ptr g, df_ref last_def)
/* Create inter-loop true dependences and anti dependences. */
for (r_use = DF_REF_CHAIN (last_def); r_use != NULL; r_use = r_use->next)
{
rtx_insn *use_insn = DF_REF_INSN (r_use->ref);
if (BLOCK_FOR_INSN (use_insn) != g->bb)
if (DF_REF_BB (r_use->ref) != g->bb)
continue;
gcc_assert (!DF_REF_IS_ARTIFICIAL (r_use->ref)
&& DF_REF_INSN_INFO (r_use->ref) != NULL);
rtx_insn *use_insn = DF_REF_INSN (r_use->ref);
/* ??? Do not handle uses with DF_REF_IN_NOTE notes. */
use_node = get_node_of_insn (g, use_insn);
gcc_assert (use_node);

View File

@ -1,3 +1,8 @@
2018-04-04 Peter Bergner <bergner@vnet.ibm.com>
PR rtl-optimization/84878
* gcc.target/powerpc/pr84878.c: New test.
2018-04-04 Michael Matz <matz@suse.de>
* gcc.dg/Wstringop-overflow-4.c: New test.

View File

@ -0,0 +1,18 @@
/* PR rtl-optimization/84878 */
/* { dg-do compile { target { powerpc*-*-* } } } */
/* { dg-require-effective-target powerpc_altivec_ok } */
/* { dg-options "-O2 -maltivec -mno-vsx -fmodulo-sched -ftree-vectorize -funroll-loops -fassociative-math -fno-signed-zeros -fno-trapping-math" } */
int ek;
float zu;
int
k5 (int ks)
{
while (ek < 1)
{
ks += (int)(0x1000000 + zu + !ek);
++ek;
}
return ks;
}