[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#358755: g++-4.0: G++ drops const int arrays



Markus Schaber wrote:
> G++ seems to drop const int arrays, while gcc compiles them correctly.

The bug occurs for every data type, also double or struct arrays.
The .o file just does not contain the array:

user@host:~/gcc4bug$ objdump -C -t array.c.o

array.c.o:     file format elf64-x86-64

SYMBOL TABLE:
0000000000000000 l    df *ABS*  0000000000000000 array.c
0000000000000000 l    d  .text  0000000000000000 .text
0000000000000000 l    d  .data  0000000000000000 .data
0000000000000000 l    d  .bss   0000000000000000 .bss
0000000000000000 l    d  .rodata        0000000000000000 .rodata
0000000000000000 l    d  .note.GNU-stack        0000000000000000
.note.GNU-stack
0000000000000000 l    d  .comment       0000000000000000 .comment
0000000000000000 g     O .rodata        0000000000000fa0 Table

user@host:~/gcc4bug$ objdump -C -t array.cc.o

array.cc.o:     file format elf64-x86-64

SYMBOL TABLE:
0000000000000000 l    df *ABS*  0000000000000000 array.cc
0000000000000000 l    d  .text  0000000000000000 .text
0000000000000000 l    d  .data  0000000000000000 .data
0000000000000000 l    d  .bss   0000000000000000 .bss
0000000000000000 l    d  .note.GNU-stack        0000000000000000
.note.GNU-stack
0000000000000000 l    d  .comment       0000000000000000 .comment

user@host:~/gcc4bug$ _

For x86 (32 bit) the output looks similiar. Btw, G++ 3.x does it correctly.

Greets,

                  Lars R.



Reply to: