stdcxx-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Sebor (JIRA)" <j...@apache.org>
Subject [jira] Commented: (STDCXX-802) [HP aCC 6.16] bad codegen on ud ctor and factory function
Date Wed, 02 Apr 2008 14:29:24 GMT

    [ https://issues.apache.org/jira/browse/STDCXX-802?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12584583#action_12584583
] 

Martin Sebor commented on STDCXX-802:
-------------------------------------

>From Dennis:

-------- Original Message --------
Subject: Re:  aCC 6.16 bad codegen on ud operator new and ud ctor
Date: Wed, 2 Apr 2008 04:20:07 -0700 (PDT)
From: Dennis Handly <dhandly AT cup.hp.com>
To: acxx AT cup.hp.com, sebor AT roguewave.com

>From: Dennis Handly <dhandly AT cup.hp.com>
>This is a EDG problem fixed in our latest compiler.

I filed *QXCR1000794762* on this problem:
Bad code for delete [] p, where p is a const pointer


> [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 <sebor@roguewave.com>
> 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 <cassert>
> #include <cstdio>
> #include <cstdlib>
> #include <new>
> 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 <class T>
> struct A {
>     const T* x;
>     A (): x (T::foo ()) { }
>     ~A () { delete[] x; }
> };
> struct B {
>     ~B () { }
>     static B* foo ();
> };
> template <class T> T* foo (T*) { return new T [2]; }
> B* B::foo () { return ::foo ((B*)0); }
> int main () {
>     { A<B> 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.


Mime
View raw message