public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/41359] Wrong line numbers for debugging/profiling Date: Mon, 21 Feb 2011 22:41:00 -0000 [thread overview] Message-ID: <bug-41359-4-EqtDcZ8wnI@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-41359-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41359 --- Comment #9 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-02-21 21:47:59 UTC --- I think the current gcov output is OK: 1: 1:program main -: 2: implicit none -: 3: integer :: a = 7 1: 4: if( a == 0 ) then #####: 5: print *, "a is null" 1: 6: else if( a > 0 ) then 1: 7: print *, "a is positif" -: 8: else #####: 9: print *, "a is negatif" -: 10: end if 2: 11:end program Though the following is still partially wrong: [foo.f90 : 6] if ([foo.f90 : 5] a > 0) With patch: [foo.f90 : 6] if ([foo.f90 : 6] a > 0) --- a/gcc/fortran/trans-stmt.c +++ b/gcc/fortran/trans-stmt.c @@ -718,6 +718,7 @@ gfc_trans_if_1 (gfc_code * code) { gfc_se if_se; tree stmt, elsestmt; + locus saved_loc; location_t loc; /* Check for an unconditional ELSE clause. */ @@ -729,7 +730,10 @@ gfc_trans_if_1 (gfc_code * code) gfc_start_block (&if_se.pre); /* Calculate the IF condition expression. */ + gfc_save_backend_locus (&saved_loc); + gfc_set_backend_locus (&code->expr1->where); gfc_conv_expr_val (&if_se, code->expr1); + gfc_restore_backend_locus (&saved_loc); /* Translate the THEN clause. */ stmt = gfc_trans_code (code->next);
next prev parent reply other threads:[~2011-02-21 21:48 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-41359-4@http.gcc.gnu.org/bugzilla/> 2010-10-13 11:39 ` Joost.VandeVondele at pci dot uzh.ch [not found] ` <20101013113915.02AC61C00093@msfrf2109.sfr.fr> 2010-10-13 19:05 ` Mikael Morin 2010-10-13 19:05 ` mikael.morin at sfr dot fr 2010-10-16 19:00 ` tkoenig at gcc dot gnu.org 2010-12-21 21:18 ` tkoenig at gcc dot gnu.org 2011-02-21 22:41 ` burnus at gcc dot gnu.org [this message] 2011-02-22 10:31 ` burnus at gcc dot gnu.org 2011-02-22 10:36 ` burnus at gcc dot gnu.org 2011-02-22 10:47 ` Edouard.Canot at irisa dot fr 2009-09-15 12:39 [Bug gcov-profile/41359] New: [fortran] 'else if' statement is discarded and incoherent line count Edouard dot Canot at irisa dot fr 2010-04-10 19:04 ` [Bug fortran/41359] Wrong line numbers for debugging/profiling jv244 at cam dot ac dot uk 2010-04-10 21:27 ` mikael at gcc dot gnu dot org 2010-04-11 18:03 ` jv244 at cam dot ac dot uk 2010-07-28 20:01 ` mikael at gcc dot gnu dot org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-41359-4-EqtDcZ8wnI@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).