From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32618 invoked by alias); 10 Apr 2010 21:27:18 -0000 Received: (qmail 32580 invoked by uid 48); 10 Apr 2010 21:27:05 -0000 Date: Sat, 10 Apr 2010 21:27:00 -0000 Message-ID: <20100410212705.32579.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/41359] Wrong line numbers for debugging/profiling In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "mikael at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-04/txt/msg01054.txt.bz2 ------- Comment #3 from mikael at gcc dot gnu dot org 2010-04-10 21:27 ------- With this : diff --git a/trans-expr.c b/trans-expr.c index 7e95ce1..a6f8616 100644 --- a/trans-expr.c +++ b/trans-expr.c @@ -1382,6 +1382,8 @@ gfc_conv_expr_op (gfc_se * se, gfc_expr * expr) else se->expr = fold_build2 (code, type, lse.expr, rse.expr); + SET_EXPR_LOCATION (se->expr, expr->where.lb->location); + /* Add the post blocks. */ gfc_add_block_to_block (&se->post, &rse.post); gfc_add_block_to_block (&se->post, &lse.post); diff --git a/trans-stmt.c b/trans-stmt.c index 0b215f2..4b8ae69 100644 --- a/trans-stmt.c +++ b/trans-stmt.c @@ -718,6 +718,7 @@ gfc_trans_if_1 (gfc_code * code) /* Build the condition expression and add it to the condition block. */ stmt = fold_build3 (COND_EXPR, void_type_node, if_se.expr, stmt, elsestmt); + SET_EXPR_LOCATION (stmt, code->loc.lb->location); gfc_add_expr_to_block (&if_se.pre, stmt); I get : -: 0:Source:pr41359.f90 -: 0:Graph:pr41359.gcno -: 0:Data:pr41359.gcda -: 0:Runs:1 -: 0:Programs:1 1: 1:program main -: 2: -: 3: implicit none -: 4: -: 5: integer :: a = 7 -: 6: 1: 7: if( a == 0 ) then #####: 8: print *, "a is null" 1: 9: else if( a > 0 ) then 1: 10: print *, "a is positif" -: 11: else #####: 12: print *, "a is negatif" -: 13: end if -: 14: 2: 15:end program -: 16: -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41359