Return-Path: Delivered-To: apmail-stdcxx-issues-archive@locus.apache.org Received: (qmail 46107 invoked from network); 28 Mar 2008 19:38:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Mar 2008 19:38:39 -0000 Received: (qmail 29794 invoked by uid 500); 28 Mar 2008 19:38:39 -0000 Delivered-To: apmail-stdcxx-issues-archive@stdcxx.apache.org Received: (qmail 29772 invoked by uid 500); 28 Mar 2008 19:38:39 -0000 Mailing-List: contact issues-help@stdcxx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stdcxx.apache.org Delivered-To: mailing list issues@stdcxx.apache.org Received: (qmail 29759 invoked by uid 99); 28 Mar 2008 19:38:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Mar 2008 12:38:38 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Mar 2008 19:38:06 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 97EFA234C0AB for ; Fri, 28 Mar 2008 12:36:24 -0700 (PDT) Message-ID: <723136493.1206732984621.JavaMail.jira@brutus> Date: Fri, 28 Mar 2008 12:36:24 -0700 (PDT) From: "Martin Sebor (JIRA)" To: issues@stdcxx.apache.org Subject: [jira] Issue Comment Edited: (STDCXX-802) [HP aCC 6.16] bad codegen on ud ctor and factory function In-Reply-To: <1029176181.1206731664906.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/STDCXX-802?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12583157#action_12583157 ] sebor edited comment on STDCXX-802 at 3/28/08 12:35 PM: --------------------------------------------------------------- The test case can be further simplified: {noformat} $ cat t.cpp && aCC -AA -V t.cpp && ./a.out struct B { ~B () { } }; struct A { const B* b; A (): b (new B [1]) { } ~A () { delete[] b; } }; int main () { A a; } aCC: HP C/aC++ B3910B A.06.16 [Nov 26 2007] ld: 92453-07 linker ld HP Itanium(R) B.12.41 IPF/IPF Segmentation fault (core dumped) {noformat} was (Author: sebor): The test case can be further simplified: {noformat} $ cat t.cpp && aCC -AA -V t.cpp && ./a.out template struct A { const T* x; A (): x (T::foo ()) { } ~A () { delete[] x; } }; struct B { ~B () { } static B* foo (); }; template T* foo (T*) { return new T [1]; } B* B::foo () { return ::foo ((B*)0); } int main () { A td; } aCC: HP C/aC++ B3910B A.06.16 [Nov 26 2007] ld: 92453-07 linker ld HP Itanium(R) B.12.41 IPF/IPF Segmentation fault (core dumped) {noformat} > [HP aCC 6.16] bad codegen on ud ctor and factory function > --------------------------------------------------------- > > Key: STDCXX-802 > URL: https://issues.apache.org/jira/browse/STDCXX-802 > Project: C++ Standard Library > Issue Type: Bug > Components: External > Environment: aCC: HP C/aC++ B3910B A.06.16 [Nov 26 2007] > Reporter: Martin Sebor > > -------- Original Message -------- > Subject: aCC 6.16 bad codegen on ud operator new and ud ctor > Date: Fri, 28 Mar 2008 13:13:03 -0600 > From: Martin Sebor > Organization: Rogue Wave Software, Inc. > To: acxx@cup.hp.com > This bug has been causing a bunch of failures in our test > suite since 6.0. The user-defined dtor in class B triggers > it. Changing the number of allocated elements from 2 to 1 > causes a SEGV. > Martin > {noformat} > $ cat t.cpp && aCC -AA -V t.cpp && ./a.out > #include > #include > #include > #include > void *palloc; > void *pfree; > void* operator new (std::size_t n) throw (std::bad_alloc) { > void* const ptr = std::malloc (n); > std::fprintf (stderr, "operator new (%zu) ==> %p\n", n, ptr); > return ptr; > } > void operator delete (void *ptr) throw () { > std::fprintf (stderr, "operator delete (%p)\n", ptr); > std::free (ptr); > } > void* operator new[] (std::size_t n) throw (std::bad_alloc) { > void* const ptr = std::malloc (n); > std::fprintf (stderr, "operator new[] (%zu) ==> %p\n", n, ptr); > return palloc = ptr; > } > void operator delete[] (void *ptr) throw () { > std::fprintf (stderr, "operator delete[] (%p)\n", ptr); > std::free (pfree = ptr); > } > template > struct A { > const T* x; > A (): x (T::foo ()) { } > ~A () { delete[] x; } > }; > struct B { > ~B () { } > static B* foo (); > }; > template T* foo (T*) { return new T [2]; } > B* B::foo () { return ::foo ((B*)0); } > int main () { > { A td; } > assert (palloc == pfree); > } > aCC: HP C/aC++ B3910B A.06.16 [Nov 26 2007] > ld: 92453-07 linker ld HP Itanium(R) B.12.41 IPF/IPF > operator new (16) ==> 400124b0 > operator new[] (6) ==> 40012510 > operator delete[] (40012514) > Assertion failed: palloc == pfree, file t.cpp, line 48 > ABORT instruction (core dumped) > {noformat} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.