public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/36748]  New: scev const-prop pass adds bad line numbers
@ 2008-07-07 13:48 drow at gcc dot gnu dot org
  2008-07-07 13:57 ` [Bug debug/36748] " drow at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: drow at gcc dot gnu dot org @ 2008-07-07 13:48 UTC (permalink / raw)
  To: gcc-bugs

I'm testing inlined function support for GCC.  When I compile the attached
testcase with GCC (Debian's 4.3 package or unmodified trunk) and -g -O2, "break
main" in the patched GDB puts a breakpoint at the start of main and again
inside the inlined copy of factorial.

This happens because there are several bits of code associated with the line
containing main's opening brace.

The bad line numbers are introduced by pass_scev_cprop (why is this dumped into
"sccp"; having a dump named sccp shortly after one named store_ccp is
confusing).  Here's the relevant piece of the diff between 096t.lim and
099t.sccp:

@@ -88,7 +100,11 @@

 <bb 8>:
   # mult_acc.12_13 = PHI <mult_acc.12_15(6)>
-  # value_16 = PHI <value_14(6)>
+  [../break.c : 13] D.2700_29 = value_11 + -1;
+  [../break.c : 13] D.2701_7 = (unsigned int) D.2633_10;
+  [../break.c : 13] D.2702_30 = 2 - D.2701_7;
+  [../break.c : 13] D.2703_31 = (int) D.2702_30;
+  value_16 = D.2700_29 + D.2703_31;

 <bb 9>:
   # mult_acc.12_19 = PHI <mult_acc.12_13(8), 1(4)>

There are no other lines associated with break.c:13 in the dump at this point.  

The location came from internal_get_tmp_var.

644       if (EXPR_HAS_LOCATION (val))
645         SET_EXPR_LOCUS (mod, EXPR_LOCUS (val));
646       else
647         SET_EXPR_LOCATION (mod, input_location);

input_location has nothing to do with anything at this point.


-- 
           Summary: scev const-prop pass adds bad line numbers
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: drow at gcc dot gnu dot org
  GCC host triplet: x86_64-pc-linux-gnu


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


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

* [Bug debug/36748] scev const-prop pass adds bad line numbers
  2008-07-07 13:48 [Bug debug/36748] New: scev const-prop pass adds bad line numbers drow at gcc dot gnu dot org
@ 2008-07-07 13:57 ` drow at gcc dot gnu dot org
  2008-12-06 13:23 ` jan dot kratochvil at redhat dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: drow at gcc dot gnu dot org @ 2008-07-07 13:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from drow at gcc dot gnu dot org  2008-07-07 13:56 -------
Created an attachment (id=15869)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15869&action=view)
Test case


-- 


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


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

* [Bug debug/36748] scev const-prop pass adds bad line numbers
  2008-07-07 13:48 [Bug debug/36748] New: scev const-prop pass adds bad line numbers drow at gcc dot gnu dot org
  2008-07-07 13:57 ` [Bug debug/36748] " drow at gcc dot gnu dot org
@ 2008-12-06 13:23 ` jan dot kratochvil at redhat dot com
  2008-12-06 15:20 ` drow at gcc dot gnu dot org
  2008-12-06 15:21 ` drow at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2008-12-06 13:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jan dot kratochvil at redhat dot com  2008-12-06 13:22 -------
It looks fixed in 4.4 for me, tested on:
GNU C (GCC) version 4.4.0 20081202 (experimental) (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.4.0 20081202 (experimental), GMP version
4.2.2, MPFR version 2.3.2.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096

Line 13 in .line_debug is now assigned only to the "main" address (in Fedora
gcc-4.3.2-7.x86_64 it was assigned also to the "factorial" address).

Expecting it got fixed by Jakub Jelinek as a part of the Bug 36690.


-- 

jan dot kratochvil at redhat dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jan dot kratochvil at redhat
                   |                            |dot com


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


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

* [Bug debug/36748] scev const-prop pass adds bad line numbers
  2008-07-07 13:48 [Bug debug/36748] New: scev const-prop pass adds bad line numbers drow at gcc dot gnu dot org
  2008-07-07 13:57 ` [Bug debug/36748] " drow at gcc dot gnu dot org
  2008-12-06 13:23 ` jan dot kratochvil at redhat dot com
@ 2008-12-06 15:20 ` drow at gcc dot gnu dot org
  2008-12-06 15:21 ` drow at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: drow at gcc dot gnu dot org @ 2008-12-06 15:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from drow at gcc dot gnu dot org  2008-12-06 15:18 -------
I tried 4.4.0 20081130; it does not look fixed.

<bb 8>:
  # mult_acc.14_40 = PHI <mult_acc.14_17(6)>
  [break.c : 12] D.2737_41 = value_13 + -1;
  [break.c : 12] D.2738_42 = (unsigned int) D.2674_12;
  [break.c : 12] D.2739_43 = 2 - D.2738_42;
  [break.c : 12] D.2740_44 = (int) D.2739_43;
  value_39 = D.2737_41 + D.2740_44;

There are no references to code on line 13 or 25, which are the opening braces.
 But those lines are now associated with line 12 and 24, which are the
declarations of main and factorial respectively.  The references are still
introduced by scev.


-- 


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


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

* [Bug debug/36748] scev const-prop pass adds bad line numbers
  2008-07-07 13:48 [Bug debug/36748] New: scev const-prop pass adds bad line numbers drow at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-12-06 15:20 ` drow at gcc dot gnu dot org
@ 2008-12-06 15:21 ` drow at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: drow at gcc dot gnu dot org @ 2008-12-06 15:21 UTC (permalink / raw)
  To: gcc-bugs



-- 

drow at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-12-06 15:19:06
               date|                            |


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


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

end of thread, other threads:[~2008-12-06 15:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-07 13:48 [Bug debug/36748] New: scev const-prop pass adds bad line numbers drow at gcc dot gnu dot org
2008-07-07 13:57 ` [Bug debug/36748] " drow at gcc dot gnu dot org
2008-12-06 13:23 ` jan dot kratochvil at redhat dot com
2008-12-06 15:20 ` drow at gcc dot gnu dot org
2008-12-06 15:21 ` drow 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).