re PR tree-optimization/21921 (internal compiler error: in tsi_link_before, at tree-iterator.c:113)

ChangeLog:
2005-07-13  Paolo Bonzini  <bonzini@gnu.org>

	PR tree-optimization/21921
	* tree-iterator.c (tsi_link_before): Support the case when
	tsi_end_p (tsi) == true.

testsuite/ChangeLog:
2005-07-13  Paolo Bonzini  <bonzini@gnu.org>

	PR tree-optimization/21921
	* gcc.dg/tree-ssa/pr21921.c: New.

From-SVN: r101970
This commit is contained in:
Paolo Bonzini 2005-07-13 14:42:16 +00:00 committed by Paolo Bonzini
parent 5c3b86aff6
commit 3cb005cf5b
4 changed files with 30 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2005-07-13 Paolo Bonzini <bonzini@gnu.org>
PR tree-optimization/21921
* tree-iterator.c (tsi_link_before): Support the case when
tsi_end_p (tsi) == true.
2005-07-12 Zdenek Dvorak <dvorakz@suse.cz>
PR tree-optimization/22442

View File

@ -1,3 +1,8 @@
2005-07-13 Paolo Bonzini <bonzini@gnu.org>
PR tree-optimization/21921
* gcc.dg/tree-ssa/pr21921.c: New.
2005-07-12 Zdenek Dvorak <dvorakz@suse.cz>
PR tree-optimizatio/22442

View File

@ -0,0 +1,14 @@
/* { dg-do compile } */
/* { dg-options "-O1 -funsafe-math-optimizations" } */
void
Q (double *s, double h)
{
int i;
if (h > 1)
h = h - 1;
for (i = 1; i < 3; i++)
if (s[i] / h > 0)
s[0] = h, s[i] = s[i] / h;
}

View File

@ -110,8 +110,11 @@ tsi_link_before (tree_stmt_iterator *i, tree t, enum tsi_iterator_update mode)
}
else
{
gcc_assert (!STATEMENT_LIST_TAIL (i->container));
STATEMENT_LIST_HEAD (i->container) = head;
head->prev = STATEMENT_LIST_TAIL (i->container);
if (head->prev)
head->prev->next = head;
else
STATEMENT_LIST_HEAD (i->container) = head;
STATEMENT_LIST_TAIL (i->container) = tail;
}
@ -127,7 +130,6 @@ tsi_link_before (tree_stmt_iterator *i, tree t, enum tsi_iterator_update mode)
i->ptr = tail;
break;
case TSI_SAME_STMT:
gcc_assert (cur);
break;
}
}