From: jakub Date: Mon, 6 Dec 2010 19:30:31 +0000 (+0000) Subject: PR tree-optimization/46528 X-Git-Tag: upstream/4.9.2~24347 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b716dab0fc19e5da5ee2508c5c5eb705f163b439;p=platform%2Fupstream%2Flinaro-gcc.git PR tree-optimization/46528 PR debug/46338 * profile.c (branch_prob): Make sure last is never set to a debug stmt. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167515 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7412c20..48c60c0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2010-12-06 Jakub Jelinek + PR tree-optimization/46528 + PR debug/46338 + * profile.c (branch_prob): Make sure last is never set to a debug + stmt. + PR debug/46771 * reginfo.c (init_subregs_of_mode): Don't call find_subregs_of_mode on DEBUG_INSNs. diff --git a/gcc/profile.c b/gcc/profile.c index 9e8c203..606e3b2 100644 --- a/gcc/profile.c +++ b/gcc/profile.c @@ -936,11 +936,12 @@ branch_prob (void) /* It may happen that there are compiler generated statements without a locus at all. Go through the basic block from the last to the first statement looking for a locus. */ - for (gsi = gsi_last_bb (bb); !gsi_end_p (gsi); gsi_prev (&gsi)) + for (gsi = gsi_last_nondebug_bb (bb); + !gsi_end_p (gsi); + gsi_prev_nondebug (&gsi)) { last = gsi_stmt (gsi); - if (!is_gimple_debug (last) - && gimple_has_location (last)) + if (gimple_has_location (last)) break; }