[Bug debug/63300] New: 'const volatile' sometimes stripped in debug info

arnez at linux dot vnet.ibm.com gcc-bugzilla@gcc.gnu.org
Thu Sep 18 16:07:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63300

            Bug ID: 63300
           Summary: 'const volatile' sometimes stripped in debug info
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: arnez at linux dot vnet.ibm.com

With current upstream gcc, the following commands do not yield the expected
output:

echo 'void f (const volatile int x) { }' | gcc -xc -c -g -o foo.o -
readelf -wi foo.o | grep 'volatile\|const'

With an older gcc we get something like this:

 <1><54>: Abbrev Number: 4 (DW_TAG_const_type)
 <1><59>: Abbrev Number: 5 (DW_TAG_volatile_type)

With the current gcc we get nothing.  Indeed, the resulting debug info declares
the parameter 'x' merely as an 'int' instead of 'const volatile int'.

The same happens with some other combinations as well, e.g.:

char *const volatile x
const volatile float x
const volatile int *x



More information about the Gcc-bugs mailing list