This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/25521] New: change semantics of const volatile variables
- From: "drepper at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Dec 2005 18:57:51 -0000
- Subject: [Bug middle-end/25521] New: change semantics of const volatile variables
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
In math code we often have to make sure the compiler does not fold operations
at compile time. In glibc we use variable declared as
static const volatile double foo = 42.0;
The problem is that gcc moves such variables into .data. But we could achieve
that easily by leaving out the 'const'. What is needed is a method to achieve
volatile behavior while having the variable in .rodata (and .rodata.cst8 etc).
I therefore would like to ask for a change in the compiler which preserves the
'const' in the presence of 'volatile' and place the variable in read-only
memory.
--
Summary: change semantics of const volatile variables
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: drepper at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25521