RFC Possible typo get_low_bound dependence.c
Graham Stott
grahams@redhat.com
Thu Apr 26 10:36:00 GMT 2001
All
The following code looks to be missing an assignment to node and has
a typo otherwise we have an infinate loop if the loop is entered the
condition in the if-stmt is always false.
------------------------------------------------------------------------
while (TREE_CODE (node) == COMPOUND_EXPR)
{
if (TREE_CODE (TREE_OPERAND (node, 0)) == MODIFY_EXPR
&& (TREE_CODE (TREE_OPERAND (node, 0)) == VAR_DECL
&& IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (node, 0)))
== variable))
break;
}
------------------------------------------------------------------------
I suspect the intened code was
-------------------------------------------------------------------------
while (TREE_CODE (node) == COMPOUND_EXPR)
{
node = TREE_OPERAND (node, 0);
if (TREE_CODE (node, 0) == MODIFY_EXPR
&& (TREE_CODE (TREE_OPERAND (node, 0)) == VAR_DECL
&& IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (node, 0)))
== variable))
break;
}
------------------------------------------------------------------------
I haven't been able to verify this change DTRT because I have yet to find a testcase
which triggers to while-loop to be entered.
Comments?
Graham
More information about the Gcc
mailing list