public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/41359] Wrong line numbers for debugging/profiling
       [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>
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Joost.VandeVondele at pci dot uzh.ch @ 2010-10-13 11:39 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41359

Joost VandeVondele <Joost.VandeVondele at pci dot uzh.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2010-07-28 20:01:09         |2010-10-13 20:01:09
                 CC|                            |mikael at gcc dot gnu.org
      Known to fail|                            |

--- Comment #5 from Joost VandeVondele <Joost.VandeVondele at pci dot uzh.ch> 2010-10-13 11:39:01 UTC ---
this still fails with a recent trunk. Mikael, do you plan to commit your patch?

> cat test.f90.gcov
        -:    0:Source:test.f90
        -:    0:Graph:test.gcno
        -:    0:Data:test.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"
        -:    9:   else if( a > 0 ) then
        1:   10:      print *, "a is positif"
        -:   11:   else
        2:   12:      print *, "a is negatif"
        -:   13:   end if
        -:   14:
        2:   15:end program


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Bug fortran/41359] Wrong line numbers for debugging/profiling
       [not found] ` <20101013113915.02AC61C00093@msfrf2109.sfr.fr>
@ 2010-10-13 19:05   ` Mikael Morin
  0 siblings, 0 replies; 13+ messages in thread
From: Mikael Morin @ 2010-10-13 19:05 UTC (permalink / raw)
  To: gcc-bugs; +Cc: Joost.VandeVondele at pci dot uzh.ch

> this still fails with a recent trunk.
> Mikael, do you plan to commit your patch?

Thanks for the remainder.
I'm currently on something else, but I plan to do it during stage 3.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/41359] Wrong line numbers for debugging/profiling
       [not found] <bug-41359-4@http.gcc.gnu.org/bugzilla/>
  2010-10-13 11:39 ` [Bug fortran/41359] Wrong line numbers for debugging/profiling Joost.VandeVondele at pci dot uzh.ch
       [not found] ` <20101013113915.02AC61C00093@msfrf2109.sfr.fr>
@ 2010-10-13 19:05 ` mikael.morin at sfr dot fr
  2010-10-16 19:00 ` tkoenig at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: mikael.morin at sfr dot fr @ 2010-10-13 19:05 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41359

--- Comment #6 from mikael.morin at sfr dot fr 2010-10-13 19:05:15 UTC ---
> this still fails with a recent trunk.
> Mikael, do you plan to commit your patch?

Thanks for the remainder.
I'm currently on something else, but I plan to do it during stage 3.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/41359] Wrong line numbers for debugging/profiling
       [not found] <bug-41359-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  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
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2010-10-16 19:00 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41359

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tkoenig at gcc dot gnu.org
         AssignedTo|mikael at gcc dot gnu.org   |tkoenig at gcc dot gnu.org

--- Comment #7 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2010-10-16 19:00:42 UTC ---
Sorry, I meant to assign that bug to myself :-)


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/41359] Wrong line numbers for debugging/profiling
       [not found] <bug-41359-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2010-12-21 21:18 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41359

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW
         AssignedTo|tkoenig at gcc dot gnu.org  |unassigned at gcc dot
                   |                            |gnu.org

--- Comment #8 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2010-12-21 21:18:15 UTC ---
Huh... apparently, I assigned the wrong bug to myself.

Unassigning.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/41359] Wrong line numbers for debugging/profiling
       [not found] <bug-41359-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2010-12-21 21:18 ` tkoenig at gcc dot gnu.org
@ 2011-02-21 22:41 ` burnus at gcc dot gnu.org
  2011-02-22 10:31 ` burnus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-02-21 22:41 UTC (permalink / raw)
  To: gcc-bugs

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);


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/41359] Wrong line numbers for debugging/profiling
       [not found] <bug-41359-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2011-02-21 22:41 ` burnus at gcc dot gnu.org
@ 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
  8 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-02-22 10:31 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41359

