[Bug debug/54534] New: [4.7 Regression] Missing location for unused variable

jan.kratochvil at redhat dot com gcc-bugzilla@gcc.gnu.org
Sun Sep 9 07:41:00 GMT 2012


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

             Bug #: 54534
           Summary: [4.7 Regression] Missing location for unused variable
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jan.kratochvil@redhat.com
            Target: x86_64-unknown-linux-gnu


static int i;

gcc -c -Wall -g
13.c:1:12: warning: ‘i’ defined but not used [-Wunused-variable]

PASS: gcc (GCC) 4.5.4
PASS: gcc (GCC) 4.6.4 20120909 (prerelease)
PASS: gcc (GCC) 4.8.0 20120909 (experimental)
 <1><2d>: Abbrev Number: 2 (DW_TAG_variable)
    <2e>   DW_AT_name        : i    
    <30>   DW_AT_decl_file   : 1    
    <31>   DW_AT_decl_line   : 1    
    <32>   DW_AT_type        : <0x40>    
    <36>   DW_AT_location    : 9 byte block: 3 0 0 0 0 0 0 0 0     (DW_OP_addr:
0)
(gdb) p i
$1 = 0

FAIL: gcc (GCC) 4.7.2 20120909 (prerelease)
 <1><1d>: Abbrev Number: 2 (DW_TAG_variable)
    <1e>   DW_AT_name        : i    
    <20>   DW_AT_decl_file   : 1    
    <21>   DW_AT_decl_line   : 1    
    <22>   DW_AT_type        : <0x26>    
(gdb) p i
No symbol "i" in current context.

Regression: 2012-09-07 -> 2012-09-08

It breaks GDB several testfiles such as: gdb.base/memattr.exp



More information about the Gcc-bugs mailing list