This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
target/7013: redeclaring volatile objects forces them always into long data
- From: jbeulich at novell dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 13 Jun 2002 09:59:42 -0000
- Subject: target/7013: redeclaring volatile objects forces them always into long data
- Reply-to: jbeulich at novell dot com
>Number: 7013
>Category: target
>Synopsis: redeclaring volatile objects forces them always into long data
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Thu Jun 13 03:06:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Jan Beulich
>Release: 3.1
>Organization:
>Environment:
IA64 cross compiler running on Cygwin (Win2K).
>Description:
Due to the call to make_var_volatile in duplicate_decls,
volatile variables first declared extern (say in a header)
and then defined and initialized (in a source file) are
prevented to make it into .sdata. This is because
make_decl_rtl gets called at this point (and never again
later), and hence ENCODE_SECTION_INFO will not be called
at the point were it is called for non-volatile data
objects.
>How-To-Repeat:
Compile the following two lines with the IA64 compiler and
inspect the output; 'vi' ends up in .data rather than
.sdata.
extern volatile int vi;
volatile int vi = -1;
>Fix:
The suggested solution is to frame to whole body of
make_var_volatile with an 'if (DECL_RTL_SET_P(var))'
conditional (note the same would be true for other
architectures that have ENCODE_SECTION_INFO).
>Release-Note:
>Audit-Trail:
>Unformatted: