re PR rtl-optimization/82913 (ICE: Segmentation fault in try_merge_compare)

PR rtl-optimization/82913
	* compare-elim.c (try_merge_compare): Punt if def_insn is not
	single set.

	* gcc.c-torture/compile/pr82913.c: New test.

From-SVN: r254614
This commit is contained in:
Jakub Jelinek 2017-11-10 00:58:51 +01:00 committed by Jakub Jelinek
parent 89759031c5
commit e9b8a62847
4 changed files with 36 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2017-11-10 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/82913
* compare-elim.c (try_merge_compare): Punt if def_insn is not
single set.
2017-11-09 Jeff Law <law@redhat.com>
* vr-values.h: New file with vr_values class.

View File

@ -683,6 +683,8 @@ try_merge_compare (struct comparison *cmp)
rtx_insn *def_insn = cmp->in_a_setter;
rtx set = single_set (def_insn);
if (!set)
return false;
if (!can_merge_compare_into_arith (cmp_insn, def_insn))
return false;

View File

@ -1,3 +1,8 @@
2017-11-10 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/82913
* gcc.c-torture/compile/pr82913.c: New test.
2017-11-09 Paul Thomas <pault@gcc.gnu.org>
PR fortran/78619

View File

@ -0,0 +1,23 @@
/* PR rtl-optimization/82913 */
unsigned int a;
unsigned long int b;
int
foo (void)
{
++a;
b = 0;
}
unsigned long int
bar (int x)
{
if (!foo () || !a)
{
int c = a != b;
if (c != x)
return a;
}
return 0;
}