public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/55056] New: [4.8 Regression] -O0 -g missing location for register double var
@ 2012-10-24 14:22 jan.kratochvil at redhat dot com
  2012-10-24 14:28 ` [Bug debug/55056] " rguenth at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: jan.kratochvil at redhat dot com @ 2012-10-24 14:22 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55056
           Summary: [4.8 Regression] -O0 -g missing location for register
                    double var
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jan.kratochvil@redhat.com
            Target: x86_64-unknown-linux-gnu


Regressions in gdb.base/store.exp by 2012-10-23 -> 2012-10-24.

double f(double u) {
  register double l = u;
  return l + l;
}

PASS: gcc (GCC) 4.7.3 20121024 (prerelease)
 <2><5d>: Abbrev Number: 4 (DW_TAG_variable)
    <5e>   DW_AT_name        : l
    <62>   DW_AT_type        : <0x6a>
    <66>   DW_AT_location    : 2 byte block: 76 70      (DW_OP_breg6 (rbp):
-16)

FAIL: gcc (GCC) 4.8.0 20121024 (experimental)
 <2><58>: Abbrev Number: 4 (DW_TAG_variable)
    <59>   DW_AT_name        : l
    <5d>   DW_AT_type        : <0x62>


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

* [Bug debug/55056] [4.8 Regression] -O0 -g missing location for register double var
  2012-10-24 14:22 [Bug debug/55056] New: [4.8 Regression] -O0 -g missing location for register double var jan.kratochvil at redhat dot com
@ 2012-10-24 14:28 ` rguenth at gcc dot gnu.org
  2012-10-24 15:23 ` jan.kratochvil at redhat dot com
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-10-24 14:28 UTC (permalink / raw)
  To: gcc-bugs


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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-10-24
   Target Milestone|---                         |4.8.0
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> 2012-10-24 14:28:42 UTC ---
I bet it works for -Og (can you check the gdb testsuite for regressions vs. -O0
-g for -Og -g?)

Anyway, confirmed.


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

* [Bug debug/55056] [4.8 Regression] -O0 -g missing location for register double var
  2012-10-24 14:22 [Bug debug/55056] New: [4.8 Regression] -O0 -g missing location for register double var jan.kratochvil at redhat dot com
  2012-10-24 14:28 ` [Bug debug/55056] " rguenth at gcc dot gnu.org
@ 2012-10-24 15:23 ` jan.kratochvil at redhat dot com
  2012-10-25  6:35 ` jakub at gcc dot gnu.org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jan.kratochvil at redhat dot com @ 2012-10-24 15:23 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2012-10-24 15:23:19 UTC ---
-Og -g0 is a total failure of everything, such as:

-Breakpoint 2, func2 () at ./gdb.base/return.c:12
-12       return -5;
-(gdb) PASS: gdb.base/return.exp: continue to return of -5
+Breakpoint 2, func2 () at ./gdb.base/return.c:13
+13     }
+(gdb) FAIL: gdb.base/return.exp: continue to return of -5


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

* [Bug debug/55056] [4.8 Regression] -O0 -g missing location for register double var
  2012-10-24 14:22 [Bug debug/55056] New: [4.8 Regression] -O0 -g missing location for register double var jan.kratochvil at redhat dot com
  2012-10-24 14:28 ` [Bug debug/55056] " rguenth at gcc dot gnu.org
  2012-10-24 15:23 ` jan.kratochvil at redhat dot com
