[Bug debug/90109] New: gstabs flag generates wrong entry for long on x86_64

nebiun at hotmail dot com gcc-bugzilla@gcc.gnu.org
Tue Apr 16 08:50:00 GMT 2019


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

            Bug ID: 90109
           Summary: gstabs flag generates wrong entry for long on x86_64
           Product: gcc
           Version: 4.8.5
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nebiun at hotmail dot com
  Target Milestone: ---

Make a bug.c file with content:

typedef struct {
        int a;
        short unsigned int b;
        char c[2];
        long int d;
        long long int e;
} mytype_t;


compile it with:
gcc -c -gstabs bug.c

obtain a bug.o object file (this is the output of command: file bug.o)
bug.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped

use objdump to get debug infos from bug.o:
objdump --debugging bug.o

This is the output:

bug.o:     file format elf64-x86-64

bug.c:
typedef int32 int;
typedef int8 char;
typedef uint32 long int;
typedef uint32 unsigned int;
typedef uint32 long unsigned int;
typedef uint32 __int128;
typedef uint32 __int128 unsigned;
typedef uint32 long long int;
typedef uint64 long long unsigned int;
typedef int16 short int;
typedef uint16 short unsigned int;
typedef int8 signed char;
typedef uint8 unsigned char;
typedef float float;
typedef double double;
typedef float128 long double;
typedef float _Decimal32;
typedef double _Decimal64;
typedef float128 _Decimal128;
typedef void void;
typedef struct %anon1 { /* size 24 */
  int a; /* bitsize 32, bitpos 0 */
  short unsigned int b; /* bitsize 16, bitpos 32 */
  char c[2]:uint32; /* bitsize 16, bitpos 48 */
  long int d; /* bitsize 64, bitpos 64 */
  long long int e; /* bitsize 64, bitpos 128 */
} mytype_t;


'long int d' and 'long long int e' inside the struct have correct bitsize (64),
but typedef for 'long int', 'long unsigned int' and 'long long int' are defined
as uint32 and not uint64


More information about the Gcc-bugs mailing list