6871 – [3.3/3.4 regression] const objects shouldn't be moved to .bss (original) (raw)

Description Ulrich Drepper 2002-05-30 08:56:02 UTC

The gcc CVS trunk contains code which moves variables which are initialized with all zeros into .bss (instead of .data). But the current gcc doesn't stop there: it also moves constants into .bss instead of .text. This is not what should happen since the .bss cannot be shared, unlike the .text.

Release: gcc CVS trunk 2002-05-29

Environment: x86 Linux

How-To-Repeat: Compile the attached file with gcc -O2 -c u.c

The variable should be in .text and not in .bss.

Comment 1 Eric Botcazou 2003-02-19 10:10:49 UTC

State-Changed-From-To: open->analyzed State-Changed-Why: Confirmed on 3.3 and mainline.

Comment 2 Jason Merrill 2003-03-14 20:42:24 UTC

Responsible-Changed-From-To: unassigned->jason Responsible-Changed-Why: i'll take a look

Comment 6 Jason Merrill 2003-03-15 01:44:10 UTC

State-Changed-From-To: analyzed->closed State-Changed-Why: fixed.