[tree-ssa]: PRE updates and note on bug

Daniel Berlin dberlin@dberlin.org
Tue Jul 22 18:19:00 GMT 2003


On Tuesday, July 22, 2003, at 1:37 PM, Daniel Berlin wrote:

>
> On Tuesday, July 22, 2003, at 1:21 PM, Andrew MacLeod wrote:
>
>> On Tue, 2003-07-22 at 12:57, Daniel Berlin wrote:
>>>> I thought we resolved this last week? You had a patch for
>>>> remove_stmt()...
>>>>
>>>> Or did it not fix your problem?
>>>
>>> If you apply the following patch, you can see where we still have
>>> problems (this includes when a cond_expr is the end of the bb, and we
>>> remove it, when we remove empty statements and the previous 
>>> statement is
>>> an empty statement, etc).
>>>
>>> We probably should use this patch (without the #if 0'd code, of 
>>> course, i
>>> was just trying to start attacking the various cases) once all the 
>>> cases
>>> are handled, or to force ourselves to fix the bugs.
>>
>> but....  are you sure you are looking at the right thing?
>>
> It could be the reverse iterators, of course.
>
>> Im not convinced that it isn't something else.. like a bug in the
>> reverse iterators or a missing bb_for_stmt...
> Where, exactly?
>
>>
>> out_of_ssa doesnt use the reverse iterators, but it does use the
>> FOR_EACH_STMT_IN_REVERSE macro because its processes things backwards,
>> and its not having any problems. If things were screwed up by DCE,
>> something would get the wrong live range, or get missed, and I would
>> expect something to break later on.
>
> As I said, it could be the reverse iterators.
> If the end of the bb is an empty statement, bsi = bsi_last (bb); 
> bsi_prev (bsi), doesn't work.

As an FYI, the reason it doesn't work is because of bsi_last:

  /* If the last stmt pointer isn't something a BSI can represent (ie, an
      empty statement node), then find the last stmt the slow way.  */
   if (b.tp == NULL)
     {


This condition is wrong for the comment.
If BSI's can't represent empty statement nodes, it needs to check
at least
1. IS_EMPTY_STMT (*b.tp)
and I believe
2. If *b.tp == COMPOUND_EXPR, IS_EMPTY_STMT (the first operand).



More information about the Gcc-patches mailing list