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: PR debug/29232 [VTA] move assign rather than debug stmt in phiopt


On Thu, Sep 3, 2009 at 11:22 PM, Alexandre Oliva<aoliva@redhat.com> wrote:
> tree-ssa-phiopt.c's minmax replacement will sometimes attempt to move
> the only non-debug stmt in a block to another block. ?The assumption
> that the assignment to be moved is the last in the block is correct only
> if there aren't any debug stmts after it. ?In the presented testcase,
> there is, and so we ended up moving the debug stmt rather than the
> assignment. ?Then, when the block with the assignment was removed,
> verify_ssa noticed something was broken.
>
> The obvious fix is to skip debug stmts at the end of the block before
> moving the assignment. ?Unless someone objects, I'll check this in as
> obvious once my testing is completed.

       gsi_from = gsi_last_bb (middle_bb);
+      if (is_gimple_debug (gsi_stmt (gsi_from)))
+       gsi_prev_nondebug (&gsi_from);

you added gsi_last_nondebug_bb, why not use that?

Richard.

>
>
> --
> Alexandre Oliva, freedom fighter ? ?http://FSFLA.org/~lxoliva/
> You must be the change you wish to see in the world. -- Gandhi
> Be Free! -- http://FSFLA.org/ ? FSF Latin America board member
> Free Software Evangelist ? ? ?Red Hat Brazil Compiler Engineer
>
>


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