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

Reply via email to