From patchwork Fri Oct 26 17:35:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: PR tree-optimization/54985 Date: Fri, 26 Oct 2012 07:35:26 -0000 From: Jeff Law X-Patchwork-Id: 194547 Message-Id: <508AC9DE.1080303@redhat.com> To: Jakub Jelinek Cc: gcc-patches On 10/23/2012 03:43 PM, Jakub Jelinek wrote: > On Tue, Oct 23, 2012 at 03:34:46PM -0600, Jeff Law wrote: >>> I think it should be backported to 4.7, perhaps with a few days delay after the >>> trunk commit. >> Do we even have debug statements after control flow statements? > > They shouldn't be there, so if you just give up the same way for gsi_stmt > NULL as well as non-control stmt, it shouldn't make a difference. > So last_stmt might be just shorter to type and more commonly used, nothing > more. Done. Bootstrapped and regression tested on x86_64-unknown-linux-gnu. * tree-ssa-threadedge.c (cond_arg_set_in_bb): Use last stmt. diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c index 6249e2f..ddaa7d1 100644 --- a/gcc/tree-ssa-threadedge.c +++ b/gcc/tree-ssa-threadedge.c @@ -584,7 +584,7 @@ cond_arg_set_in_bb (edge e, basic_block bb) { ssa_op_iter iter; use_operand_p use_p; - gimple last = gsi_stmt (gsi_last_bb (e->dest)); + gimple last = last_stmt (e->dest); /* E->dest does not have to end with a control transferring instruction. This can occurr when we try to extend a jump