JDK-8164651 : adlc fails to compile with Developer Studio 12.5
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2016-08-23
  • Updated: 2024-07-23
  • Resolved: 2018-03-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11
11Fixed
Related Reports
Duplicate :  
Description
Building with Developer Studio 12.5 generates the following errors:

"jdk/jdk9repo/hotspot/src/share/vm/adlc/arena.cpp", line 60: Error, placementdelmatch: Placement operator new refers to non-placement operator delete.
"jdk/jdk9repo/hotspot/src/share/vm/adlc/arena.cpp", line 67: Error, placementdelmatch: Placement operator new refers to non-placement operator delete.
"jdk/jdk9repo/hotspot/src/share/vm/adlc/arena.cpp", line 97: Error, placementdelmatch: Placement operator new refers to non-placement operator delete.
3 Error(s) detected.
Comments
This bug should not be marked "Fixed". And fix version is not 11. It should be something like closed/external pointing it being a compiler bug and to the need to use a patched version of the compiler. Not saying a source code change to address it isn't possible too .. but it sounds like a compiler bug.
23-07-2024

I've seen the same issues with Studio 12 u6 when using an older patch-level. Upgrading to the latest version from 2018 fixed the issue However so it seems it was related to the compiler version used. Working compiler version with patch-level info : CC: Studio 12.6 Sun C++ 5.15 SunOS_sparc Patch 152715-03 2018/07/03
09-01-2019

[~jcm] Which issue made the source code change that fixed this? This bug should be closed as a duplicate of it, not marked as "Fixed". Thanks. I don't think JDK-8196880 addresses the same issue.
08-01-2019

source code fix is already in.
14-03-2018

Hi Jamsheed, this is another low-priority issue that needs to be fixed. The issue is affecting ADLC, so maybe you want to take a look at it (just to get familiar with the code and do some change there in the meantime). If you don't want to take this, please assign it back. Thank you and best regards, Zoltan
23-11-2016

9-defer-SQE-ok: agreed on deferral reason
31-08-2016

9-defer-request: Build problem with new compiler not yet used in production.
31-08-2016

ILW=development not possible with the newest version of Oracle Developer Studio (not yet used for releases),problem encountered whenever JDK is built,no workaround=MHH=P2
24-08-2016

Another comment from the Studio developers: ---------- This is a warning on a construct which is now invalid in C++ standard: ] cat dealloc1.cc #include <cstddef> struct Chunk { Chunk(std::size_t); void* operator new(std::size_t requested_size, std::size_t length); void operator delete(void* p, std::size_t length); // this }; void foo(std::size_t init_size) { new (init_size) Chunk(init_size); } ] CC dealloc1.cc -c "dealloc1.cc", line 9: Warning: Placement operator new refers to non-placement operator delete. 1 Warning(s) detected. ] It was implemented in Studio 12.5. And it was an error in g++ for quite awhile: ] g++4.8.2 dealloc1.cc -c dealloc1.cc: In function 'void foo(std::size_t)': dealloc1.cc:5:11: error: non-placement deallocation function 'static void Chunk::operator delete(void*, std::size_t)' [-fpermissive] void operator delete(void* p, std::size_t length); ^ dealloc1.cc:9:37: error: selected for placement delete [-fpermissive] new (init_size) Chunk(init_size); ^ ] Above testcase violates a direct requirement from the standard (5.3.4$20 from C++11). Quite a similar testcase can be found in the standard itself: [ Example: struct S { // Placement allocation function: static void* operator new(std::size_t, std::size_t); // Usual (non-placement) deallocation function: static void operator delete(void*, std::size_t); }; S* p = new (0) S; // ill-formed: non-placement deallocation function matches // placement allocation function —end example ] ----------
23-08-2016

Comment from the Studio developers: ---------- C++11 introduced sized deallocators, where an operator delete can take a size parameter. If a class has a member operator operator delete that takes just a pointer parameter, that is the non-placement delete. If it does not have such a function, but does have an operator delete with 2 parameters and the second is of type size_t, it becomes the non-placement delete. That is the error being reported. The fix is to add member function void operator delete(void*); so that it becomes the non-placement delete, and the existing function returns to being the placement delete matching the placement new. Unfortunately, Studio C++ has a bug where it still emits the warning about non-placement new even after the source code is fixed. I will file a bug report, and add you to the interest list. I recommend making the source code change, and either disabling the warning -erroff=placementdelmatch or not converting warnings to errors on the offending module. ----------
23-08-2016