public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/15171] -finit-local-zero tricks g77 into emitting erroneous debug info
  2004-04-27 16:59 [Bug debug/15171] New: -finit-local-zero tricks g77 into emitting erroneous debug info Edward dot Baudrez at UGent dot be
@ 2004-04-27 16:59 ` Edward dot Baudrez at UGent dot be
  2004-04-27 17:24 ` Edward dot Baudrez at UGent dot be
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Edward dot Baudrez at UGent dot be @ 2004-04-27 16:59 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From Edward dot Baudrez at UGent dot be  2004-04-27 16:50 -------
Created an attachment (id=6172)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=6172&action=view)
12-line Fortran source code; 1 main program, 1 subroutine

Should be compiled with -finit-local-zero and -g to reproduce bug.

When debugging this program with 'break final_', 'run' and subsequent stepping,
it appears like the debugger is executing the 'dimension local(20)' statement.
In reality, it is just clearing local variables (visible in disassembly). In
large subroutines, this phenomenom leads to lots of declaration lines
apparently being executed, or strange 'jumping' to several spots in the
subroutine.

-- 


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


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

* [Bug debug/15171] New: -finit-local-zero tricks g77 into emitting erroneous debug info
@ 2004-04-27 16:59 Edward dot Baudrez at UGent dot be
  2004-04-27 16:59 ` [Bug debug/15171] " Edward dot Baudrez at UGent dot be
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Edward dot Baudrez at UGent dot be @ 2004-04-27 16:59 UTC (permalink / raw)
  To: gcc-bugs

When compiling a Fortran subroutine with -finit-local-zero enabled, g77 outputs
erroneous debug information. When debugging the subroutine (verified with gdb an
intel debugger) with 'break <subroutine>' and subsequent stepping, the program
first steps through the code block which zeroes the local variables (this is
visible in assembly view). However, in the source code view, it appears like the
program is executing declaration lines or it is exhibiting other strange
behaviour (like apparently skipping source lines and then coming back later to
the same source lines). I will include a code snippet (very short) which
reproduces the problem.

-- 
           Summary: -finit-local-zero tricks g77 into emitting erroneous
                    debug info
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: Edward dot Baudrez at UGent dot be
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: 3.3.1
GCC target triplet: 3.3.1


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


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

* [Bug debug/15171] -finit-local-zero tricks g77 into emitting erroneous debug info
  2004-04-27 16:59 [Bug debug/15171] New: -finit-local-zero tricks g77 into emitting erroneous debug info Edward dot Baudrez at UGent dot be
  2004-04-27 16:59 ` [Bug debug/15171] " Edward dot Baudrez at UGent dot be
@ 2004-04-27 17:24 ` Edward dot Baudrez at UGent dot be
  2004-04-27 17:27 ` Edward dot Baudrez at UGent dot be
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Edward dot Baudrez at UGent dot be @ 2004-04-27 17:24 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   GCC host triplet|                            |i586-suse-linux


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


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

* [Bug debug/15171] -finit-local-zero tricks g77 into emitting erroneous debug info
  2004-04-27 16:59 [Bug debug/15171] New: -finit-local-zero tricks g77 into emitting erroneous debug info Edward dot Baudrez at UGent dot be
  2004-04-27 16:59 ` [Bug debug/15171] " Edward dot Baudrez at UGent dot be
  2004-04-27 17:24 ` Edward dot Baudrez at UGent dot be
@ 2004-04-27 17:27 ` Edward dot Baudrez at UGent dot be
  2004-04-27 17:31 ` pinskia at gcc dot gnu dot org
  2004-04-29 10:39 ` Edward dot Baudrez at UGent dot be
  4 siblings, 0 replies; 6+ messages in thread
From: Edward dot Baudrez at UGent dot be @ 2004-04-27 17:27 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
  GCC build triplet|3.3.1                       |
 GCC target triplet|3.3.1                       |


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


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

* [Bug debug/15171] -finit-local-zero tricks g77 into emitting erroneous debug info
  2004-04-27 16:59 [Bug debug/15171] New: -finit-local-zero tricks g77 into emitting erroneous debug info Edward dot Baudrez at UGent dot be
                   ` (2 preceding siblings ...)
  2004-04-27 17:27 ` Edward dot Baudrez at UGent dot be
@ 2004-04-27 17:31 ` pinskia at gcc dot gnu dot org
  2004-04-29 10:39 ` Edward dot Baudrez at UGent dot be
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-27 17:31 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-04-27 17:04 -------
Invalid as the debugging info needs to be there as you are clearing out the array.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
  GCC build triplet|                            |3.3.1
   GCC host triplet|i586-suse-linux             |
 GCC target triplet|                            |3.3.1
         Resolution|                            |INVALID


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


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

* [Bug debug/15171] -finit-local-zero tricks g77 into emitting erroneous debug info
  2004-04-27 16:59 [Bug debug/15171] New: -finit-local-zero tricks g77 into emitting erroneous debug info Edward dot Baudrez at UGent dot be
                   ` (3 preceding siblings ...)
  2004-04-27 17:31 ` pinskia at gcc dot gnu dot org
@ 2004-04-29 10:39 ` Edward dot Baudrez at UGent dot be
  4 siblings, 0 replies; 6+ messages in thread
From: Edward dot Baudrez at UGent dot be @ 2004-04-29 10:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From Edward dot Baudrez at UGent dot be  2004-04-29 07:19 -------
(In reply to comment #2)
> Invalid as the debugging info needs to be there as you are clearing out the array.

My apologies. Compiler's behaviour is consistent indeed (but slightly
confusing), as can be verified from the following code snippet
1      print *,'first print statement'
2      pi=3.14159236
3      print *,'last print statement'
4      stop
5      end
I just found it confusing, while stepping the program with the debugger, that
the debugger first jumps to line 2 (to initialize pi to zero, but this is not
apparent except in disassembly), and then returns to line 1 to execute the
program in the normal way.

-- 


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


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

end of thread, other threads:[~2004-04-29  7:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-27 16:59 [Bug debug/15171] New: -finit-local-zero tricks g77 into emitting erroneous debug info Edward dot Baudrez at UGent dot be
2004-04-27 16:59 ` [Bug debug/15171] " Edward dot Baudrez at UGent dot be
2004-04-27 17:24 ` Edward dot Baudrez at UGent dot be
2004-04-27 17:27 ` Edward dot Baudrez at UGent dot be
2004-04-27 17:31 ` pinskia at gcc dot gnu dot org
2004-04-29 10:39 ` Edward dot Baudrez at UGent dot be

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