This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [g++] RFH: Is there a way to make gcc place global const class objects in .rodata ?


>Seongbae Park wrote:
>
>Of course, it's best if this can be implemented in the compiler,
>but if the size and the number of the readonly data is manageable,
>you can do this by hand -
>inspect what the layout of the class is by writing a test program
>and looking at how the fields are layed out,
>and replicating the same data in the assembly.

IMO, that would not really be a solution.
Meanwhile, I have reduced a test case for the issue. It's 6 lines long.


#include <complex>

using namespace std;
const complex<double> should_be_in_rodata (42,-42);
complex<double> should_be_in_data (-42,42);
complex<double> should_be_in_bss;


Presently all of them end up in bss.

Bjoern.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]