re PR middle-end/80422 (ICE on valid code at -O3 in 32-bit mode on x86_64-linux-gnu: in operator[], at vec.h:732)

PR middle-end/80422
	* cfgcleanup.c (try_crossjump_to_edge): Verify SRC1 and SRC2 have
	predecessors after walking up the insn chain.

	PR middle-end/80422
	* gcc.c-torture/compile/pr80422.c: New test.

From-SVN: r246975
This commit is contained in:
Jeff Law 2017-04-18 11:31:30 -06:00 committed by Jeff Law
parent 1cda61fc28
commit dd68669b66
4 changed files with 42 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2017-04-18 Jeff Law <law@redhat.com>
PR middle-end/80422
* cfgcleanup.c (try_crossjump_to_edge): Verify SRC1 and SRC2 have
predecessors after walking up the insn chain.
2017-04-18 Jakub Jelinek <jakub@redhat.com>
PR debug/80263

View File

@ -2017,6 +2017,11 @@ try_crossjump_to_edge (int mode, edge e1, edge e2,
if (newpos2 != NULL_RTX)
src2 = BLOCK_FOR_INSN (newpos2);
/* Check that SRC1 and SRC2 have preds again. They may have changed
above due to the call to flow_find_cross_jump. */
if (EDGE_COUNT (src1->preds) == 0 || EDGE_COUNT (src2->preds) == 0)
return false;
if (dir == dir_backward)
{
#define SWAP(T, X, Y) do { T tmp = (X); (X) = (Y); (Y) = tmp; } while (0)

View File

@ -1,3 +1,8 @@
2017-04-18 Jeff Law <law@redhat.com>
PR middle-end/80422
* gcc.c-torture/compile/pr80422.c: New test.
2017-04-18 Jakub Jelinek <jakub@redhat.com>
PR debug/80263

View File

@ -0,0 +1,26 @@
int a, c, f;
short b, d, e;
int fn1 (int h)
{
return a > 2 || h > a ? h : h << a;
}
void fn2 ()
{
int j, k;
while (1)
{
k = c && b;
f &= e > (fn1 (k) && j);
if (!d)
break;
}
}
int main ()
{
fn2 ();
return 0;
}