re PR tree-optimization/90671 (ICE on valid code at -Os and above with -g enabled in gsi_split_seq_after, at gimple-iterator.c:345)

PR tree-optimization/90671
	* tree-ssa-threadupdate.c (ssa_create_duplicates): If
	template_block used to be empty on the first call, don't use
	gsi_split_seq_after and gsi_insert_seq_after, but remember whole
	seq with bb_seq and set it with set_bb_seq.

	* gcc.dg/torture/pr90671.c: New test.

From-SVN: r271802
This commit is contained in:
Jakub Jelinek 2019-05-31 09:53:48 +02:00 committed by Jakub Jelinek
parent 0eee8eaa83
commit 6992d6fbf2
4 changed files with 45 additions and 3 deletions

View File

@ -1,3 +1,11 @@
2019-05-31 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/90671
* tree-ssa-threadupdate.c (ssa_create_duplicates): If
template_block used to be empty on the first call, don't use
gsi_split_seq_after and gsi_insert_seq_after, but remember whole
seq with bb_seq and set it with set_bb_seq.
2019-05-31 Iain Sandoe <iain@sandoe.co.uk>
* config/i386/darwin.h (ASM_OUTPUT_MAX_SKIP_ALIGN): New.

View File

@ -1,3 +1,8 @@
2019-05-31 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/90671
* gcc.dg/torture/pr90671.c: New test.
2019-05-31 Iain Sandoe <iain@sandoe.co.uk>
* g++.dg/cpp0x/pr84497.C: Require alias support.

View File

@ -0,0 +1,16 @@
/* PR tree-optimization/90671 */
/* { dg-do compile } */
/* { dg-additional-options "-w -g" } */
int a;
int
main ()
{
int b, c;
for (c = 0; c < 2; c++)
while (a)
if (b)
break;
return 0;
}

View File

@ -1142,12 +1142,25 @@ ssa_create_duplicates (struct redirection_data **slot,
gimple_seq seq = NULL;
if (gsi_stmt (local_info->template_last_to_copy)
!= gsi_stmt (gsi_last_bb (local_info->template_block)))
seq = gsi_split_seq_after (local_info->template_last_to_copy);
{
if (gsi_end_p (local_info->template_last_to_copy))
{
seq = bb_seq (local_info->template_block);
set_bb_seq (local_info->template_block, NULL);
}
else
seq = gsi_split_seq_after (local_info->template_last_to_copy);
}
create_block_for_threading (local_info->template_block, rd, 0,
&local_info->duplicate_blocks);
if (seq)
gsi_insert_seq_after (&local_info->template_last_to_copy,
seq, GSI_SAME_STMT);
{
if (gsi_end_p (local_info->template_last_to_copy))
set_bb_seq (local_info->template_block, seq);
else
gsi_insert_seq_after (&local_info->template_last_to_copy,
seq, GSI_SAME_STMT);
}
/* Go ahead and wire up outgoing edges and update PHIs for the duplicate
block. */