This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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




I was getting an empty stmt for end of bb using last_stmt and last_stmt_ptr, but if i replace it with:

       {
         block_stmt_iterator bsi2;
         block_stmt_iterator bsi3;
         for (bsi2 = bsi3 = bsi_start (bb);
        !bsi_end_p (bsi2);
        bsi_next (&bsi2))
           bsi3 = bsi2;
         endtree = bsi_stmt (bsi3);
         endtreep = bsi_stmt_ptr (bsi3);
       }

(which is the code that bsi_last falls back on), it works fine and
gives the correct statement.


last_stmt and last_stmt_ptr will do that, but bsi_last() should give you
the correct thing.



Errr, that would be strange, since:


tree
last_stmt (basic_block bb)
{
  block_stmt_iterator b;

  b = bsi_last (bb);
  return (!bsi_end_p (b)) ? bsi_stmt (b) : NULL_TREE;
}

last_stmt will only return an empty_stmt iff bsi_last does.

Andrew




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]