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.
State-Changed-From-To: open->analyzed State-Changed-Why: Confirmed on 3.3 and mainline.
Responsible-Changed-From-To: unassigned->jason Responsible-Changed-Why: i'll take a look
From: jason@gcc.gnu.org To: gcc-gnats@gcc.gnu.org Cc: Subject: optimization/6871 Date: 15 Mar 2003 01:42:13 -0000 CVSROOT: /cvs/gcc Module name: gcc Changes by: jason@gcc.gnu.org 2003-03-15 01:42:13 Added files: gcc/testsuite/gcc.dg: section1.c Log message: PR optimization/6871 * varasm.c (assemble_variable): Leave constant zeroes in .rodata. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/section1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
From: jason@gcc.gnu.org To: gcc-gnats@gcc.gnu.org Cc: Subject: optimization/6871 Date: 15 Mar 2003 01:42:56 -0000 CVSROOT: /cvs/gcc Module name: gcc Changes by: jason@gcc.gnu.org 2003-03-15 01:42:56 Modified files: gcc : ChangeLog Log message: PR optimization/6871 * varasm.c (assemble_variable): Leave constant zeroes in .rodata. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=1.17086&r2=1.17087
From: jason@gcc.gnu.org To: gcc-gnats@gcc.gnu.org Cc: Subject: optimization/6871 Date: 15 Mar 2003 01:43:07 -0000 CVSROOT: /cvs/gcc Module name: gcc Changes by: jason@gcc.gnu.org 2003-03-15 01:43:07 Modified files: gcc : varasm.c Log message: PR optimization/6871 * varasm.c (assemble_variable): Leave constant zeroes in .rodata. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/varasm.c.diff?cvsroot=gcc&r1=1.333&r2=1.334
State-Changed-From-To: analyzed->closed State-Changed-Why: fixed.
From: jason@gcc.gnu.org To: gcc-gnats@gcc.gnu.org Cc: Subject: optimization/6871 Date: 15 Mar 2003 01:44:40 -0000 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: jason@gcc.gnu.org 2003-03-15 01:44:40 Modified files: gcc : ChangeLog varasm.c Log message: PR optimization/6871 * varasm.c (assemble_variable): Leave constant zeroes in .rodata. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.299&r2=1.16114.2.300 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/varasm.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.324.2.1&r2=1.324.2.2