public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/21336] New: Internal compiler error when using custom new operators
@ 2005-05-02 12:03 moudekotte at khaeon dot nl
2005-05-02 12:07 ` [Bug c++/21336] " moudekotte at khaeon dot nl
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: moudekotte at khaeon dot nl @ 2005-05-02 12:03 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1795 bytes --]
The following piece of code crashes both my custom built gcc 4.0.0 (straight
from an official mirror) and gcc 4.0.0-0.41.fc3 from Red Hat. The code is a
reconstruction of a piece of propriatary code I cannot post.
CODE:
typedef unsigned int size_t;
class A;
class B;
class C;
template<class _T> inline void* operator new( size_t Size, _T&);
template<class _T> inline void operator delete( void*, _T&);
class Abase {};
class A : public Abase {
public:
A() {}
A(int a, int b, int c, int d) {}
};
class Bbase {};
class B : public Bbase {
public:
Abase* m() {
return new(a) A(1,2,3,4);
}
A a;
};
class C {
public:
Bbase* n() {
return new B();
}
};
GCC OUTPUT:
main.cpp: In member function Bbase* C::n():
main.cpp:29: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccUR3mvM.out file, please attach this to
your bugreport.
OTHER COMPILERS:
MSVC++ 7.0 compiles the code above without warnings.
gcc version 3.4.3 20050227 (Red Hat 3.4.3-22.fc3) returns this:
main.cpp: In member function `Bbase* C::n()':
main.cpp:29: error: no suitable or ambiguous `operator new' found in class `B'
--
Summary: Internal compiler error when using custom new operators
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: critical
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: moudekotte at khaeon dot nl
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: i686-redhat-linux
GCC target triplet: i386-redhat-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21336
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/21336] Internal compiler error when using custom new operators
2005-05-02 12:03 [Bug c++/21336] New: Internal compiler error when using custom new operators moudekotte at khaeon dot nl
@ 2005-05-02 12:07 ` moudekotte at khaeon dot nl
2005-05-02 12:22 ` [Bug c++/21336] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: moudekotte at khaeon dot nl @ 2005-05-02 12:07 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From moudekotte at khaeon dot nl 2005-05-02 12:07 -------
Created an attachment (id=8793)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8793&action=view)
Preprocessed file
Preprocessed file as mentioned in bug description
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21336
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/21336] [3.4/4.0/4.1 Regression] Internal compiler error when using custom new operators
2005-05-02 12:03 [Bug c++/21336] New: Internal compiler error when using custom new operators moudekotte at khaeon dot nl
2005-05-02 12:07 ` [Bug c++/21336] " moudekotte at khaeon dot nl
@ 2005-05-02 12:22 ` pinskia at gcc dot gnu dot org
2005-05-19 17:40 ` mmitchel at gcc dot gnu dot org
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-02 12:22 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-02 12:21 -------
Confirmed, a 3.4 regression also.
Reduced testcase:
typedef __SIZE_TYPE__ size_t;
template<class _T> inline void* operator new( size_t Size, _T&);
struct B {
int a;
int* m() {
return new(a) int;
}
};
B* n() {
return new B();
}
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |ice-on-valid-code
Known to fail| |3.4.0 4.0.0 4.1.0
Known to work| |3.3.3
Last reconfirmed|0000-00-00 00:00:00 |2005-05-02 12:21:41
date| |
Summary|Internal compiler error when|[3.4/4.0/4.1 Regression]
|using custom new operators |Internal compiler error when
| |using custom new operators
Target Milestone|--- |3.4.4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21336
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/21336] [3.4/4.0/4.1 Regression] Internal compiler error when using custom new operators
2005-05-02 12:03 [Bug c++/21336] New: Internal compiler error when using custom new operators moudekotte at khaeon dot nl
2005-05-02 12:07 ` [Bug c++/21336] " moudekotte at khaeon dot nl
2005-05-02 12:22 ` [Bug c++/21336] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
@ 2005-05-19 17:40 ` mmitchel at gcc dot gnu dot org
2005-06-01 0:17 ` pinskia at gcc dot gnu dot org
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-05-19 17:40 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|3.4.4 |3.4.5
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21336
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/21336] [3.4/4.0/4.1 Regression] Internal compiler error when using custom new operators
2005-05-02 12:03 [Bug c++/21336] New: Internal compiler error when using custom new operators moudekotte at khaeon dot nl
` (2 preceding siblings ...)
2005-05-19 17:40 ` mmitchel at gcc dot gnu dot org
@ 2005-06-01 0:17 ` pinskia at gcc dot gnu dot org
2005-06-02 17:49 ` mmitchel at gcc dot gnu dot org
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-01 0:17 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-06-01 00:17 -------
The ICE started
: Search converges between 2004-01-17-trunk (#438) and 2004-01-23-trunk (#439).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21336
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/21336] [3.4/4.0/4.1 Regression] Internal compiler error when using custom new operators
2005-05-02 12:03 [Bug c++/21336] New: Internal compiler error when using custom new operators moudekotte at khaeon dot nl
` (3 preceding siblings ...)
2005-06-01 0:17 ` pinskia at gcc dot gnu dot org
@ 2005-06-02 17:49 ` mmitchel at gcc dot gnu dot org
2005-06-03 16:17 ` cvs-commit at gcc dot gnu dot org
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-06-02 17:49 UTC (permalink / raw)
To: gcc-bugs
--
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=21336
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/21336] [3.4/4.0/4.1 Regression] Internal compiler error when using custom new operators
2005-05-02 12:03 [Bug c++/21336] New: Internal compiler error when using custom new operators moudekotte at khaeon dot nl
` (4 preceding siblings ...)
2005-06-02 17:49 ` mmitchel at gcc dot gnu dot org
@ 2005-06-03 16:17 ` cvs-commit at gcc dot gnu dot org
2005-06-03 16:19 ` [Bug c++/21336] [3.4 " mmitchel at gcc dot gnu dot org
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-06-03 16:17 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-06-03 16:17 -------
Subject: Bug 21336
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: mmitchel@gcc.gnu.org 2005-06-03 16:16:47
Modified files:
gcc/cp : cp-tree.h decl.c pt.c ChangeLog
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/g++.dg/template: new2.C
Log message:
PR c++/21336
* cp-tree.h (grok_op_properties): Remove friendp parameter.
* decl.c (grokfndecl): Adjust call.
(grok_op_properties): Determine the class of which the function is
a member by looking at its DECL_CONTEXT, not current_class_type.
* pt.c (tsubst_decl): Adjust call to grok_op_properties.
PR c++/21336
* g++.dg/template/new2.C: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&r1=1.1139&r2=1.1140
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1402&r2=1.1403
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.1000&r2=1.1001
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4772&r2=1.4773
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5585&r2=1.5586
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/new2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21336
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/21336] [3.4/4.0/4.1 Regression] Internal compiler error when using custom new operators
2005-05-02 12:03 [Bug c++/21336] New: Internal compiler error when using custom new operators moudekotte at khaeon dot nl
` (6 preceding siblings ...)
2005-06-03 16:19 ` [Bug c++/21336] [3.4 " mmitchel at gcc dot gnu dot org
@ 2005-06-03 16:19 ` cvs-commit at gcc dot gnu dot org
2005-06-03 16:29 ` [Bug c++/21336] [3.4 " cvs-commit at gcc dot gnu dot org
2005-06-03 16:31 ` mmitchel at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-06-03 16:19 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-06-03 16:19 -------
Subject: Bug 21336
CVSROOT: /cvs/gcc
Module name: gcc
Branch: gcc-4_0-branch
Changes by: mmitchel@gcc.gnu.org 2005-06-03 16:18:54
Modified files:
gcc/cp : cp-tree.h decl.c pt.c ChangeLog
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/g++.dg/template: new2.C
Log message:
PR c++/21336
* cp-tree.h (grok_op_properties): Remove friendp parameter.
* decl.c (grokfndecl): Adjust call.
(grok_op_properties): Determine the class of which the function is
a member by looking at its DECL_CONTEXT, not current_class_type.
* pt.c (tsubst_decl): Adjust call to grok_op_properties.
PR c++/21336
* g++.dg/template/new2.C: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.1106.2.6&r2=1.1106.2.7
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.1371.2.13&r2=1.1371.2.14
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.978.2.11&r2=1.978.2.12
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.4648.2.55&r2=1.4648.2.56
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.221&r2=1.5084.2.222
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/new2.C.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21336
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/21336] [3.4 Regression] Internal compiler error when using custom new operators
2005-05-02 12:03 [Bug c++/21336] New: Internal compiler error when using custom new operators moudekotte at khaeon dot nl
` (5 preceding siblings ...)
2005-06-03 16:17 ` cvs-commit at gcc dot gnu dot org
@ 2005-06-03 16:19 ` mmitchel at gcc dot gnu dot org
2005-06-03 16:19 ` [Bug c++/21336] [3.4/4.0/4.1 " cvs-commit at gcc dot gnu dot org
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-06-03 16:19 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mmitchel at gcc dot gnu dot org 2005-06-03 16:19 -------
Fixed in 4.0, 4.1.
--
What |Removed |Added
----------------------------------------------------------------------------
Summary|[3.4/4.0/4.1 Regression] |[3.4 Regression] Internal
|Internal compiler error when|compiler error when using
|using custom new operators |custom new operators
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21336
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/21336] [3.4 Regression] Internal compiler error when using custom new operators
2005-05-02 12:03 [Bug c++/21336] New: Internal compiler error when using custom new operators moudekotte at khaeon dot nl
` (7 preceding siblings ...)
2005-06-03 16:19 ` [Bug c++/21336] [3.4/4.0/4.1 " cvs-commit at gcc dot gnu dot org
@ 2005-06-03 16:29 ` cvs-commit at gcc dot gnu dot org
2005-06-03 16:31 ` mmitchel at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-06-03 16:29 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-06-03 16:29 -------
Subject: Bug 21336
CVSROOT: /cvs/gcc
Module name: gcc
Branch: gcc-3_4-branch
Changes by: mmitchel@gcc.gnu.org 2005-06-03 16:29:36
Modified files:
gcc/cp : cp-tree.h decl.c pt.c ChangeLog
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/g++.dg/template: new2.C
Log message:
PR c++/21336
* cp-tree.h (grok_op_properties): Remove friendp parameter.
* decl.c (grokfndecl): Adjust call.
(grok_op_properties): Determine the class of which the function is
a member by looking at its DECL_CONTEXT, not current_class_type.
* pt.c (tsubst_decl): Adjust call to grok_op_properties.
PR c++/21336
* g++.dg/template/new2.C: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.946.4.20&r2=1.946.4.21
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.34&r2=1.1174.2.35
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.816.2.53&r2=1.816.2.54
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.220&r2=1.3892.2.221
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.399&r2=1.3389.2.400
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/new2.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.4.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21336
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/21336] [3.4 Regression] Internal compiler error when using custom new operators
2005-05-02 12:03 [Bug c++/21336] New: Internal compiler error when using custom new operators moudekotte at khaeon dot nl
` (8 preceding siblings ...)
2005-06-03 16:29 ` [Bug c++/21336] [3.4 " cvs-commit at gcc dot gnu dot org
@ 2005-06-03 16:31 ` mmitchel at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-06-03 16:31 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mmitchel at gcc dot gnu dot org 2005-06-03 16:31 -------
Fixed in 3.4.5.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21336
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2005-06-03 16:31 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-02 12:03 [Bug c++/21336] New: Internal compiler error when using custom new operators moudekotte at khaeon dot nl
2005-05-02 12:07 ` [Bug c++/21336] " moudekotte at khaeon dot nl
2005-05-02 12:22 ` [Bug c++/21336] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
2005-05-19 17:40 ` mmitchel at gcc dot gnu dot org
2005-06-01 0:17 ` pinskia at gcc dot gnu dot org
2005-06-02 17:49 ` mmitchel at gcc dot gnu dot org
2005-06-03 16:17 ` cvs-commit at gcc dot gnu dot org
2005-06-03 16:19 ` [Bug c++/21336] [3.4 " mmitchel at gcc dot gnu dot org
2005-06-03 16:19 ` [Bug c++/21336] [3.4/4.0/4.1 " cvs-commit at gcc dot gnu dot org
2005-06-03 16:29 ` [Bug c++/21336] [3.4 " cvs-commit at gcc dot gnu dot org
2005-06-03 16:31 ` mmitchel 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).