This is the mail archive of the gcc-bugs@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]

[Bug c++/12218] [3.4 regression] runtime segfault when initializing global variable with pointer-to-member


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12218



------- Additional Comments From dbaron at dbaron dot org  2003-09-08 23:49 -------
So it's clear what the regression is:

gcc 3.3 puts the variables in .rodata with the correct value and emits no
initialization code

gcc trunk puts the variables in .rodata with the value -1 and emits
initialization code (with the correct value) which segfaults

That's based on the testcase:

struct C { int i, j; };
typedef int C::*mPtr;
extern const mPtr should_be_0 = &C::i;
extern const mPtr should_be_4 = &C::j;


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