@ 2012-10-25  6:35 ` jakub at gcc dot gnu.org
  2012-10-25  7:14 ` jakub at gcc dot gnu.org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-10-25  6:35 UTC (permalink / raw)
  To: gcc-bugs


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-10-25 06:35:28 UTC ---
-Og -g0 doesn't produce debug info, so it should fail all debugger tests.
-Og -g should work.
The problem with register vars at -O0 is that they aren't assigned a stack
slot, so for good debug info they'd need VTA, but we don't do that at -O0 (both
because it is expensive and because var-tracking isn't tought to handle -O0
well - for -O0 I guess we don't want to add debug stmts (or ignore them) for
non-register non-param vars (perhaps also with exception of VLA bound
temporaries), and once something is stored into its memory location, it should
be considered to live there and not for say
l = l + 1;
where l lives in memory say for an instruction or two that l lives in some
register or register + 1 and then again in memory.


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

* [Bug debug/55056] [4.8 Regression] -O0 -g missing location for register double var
  2012-10-24 14:22 [Bug debug/55056] New: [4.8 Regression] -O0 -g missing location for register double var jan.kratochvil at redhat dot com
                   ` (2 preceding siblings ...)
  2012-10-25  6:35 ` jakub at gcc dot gnu.org
@ 2012-10-25  7:14 ` jakub at gcc dot gnu.org
  2012-10-25  8:23 ` jan.kratochvil at redhat dot com
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-10-25  7:14 UTC (permalink / raw)
  To: gcc-bugs


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vmakarov at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-10-25 07:14:16 UTC ---
Anyway, this "regression" is due to LRA which even for -O0 generates better
code, CCing Vlad to see why old reload pushed the l var into its own stack
slot, even when it is register and thus it doesn't have to do that.


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

* [Bug debug/55056] [4.8 Regression] -O0 -g missing location for register double var
  2012-10-24 14:22 [Bug debug/55056] New: [4.8 Regression] -O0 -g missing location for register double var jan.kratochvil at redhat dot com
                   ` (3 preceding siblings ...)
  2012-10-25  7:14 ` jakub at gcc dot gnu.org
@ 2012-10-25  8:23 ` jan.kratochvil at redhat dot com
  2012-12-07 12:06 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jan.kratochvil at redhat dot com @ 2012-10-25  8:23 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2012-10-25 08:23:20 UTC ---
(In reply to comment #3)
> -Og -g0 doesn't produce debug info, so it should fail all debugger tests.
> -Og -g should work.

-Og -g0 is needed for GDB testsuite which expects unchanged CFLAGS produce no
DWARF while adding -g to them produces the proper (-Og in this case) dwarf.
>From GCC standpoint it was -Og -g0 -g.

-Og is not usable with GDB testsuite without heavy work on the testsuite.
If this PR is WONTFIXed I can adjust the few GDB testcases to cope with the
missing location with -O0 -g.


(In reply to comment #4)
> Anyway, this "regression" is due to LRA which even for -O0 generates better
> code, CCing Vlad to see why old reload pushed the l var into its own stack
> slot, even when it is register and thus it doesn't have to do that.

For types up to double "register" keyword stores it to int registers like %rbx.
long double is really stored in stack memory in the code so this GDB testcase
intended for register-stored values has nothing to test and it can be skipped
(for long double).

I do not understand why "register" does not keep the value on FPU stack.


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

* [Bug debug/55056] [4.8 Regression] -O0 -g missing location for register double var
  2012-10-24 14:22 [Bug debug/55056] New: [4.8 Regression] -O0 -g missing location for register double var jan.kratochvil at redhat dot com
                   ` (4 preceding siblings ...)
  2012-10-25  8:23 ` jan.kratochvil at redhat dot com
@ 2012-12-07 12:06 ` rguenth at gcc dot gnu.org
  2013-01-26 20:29 ` jan.kratochvil at redhat dot com
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-12-07 12:06 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> 2012-12-07 12:06:40 UTC ---
(In reply to comment #5)
> (In reply to comment #3)
> > -Og -g0 doesn't produce debug info, so it should fail all debugger tests.
> > -Og -g should work.
> 
> -Og -g0 is needed for GDB testsuite which expects unchanged CFLAGS produce no
> DWARF while adding -g to them produces the proper (-Og in this case) dwarf.
> From GCC standpoint it was -Og -g0 -g.

Even though it might be confusing, plain -Og does not generate debug info
(thus it's equivalent to -Og -g0) ;)

I suppose the reason this no longer works is (again) that we don't run
var-tracking at -O0.  Thus indeed WONTFIX may be reasonable.  Leaving at P3
for now.


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

* [Bug debug/55056] [4.8 Regression] -O0 -g missing location for register double var
  2012-10-24 14:22 [Bug debug/55056] New: [4.8 Regression] -O0 -g missing location for register double var jan.kratochvil at redhat dot com
                   ` (5 preceding siblings ...)
  2012-12-07 12:06 ` rguenth at gcc dot gnu.org
@ 2013-01-26 20:29 ` jan.kratochvil at redhat dot com
  2013-02-26 15:13 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jan.kratochvil at redhat dot com @ 2013-01-26 20:29 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #7 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2013-01-26 20:28:45 UTC ---
Workarounded with XFAIL for the GDB testsuite:
http://sourceware.org/ml/gdb-patches/2013-01/msg00655.html


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

* [Bug debug/55056] [4.8 Regression] -O0 -g missing location for register double var
  2012-10-24 14:22 [Bug debug/55056] New: [4.8 Regression] -O0 -g missing location for register double var jan.kratochvil at redhat dot com
                   ` (6 preceding siblings ...)
  2013-01-26 20:29 ` jan.kratochvil at redhat dot com
@ 2013-02-26 15:13 ` rguenth at gcc dot gnu.org
  2013-03-22 14:48 ` [Bug debug/55056] [4.8/4.9 " jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-02-26 15:13 UTC (permalink / raw)
  To: gcc-bugs


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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> 2013-02-26 15:12:54 UTC ---
Looking at the audit trail I'd conclude that this is not a bug but a feature.
Or an enhancement request (enable var-tracking at -O0).  But well, marking
as WAITING for now.


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

* [Bug debug/55056] [4.8/4.9 Regression] -O0 -g missing location for register double var
  2012-10-24 14:22 [Bug debug/55056] New: [4.8 Regression] -O0 -g missing location for register double var jan.kratochvil at redhat dot com
                   ` (7 preceding siblings ...)
  2013-02-26 15:13 ` rguenth at gcc dot gnu.org
@ 2013-03-22 14:48 ` jakub at gcc dot gnu.org
  2013-05-31 10:59 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-03-22 14:48 UTC (permalink / raw)
  To: gcc-bugs


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.0                       |4.8.1

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-03-22 14:45:02 UTC ---
GCC 4.8.0 is being released, adjusting target milestone.


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

* [Bug debug/55056] [4.8/4.9 Regression] -O0 -g missing location for register double var
  2012-10-24 14:22 [Bug debug/55056] New: [4.8 Regression] -O0 -g missing location for register double var jan.kratochvil at redhat dot com
                   ` (8 preceding siblings ...)
  2013-03-22 14:48 ` [Bug debug/55056] [4.8/4.9 " jakub at gcc dot gnu.org
@ 2013-05-31 10:59 ` jakub at gcc dot gnu.org
  2013-10-16  9:50 ` jakub at gcc dot gnu.org
  2013-10-25 11:46 ` rguenth at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-05-31 10:59 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.1                       |4.8.2

--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.8.1 has been released.


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

* [Bug debug/55056] [4.8/4.9 Regression] -O0 -g missing location for register double var
  2012-10-24 14:22 [Bug debug/55056] New: [4.8 Regression] -O0 -g missing location for register double var jan.kratochvil at redhat dot com
                   ` (9 preceding siblings ...)
  2013-05-31 10:59 ` jakub at gcc dot gnu.org
@ 2013-10-16  9:50 ` jakub at gcc dot gnu.org
  2013-10-25 11:46 ` rguenth at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-10-16  9:50 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.2                       |4.8.3

--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.8.2 has been released.


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

* [Bug debug/55056] [4.8/4.9 Regression] -O0 -g missing location for register double var
  2012-10-24 14:22 [Bug debug/55056] New: [4.8 Regression] -O0 -g missing location for register double var jan.kratochvil at redhat dot com
                   ` (10 preceding siblings ...)
  2013-10-16  9:50 ` jakub at gcc dot gnu.org
@ 2013-10-25 11:46 ` rguenth at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-10-25 11:46 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> ---
-Og has 'l' as well

 <2><4f>: Abbrev Number: 4 (DW_TAG_formal_parameter)
    <50>   DW_AT_name        : u        
    <52>   DW_AT_decl_file   : 1        
    <53>   DW_AT_decl_line   : 1        
    <54>   DW_AT_type        : <0x2d>   
    <58>   DW_AT_location    : 0x0      (location list)
 <2><5c>: Abbrev Number: 5 (DW_TAG_variable)
    <5d>   DW_AT_name        : l        
    <5f>   DW_AT_decl_file   : 1        
    <60>   DW_AT_decl_line   : 2        
    <61>   DW_AT_type        : <0x2d>   
    <65>   DW_AT_location    : 0x0      (location list)


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

end of thread, other threads:[~2013-10-25 11:46 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-24 14:22 [Bug debug/55056] New: [4.8 Regression] -O0 -g missing location for register double var jan.kratochvil at redhat dot com
2012-10-24 14:28 ` [Bug debug/55056] " rguenth at gcc dot gnu.org
2012-10-24 15:23 ` jan.kratochvil at redhat dot com
2012-10-25  6:35 ` jakub at gcc dot gnu.org
2012-10-25  7:14 ` jakub at gcc dot gnu.org
2012-10-25  8:23 ` jan.kratochvil at redhat dot com
2012-12-07 12:06 ` rguenth at gcc dot gnu.org
2013-01-26 20:29 ` jan.kratochvil at redhat dot com
2013-02-26 15:13 ` rguenth at gcc dot gnu.org
2013-03-22 14:48 ` [Bug debug/55056] [4.8/4.9 " jakub at gcc dot gnu.org
2013-05-31 10:59 ` jakub at gcc dot gnu.org
2013-10-16  9:50 ` jakub at gcc dot gnu.org
2013-10-25 11:46 ` rguenth at gcc dot gnu.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).