This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/12218] [3.4 regression] runtime segfault when initializing global variable with pointer-to-member
- From: "dbaron at dbaron dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Sep 2003 23:49:24 -0000
- Subject: [Bug c++/12218] [3.4 regression] runtime segfault when initializing global variable with pointer-to-member
- References: <20030908222714.12218.bryner@brianryner.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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;