--- Comment #10 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-02-22 10:23:17 UTC ---
Author: burnus
Date: Tue Feb 22 10:23:14 2011
New Revision: 170394

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170394
Log:
2011-02-22  Tobias Burnus  <burnus@net-b.de>

        PR fortran/41359
        * trans-stmt.c (gfc_trans_if_1): Use correct line for
        expressions in the if condition.


Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-stmt.c


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/41359] Wrong line numbers for debugging/profiling
       [not found] <bug-41359-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  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
  8 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-02-22 10:36 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41359

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #11 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-02-22 10:26:23 UTC ---
FIXED on the trunk (4.6). Thanks for the report, Edouard, and sorry for needing
one and a half years for fixing it.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/41359] Wrong line numbers for debugging/profiling
       [not found] <bug-41359-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2011-02-22 10:36 ` burnus at gcc dot gnu.org
@ 2011-02-22 10:47 ` Edouard.Canot at irisa dot fr
  8 siblings, 0 replies; 13+ messages in thread
From: Edouard.Canot at irisa dot fr @ 2011-02-22 10:47 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41359

--- Comment #12 from Edouard.Canot at irisa dot fr 2011-02-22 10:36:41 UTC ---
On Tuesday 22 February 2011 11:26:53 you wrote:
(quoting "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>)
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41359
> 
> Tobias Burnus <burnus at gcc dot gnu.org> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>              Status|NEW                         |RESOLVED
>          Resolution|                            |FIXED
> 
> --- Comment #11 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-02-22 10:26:23 UTC ---
> FIXED on the trunk (4.6). Thanks for the report, Edouard, and sorry for needing
> one and a half years for fixing it.
> 

Thanks for you, too. You are welcome.
Regards,
Édouard Canot


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/41359] Wrong line numbers for debugging/profiling
  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
                   ` (2 preceding siblings ...)
  2010-04-11 18:03 ` jv244 at cam dot ac dot uk
@ 2010-07-28 20:01 ` mikael at gcc dot gnu dot org
  3 siblings, 0 replies; 13+ messages in thread
From: mikael at gcc dot gnu dot org @ 2010-07-28 20:01 UTC (permalink / raw)
  To: gcc-bugs



-- 

mikael at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |mikael at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2009-09-15 13:07:14         |2010-07-28 20:01:09
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41359


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/41359] Wrong line numbers for debugging/profiling
  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
  3 siblings, 0 replies; 13+ messages in thread
From: jv244 at cam dot ac dot uk @ 2010-04-11 18:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jv244 at cam dot ac dot uk  2010-04-11 18:02 -------
looks like we have a patch...


-- 

jv244 at cam dot ac dot uk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41359


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/41359] Wrong line numbers for debugging/profiling
  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
  3 siblings, 0 replies; 13+ messages in thread
From: mikael at gcc dot gnu dot org @ 2010-04-10 21:27 UTC (permalink / raw)
  To: gcc-bugs



------- 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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/41359] Wrong line numbers for debugging/profiling
  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 ` jv244 at cam dot ac dot uk
  2010-04-10 21:27 ` mikael at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 13+ messages in thread
From: jv244 at cam dot ac dot uk @ 2010-04-10 19:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jv244 at cam dot ac dot uk  2010-04-10 19:04 -------
still present in 4.6. The issue seems to be missing location info for the
nested if [if (a>0) ], the missing info in the original dump appears as a
incorrect line:7 in the gimple. It is specific to the 'else if' form, on a
single line.


-- 

jv244 at cam dot ac dot uk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|4.3.4 4.4.1 4.5.0           |4.3.4 4.4.1 4.5.0 4.6.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41359


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2011-02-22 10:36 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-41359-4@http.gcc.gnu.org/bugzilla/>
2010-10-13 11:39 ` [Bug fortran/41359] Wrong line numbers for debugging/profiling 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
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

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).