public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14804] New: [3.4 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes
@ 2004-04-01  1:32 dbaron at dbaron dot org
  2004-04-01  1:33 ` [Bug c++/14804] " dbaron at dbaron dot org
                   ` (23 more replies)
  0 siblings, 24 replies; 25+ messages in thread
From: dbaron at dbaron dot org @ 2004-04-01  1:32 UTC (permalink / raw)
  To: gcc-bugs

This is somewhat similar to bug 12218 (which was fixed), but is a regression
between 20040105 and 20040311.

Initializing const data with a reinterpret_cast of a pointer-to-member virtual
function causes that const data to be emitted in the .rodata section (as it
should be) but causes initialization code to be generated to fill in the data.
(The reinterpret_cast is required for compilers other than gcc -- static_cast
works fine with gcc 3.4 and doesn't show the bug.)

This causes gcc to generate code that crashes on static initialization.

Testcase to be attached (simplified from nsEventListenerManager.cpp in Mozilla).

-- 
           Summary: [3.4 regression] initializing const data with
                    reinterpret_cast-ed pointer-to-member function crashes
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dbaron at dbaron dot org
                CC: bryner at brianryner dot com,gcc-bugs at gcc dot gnu dot
                    org
 GCC build triplet: i686-gnu-linux-gnu
  GCC host triplet: i686-gnu-linux-gnu
GCC target triplet: i686-gnu-linux-gnu


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug c++/14804] [3.4 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes
  2004-04-01  1:32 [Bug c++/14804] New: [3.4 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes dbaron at dbaron dot org
@ 2004-04-01  1:33 ` dbaron at dbaron dot org
  2004-04-01  1:35 ` dbaron at dbaron dot org
                   ` (22 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: dbaron at dbaron dot org @ 2004-04-01  1:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dbaron at dbaron dot org  2004-04-01 01:33 -------
Created an attachment (id=6022)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=6022&action=view)
testcase


-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug c++/14804] [3.4 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes
  2004-04-01  1:32 [Bug c++/14804] New: [3.4 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes dbaron at dbaron dot org
  2004-04-01  1:33 ` [Bug c++/14804] " dbaron at dbaron dot org
@ 2004-04-01  1:35 ` dbaron at dbaron dot org
  2004-04-01  1:38 ` [Bug c++/14804] [3.3/3.4/3.5 " pinskia at gcc dot gnu dot org
                   ` (21 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: dbaron at dbaron dot org @ 2004-04-01  1:35 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug c++/14804] [3.3/3.4/3.5 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes
  2004-04-01  1:32 [Bug c++/14804] New: [3.4 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes dbaron at dbaron dot org
  2004-04-01  1:33 ` [Bug c++/14804] " dbaron at dbaron dot org
  2004-04-01  1:35 ` dbaron at dbaron dot org
@ 2004-04-01  1:38 ` pinskia at gcc dot gnu dot org
  2004-04-01  1:39 ` pinskia at gcc dot gnu dot org
                   ` (20 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-01  1:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-04-01 01:38 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |critical
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-04-01 01:38:53
               date|                            |
            Summary|[3.4 regression]            |[3.3/3.4/3.5 regression]
                   |initializing const data with|initializing const data with
                   |reinterpret_cast-ed pointer-|reinterpret_cast-ed pointer-
                   |to-member function crashes  |to-member function crashes
   Target Milestone|---                         |3.3.4


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug c++/14804] [3.3/3.4/3.5 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes
  2004-04-01  1:32 [Bug c++/14804] New: [3.4 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes dbaron at dbaron dot org
                   ` (2 preceding siblings ...)
  2004-04-01  1:38 ` [Bug c++/14804] [3.3/3.4/3.5 " pinskia at gcc dot gnu dot org
@ 2004-04-01  1:39 ` pinskia at gcc dot gnu dot org
  2004-04-01  1:43 ` dbaron at dbaron dot org
                   ` (19 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-01  1:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-04-01 01:39 -------
*** Bug 14640 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |debian-gcc at lists dot
                   |                            |debian dot org


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug c++/14804] [3.3/3.4/3.5 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes
  2004-04-01  1:32 [Bug c++/14804] New: [3.4 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes dbaron at dbaron dot org
                   ` (3 preceding siblings ...)
  2004-04-01  1:39 ` pinskia at gcc dot gnu dot org
@ 2004-04-01  1:43 ` dbaron at dbaron dot org
  2004-04-01  1:44 ` dbaron at dbaron dot org
                   ` (18 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: dbaron at dbaron dot org @ 2004-04-01  1:43 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dbaron at dbaron dot org  2004-04-01 01:43 -------
Further testing shows that the bug happens the same way even if the function is
not virtual, as long as reinterpret_cast (rather than static_cast) is present. 
(And in the non-virtual case, when -fPIC is used, the data should be in
.rel.ro.data instead of .rodata -- which again works fine when static_cast is
used instead of reinterpret_cast.)

Why was this marked as a 3.3 regression?  The bug is not present in 3.3.3.

-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug c++/14804] [3.3/3.4/3.5 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes
  2004-04-01  1:32 [Bug c++/14804] New: [3.4 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes dbaron at dbaron dot org
                   ` (4 preceding siblings ...)
  2004-04-01  1:43 ` dbaron at dbaron dot org
@ 2004-04-01  1:44 ` dbaron at dbaron dot org
  2004-04-01  1:45 ` pinskia at gcc dot gnu dot org
                   ` (17 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: dbaron at dbaron dot org @ 2004-04-01  1:44 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dbaron at dbaron dot org  2004-04-01 01:44 -------
Ah, never mind.  I see the comments on bug 14640 indicating that it's a
regression on the 3.3 branch since 3.3.3.

-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug c++/14804] [3.3/3.4/3.5 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes
  2004-04-01  1:32 [Bug c++/14804] New: [3.4 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes dbaron at dbaron dot org
                   ` (5 preceding siblings ...)
  2004-04-01  1:44 ` dbaron at dbaron dot org
@ 2004-04-01  1:45 ` pinskia at gcc dot gnu dot org
  2004-04-01  1:48 ` dbaron at dbaron dot org
                   ` (16 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-01  1:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-04-01 01:45 -------
Because it is broken on the 3.3 branch, see the dup bug.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |3.3.4 3.4.0 3.5.0
      Known to work|                            |3.3.3


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug c++/14804] [3.3/3.4/3.5 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes
  2004-04-01  1:32 [Bug c++/14804] New: [3.4 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes dbaron at dbaron dot org
                   ` (6 preceding siblings ...)
  2004-04-01  1:45 ` pinskia at gcc dot gnu dot org
@ 2004-04-01  1:48 ` dbaron at dbaron dot org
  2004-04-01  2:06 ` mmitchel at gcc dot gnu dot org
                   ` (15 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: dbaron at dbaron dot org @ 2004-04-01  1:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dbaron at dbaron dot org  2004-04-01 01:48 -------
It's also probably worth noting here what bug 14640 comment 8 says: that the
regression was caused by the backport of PR10776.

-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug c++/14804] [3.3/3.4/3.5 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes
  2004-04-01  1:32 [Bug c++/14804] New: [3.4 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes dbaron at dbaron dot org
                   ` (7 preceding siblings ...)
  2004-04-01  1:48 ` dbaron at dbaron dot org
@ 2004-04-01  2:06 ` mmitchel at gcc dot gnu dot org
  2004-04-01  2:24 ` rth at gcc dot gnu dot org
                   ` (14 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-04-01  2:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-04-01 02:06 -------
Retargeted at 3.4.0, since Mozilla depends on this.

Richard, does this problem have to do with your optimizations to the way we emit
aggregate initializers?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.3.4                       |3.4.0


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug c++/14804] [3.3/3.4/3.5 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes
  2004-04-01  1:32 [Bug c++/14804] New: [3.4 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes dbaron at dbaron dot org
                   ` (8 preceding siblings ...)
  2004-04-01  2:06 ` mmitchel at gcc dot gnu dot org
@ 2004-04-01  2:24 ` rth at gcc dot gnu dot org
  2004-04-01 20:21 ` rth at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: rth at gcc dot gnu dot org @ 2004-04-01  2:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rth at gcc dot gnu dot org  2004-04-01 02:24 -------
Mine; testing patch.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|rth at gcc dot gnu dot org  |
         AssignedTo|unassigned at gcc dot gnu   |rth at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Target Milestone|3.4.0                       |3.3.4


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug c++/14804] [3.3/3.4/3.5 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes
  2004-04-01  1:32 [Bug c++/14804] New: [3.4 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes dbaron at dbaron dot org
                   ` (9 preceding siblings ...)
  2004-04-01  2:24 ` rth at gcc dot gnu dot org
@ 2004-04-01 20:21 ` rth at gcc dot gnu dot org
  2004-04-01 20:45 ` cvs-commit at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: rth at gcc dot gnu dot org @ 2004-04-01 20:21 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rth at gcc dot gnu dot org  2004-04-01 20:21 -------
patch: http://gcc.gnu.org/ml/gcc-patches/2004-04/msg00076.html

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug c++/14804] [3.3/3.4/3.5 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes
  2004-04-01  1:32 [Bug c++/14804] New: [3.4 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes dbaron at dbaron dot org
                   ` (10 preceding siblings ...)
  2004-04-01 20:21 ` rth at gcc dot gnu dot org
@ 2004-04-01 20:45 ` cvs-commit at gcc dot gnu dot org
  2004-04-01 20:47 ` cvs-commit at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-04-01 20:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-04-01 20:45 -------
Subject: Bug 14804

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	rth@gcc.gnu.org	2004-04-01 20:45:02

Modified files:
	gcc/cp         : ChangeLog decl.c typeck2.c 
Added files:
	gcc/testsuite/g++.dg/init: static2.C 

Log message:
	PR c++/14804
	* decl.c (cp_finish_decl): Preserve TREE_READONLY more often.
	* typeck2.c (split_nonconstant_init): Clear TREE_READONLY.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4023&r2=1.4024
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1200&r2=1.1201
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck2.c.diff?cvsroot=gcc&r1=1.155&r2=1.156
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/static2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug c++/14804] [3.3/3.4/3.5 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes
  2004-04-01  1:32 [Bug c++/14804] New: [3.4 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes dbaron at dbaron dot org
                   ` (11 preceding siblings ...)
  2004-04-01 20:45 ` cvs-commit at gcc dot gnu dot org
@ 2004-04-01 20:47 ` cvs-commit at gcc dot gnu dot org
  2004-04-01 21:48 ` cvs-commit at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-04-01 20:47 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-04-01 20:47 -------
Subject: Bug 14804

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	rth@gcc.gnu.org	2004-04-01 20:47:27

Modified files:
	gcc/cp         : ChangeLog decl.c typeck2.c 
Added files:
	gcc/testsuite/g++.dg/init: static2.C 

Log message:
	PR c++/14804
	* decl.c (cp_finish_decl): Preserve TREE_READONLY more often.
	* typeck2.c (split_nonconstant_init): Clear TREE_READONLY.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.92&r2=1.3892.2.93
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.1174.2.18&r2=1.1174.2.19
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck2.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.153.4.2&r2=1.153.4.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/static2.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1



-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug c++/14804] [3.3/3.4/3.5 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes
  2004-04-01  1:32 [Bug c++/14804] New: [3.4 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes dbaron at dbaron dot org
                   ` (12 preceding siblings ...)
  2004-04-01 20:47 ` cvs-commit at gcc dot gnu dot org
@ 2004-04-01 21:48 ` cvs-commit at gcc dot gnu dot org
  2004-04-01 21:49 ` [Bug c++/14804] " rth at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-04-01 21:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-04-01 21:48 -------
Subject: Bug 14804

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	rth@gcc.gnu.org	2004-04-01 21:48:06

Modified files:
	gcc/cp         : ChangeLog decl.c typeck2.c 
Added files:
	gcc/testsuite/g++.dg/init: static2.C 

Log message:
	PR c++/14804
	* decl.c (cp_finish_decl): Preserve TREE_READONLY more often.
	* typeck2.c (split_nonconstant_init): Clear TREE_READONLY.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.264&r2=1.3076.2.265
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.965.2.80&r2=1.965.2.81
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck2.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.132.4.5&r2=1.132.4.6
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/static2.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.4.1



-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug c++/14804] initializing const data with reinterpret_cast-ed pointer-to-member function crashes
  2004-04-01  1:32 [Bug c++/14804] New: [3.4 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes dbaron at dbaron dot org
                   ` (13 preceding siblings ...)
  2004-04-01 21:48 ` cvs-commit at gcc dot gnu dot org
@ 2004-04-01 21:49 ` rth at gcc dot gnu dot org
  2004-04-03 19:50 ` 1319 at bot dot ru
                   ` (8 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: rth at gcc dot gnu dot org @ 2004-04-01 21:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rth at gcc dot gnu dot org  2004-04-01 21:48 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
            Summary|[3.3/3.4/3.5 regression]    |initializing const data with
                   |initializing const data with|reinterpret_cast-ed pointer-
                   |reinterpret_cast-ed pointer-|to-member function crashes
                   |to-member function crashes  |


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug c++/14804] initializing const data with reinterpret_cast-ed pointer-to-member function crashes
  2004-04-01  1:32 [Bug c++/14804] New: [3.4 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes dbaron at dbaron dot org
                   ` (14 preceding siblings ...)
  2004-04-01 21:49 ` [Bug c++/14804] " rth at gcc dot gnu dot org
@ 2004-04-03 19:50 ` 1319 at bot dot ru
  2004-04-04  6:16 ` [Bug c++/14804] [3.4/3.5 Regression] [unit-at-a-time] " pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: 1319 at bot dot ru @ 2004-04-03 19:50 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From 1319 at bot dot ru  2004-04-03 19:50 -------
No, it is not. Testcase still segfaults if compiled with -funit-at-a-time.

$ g++ -O3 -fno-unit-at-a-time 14804.cc
$ ./a.out
$ g++ -funit-at-a-time 14804.cc
$ ./a.out 
Segmentation fault
$

This is true for both 3.4.0 and 3.5.0 from 20040403.


-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug c++/14804] [3.4/3.5 Regression] [unit-at-a-time] initializing const data with reinterpret_cast-ed pointer-to-member function crashes
  2004-04-01  1:32 [Bug c++/14804] New: [3.4 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes dbaron at dbaron dot org
                   ` (16 preceding siblings ...)
  2004-04-04  6:16 ` [Bug c++/14804] [3.4/3.5 Regression] [unit-at-a-time] " pinskia at gcc dot gnu dot org
@ 2004-04-04  6:16 ` pinskia at gcc dot gnu dot org
  2004-04-04 19:31 ` mmitchel at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-04  6:16 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-04-04 06:15 -------
This is now only a 3.4.0/3.5.0 regression as unit-at-a-time is only in 3.4.0 and above.
Jan or RTH could you look into why unit-at-a-time could cause this.  I saw that GCC was 
putting the symbol still in read only data for unit-at-a-time.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu dot
                   |                            |org
             Status|RESOLVED                    |REOPENED
      Known to fail|3.3.4 3.4.0 3.5.0           |3.4.0 3.5.0
      Known to work|3.3.3                       |3.3.3 3.3.4
         Resolution|FIXED                       |
            Summary|initializing const data with|[3.4/3.5 Regression] [unit-
                   |reinterpret_cast-ed pointer-|at-a-time] initializing
                   |to-member function crashes  |const data with
                   |                            |reinterpret_cast-ed pointer-
                   |                            |to-member function crashes
   Target Milestone|3.3.4                       |3.4.1


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug c++/14804] [3.4/3.5 Regression] [unit-at-a-time] initializing const data with reinterpret_cast-ed pointer-to-member function crashes
  2004-04-01  1:32 [Bug c++/14804] New: [3.4 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes dbaron at dbaron dot org
                   ` (15 preceding siblings ...)
  2004-04-03 19:50 ` 1319 at bot dot ru
@ 2004-04-04  6:16 ` pinskia at gcc dot gnu dot org
  2004-04-04  6:16 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-04  6:16 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|rth at gcc dot gnu dot org  |unassigned at gcc dot gnu
                   |                            |dot org
             Status|REOPENED                    |NEW


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug c++/14804] [3.4/3.5 Regression] [unit-at-a-time] initializing const data with reinterpret_cast-ed pointer-to-member function crashes
  2004-04-01  1:32 [Bug c++/14804] New: [3.4 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes dbaron at dbaron dot org
                   ` (17 preceding siblings ...)
  2004-04-04  6:16 ` pinskia at gcc dot gnu dot org
@ 2004-04-04 19:31 ` mmitchel at gcc dot gnu dot org
  2004-04-04 22:50 ` cvs-commit at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-04-04 19:31 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-04-04 19:31 -------
Working on a fix.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |mark at codesourcery dot com
                   |dot org                     |
             Status|NEW                         |ASSIGNED


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug c++/14804] [3.4/3.5 Regression] [unit-at-a-time] initializing const data with reinterpret_cast-ed pointer-to-member function crashes
  2004-04-01  1:32 [Bug c++/14804] New: [3.4 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes dbaron at dbaron dot org
                   ` (18 preceding siblings ...)
  2004-04-04 19:31 ` mmitchel at gcc dot gnu dot org
@ 2004-04-04 22:50 ` cvs-commit at gcc dot gnu dot org
  2004-04-04 22:51 ` cvs-commit at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-04-04 22:50 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-04-04 22:50 -------
Subject: Bug 14804

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	mmitchel@gcc.gnu.org	2004-04-04 22:50:28

Modified files:
	gcc            : ChangeLog varasm.c 

Log message:
	PR c++/14804
	* varasm.c (initializer_constant_valid_p): Allow NOP_EXPRs to
	RECORD_TYPEs.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.378&r2=2.2326.2.379
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/varasm.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.405.2.1&r2=1.405.2.2



-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug c++/14804] [3.4/3.5 Regression] [unit-at-a-time] initializing const data with reinterpret_cast-ed pointer-to-member function crashes
  2004-04-01  1:32 [Bug c++/14804] New: [3.4 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes dbaron at dbaron dot org
                   ` (19 preceding siblings ...)
  2004-04-04 22:50 ` cvs-commit at gcc dot gnu dot org
@ 2004-04-04 22:51 ` cvs-commit at gcc dot gnu dot org
  2004-04-04 22:52 ` mmitchel at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-04-04 22:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-04-04 22:51 -------
Subject: Bug 14804

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2004-04-04 22:51:03

Modified files:
	gcc            : ChangeLog varasm.c 

Log message:
	PR c++/14804
	* varasm.c (initializer_constant_valid_p): Allow NOP_EXPRs to
	RECORD_TYPEs.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.3340&r2=2.3341
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/varasm.c.diff?cvsroot=gcc&r1=1.417&r2=1.418



-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug c++/14804] [3.4/3.5 Regression] [unit-at-a-time] initializing const data with reinterpret_cast-ed pointer-to-member function crashes
  2004-04-01  1:32 [Bug c++/14804] New: [3.4 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes dbaron at dbaron dot org
                   ` (20 preceding siblings ...)
  2004-04-04 22:51 ` cvs-commit at gcc dot gnu dot org
@ 2004-04-04 22:52 ` mmitchel at gcc dot gnu dot org
  2004-04-04 22:54 ` pinskia at gcc dot gnu dot org
  2004-07-19 12:09 ` cvs-commit at gcc dot gnu dot org
  23 siblings, 0 replies; 25+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-04-04 22:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-04-04 22:52 -------
Fixed it harder.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug c++/14804] [3.4/3.5 Regression] [unit-at-a-time] initializing const data with reinterpret_cast-ed pointer-to-member function crashes
  2004-04-01  1:32 [Bug c++/14804] New: [3.4 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes dbaron at dbaron dot org
                   ` (21 preceding siblings ...)
  2004-04-04 22:52 ` mmitchel at gcc dot gnu dot org
@ 2004-04-04 22:54 ` pinskia at gcc dot gnu dot org
  2004-07-19 12:09 ` cvs-commit at gcc dot gnu dot org
  23 siblings, 0 replies; 25+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-04 22:54 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.1                       |3.4.0


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Bug c++/14804] [3.4/3.5 Regression] [unit-at-a-time] initializing const data with reinterpret_cast-ed pointer-to-member function crashes
  2004-04-01  1:32 [Bug c++/14804] New: [3.4 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes dbaron at dbaron dot org
                   ` (22 preceding siblings ...)
  2004-04-04 22:54 ` pinskia at gcc dot gnu dot org
@ 2004-07-19 12:09 ` cvs-commit at gcc dot gnu dot org
  23 siblings, 0 replies; 25+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-07-19 12:09 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-07-19 12:08 -------
Subject: Bug 14804

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	hammer-3_3-branch
Changes by:	matz@gcc.gnu.org	2004-07-19 12:08:46

Modified files:
	gcc            : ChangeLog.hammer varasm.c 

Log message:
	Backport (for #42522):
	2004-04-04  Mark Mitchell  <mark@codesourcery.com>
	PR c++/14804
	* varasm.c (initializer_constant_valid_p): Allow NOP_EXPRs to
	RECORD_TYPEs.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.hammer.diff?cvsroot=gcc&only_with_tag=hammer-3_3-branch&r1=1.1.2.414&r2=1.1.2.415
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/varasm.c.diff?cvsroot=gcc&only_with_tag=hammer-3_3-branch&r1=1.318.2.18&r2=1.318.2.19



-- 


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


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2004-07-19 12:09 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-01  1:32 [Bug c++/14804] New: [3.4 regression] initializing const data with reinterpret_cast-ed pointer-to-member function crashes dbaron at dbaron dot org
2004-04-01  1:33 ` [Bug c++/14804] " dbaron at dbaron dot org
2004-04-01  1:35 ` dbaron at dbaron dot org
2004-04-01  1:38 ` [Bug c++/14804] [3.3/3.4/3.5 " pinskia at gcc dot gnu dot org
2004-04-01  1:39 ` pinskia at gcc dot gnu dot org
2004-04-01  1:43 ` dbaron at dbaron dot org
2004-04-01  1:44 ` dbaron at dbaron dot org
2004-04-01  1:45 ` pinskia at gcc dot gnu dot org
2004-04-01  1:48 ` dbaron at dbaron dot org
2004-04-01  2:06 ` mmitchel at gcc dot gnu dot org
2004-04-01  2:24 ` rth at gcc dot gnu dot org
2004-04-01 20:21 ` rth at gcc dot gnu dot org
2004-04-01 20:45 ` cvs-commit at gcc dot gnu dot org
2004-04-01 20:47 ` cvs-commit at gcc dot gnu dot org
2004-04-01 21:48 ` cvs-commit at gcc dot gnu dot org
2004-04-01 21:49 ` [Bug c++/14804] " rth at gcc dot gnu dot org
2004-04-03 19:50 ` 1319 at bot dot ru
2004-04-04  6:16 ` [Bug c++/14804] [3.4/3.5 Regression] [unit-at-a-time] " pinskia at gcc dot gnu dot org
2004-04-04  6:16 ` pinskia at gcc dot gnu dot org
2004-04-04 19:31 ` mmitchel at gcc dot gnu dot org
2004-04-04 22:50 ` cvs-commit at gcc dot gnu dot org
2004-04-04 22:51 ` cvs-commit at gcc dot gnu dot org
2004-04-04 22:52 ` mmitchel at gcc dot gnu dot org
2004-04-04 22:54 ` pinskia at gcc dot gnu dot org
2004-07-19 12:09 ` cvs-commit at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).