JDK-8258010 : Debug build failure with clang-10 due to -Wdeprecated-copy
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 16,17
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2020-12-10
  • Updated: 2021-01-21
  • Resolved: 2021-01-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 17
17 b06Fixed
Related Reports
Relates :  
Relates :  
Description
Tools summary:
* Boot JDK:       openjdk version "16-internal" 2021-03-16 OpenJDK Runtime Environment (build 16-internal+0-git-3820998e2) OpenJDK 64-Bit Server VM (build 16-internal+0-git-3820998e2, mixed mode, sharing)  (at /mnt/share/openjdk/packages/boot-jdk/aarch64/latest.old)
* Toolchain:      clang (clang/LLVM)
* C Compiler:     Version 10.0.0 (at /usr/bin/clang)
* C++ Compiler:   Version 10.0.0 (at /usr/bin/clang++)



ERROR: Build failed for target 'images' in configuration '/home/eriliu02/entllt/openjdk/clang-fastdebug' (exit code 2)
Stopping sjavac server=== Output from failing command(s) repeated here ===
* For target hotspot_variant-server_libjvm_gtest_objs_test_mathexact.o:
In file included from /home/eriliu02/entllt/openjdk/jdk_src/test/hotspot/gtest/opto/test_mathexact.cpp:26:
In file included from /home/eriliu02/entllt/openjdk/jdk_src/src/hotspot/share/opto/mulnode.hpp:28:
/home/eriliu02/entllt/openjdk/jdk_src/src/hotspot/share/opto/node.hpp:1371:8: error: definition of implicit copy constructor for 'DUIterator_Fast' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
  void operator=(const DUIterator_Fast& that)
       ^
/home/eriliu02/entllt/openjdk/jdk_src/src/hotspot/share/opto/node.hpp:1379:10: note: in implicit copy constructor for 'DUIterator_Fast' first required here
  return DUIterator_Fast(this, 0);
         ^
/home/eriliu02/entllt/openjdk/jdk_src/src/hotspot/share/opto/node.hpp:1428:8: error: definition of implicit copy constructor for 'DUIterator_Last' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
  void operator=(const DUIterator_Last& that)
       ^
/home/eriliu02/entllt/openjdk/jdk_src/src/hotspot/share/opto/node.hpp:1436:10: note: in implicit copy constructor for 'DUIterator_Last' first required here
  return DUIterator_Last(this, (ptrdiff_t)_outcnt - 1);
         ^
2 errors generated.* All command lines available in /home/eriliu02/entllt/openjdk/clang-fastdebug/make-support/failure-logs.
=== End of repeated output ===




After suppressing the Wdeprecated-copy warining, another error occurs.

* For target hotspot_variant-server_libjvm_objs_threadHeapSampler.o:
/home/haosun01/tmp/build-err/jdk_src/src/hotspot/share/runtime/threadHeapSampler.cpp:397:33: error: implicit conversion from 'unsigned long' to 'double' changes value from 18446744073709551615 to 18446744073709551616 [-Werror,-Wimplicit-int-float-conversion]
  assert(result > 0 && result < SIZE_MAX, "Result is not in an acceptable range.");
                              ~ ^~~~~~~~
/usr/include/stdint.h:227:22: note: expanded from macro 'SIZE_MAX'
#  define SIZE_MAX              (18446744073709551615UL)
                                 ^~~~~~~~~~~~~~~~~~~~~~
 

-Wimplicit-int-float-conversion was first introduced in clang 10. 

See the flags in clang 9 [1] and clang 10 [2].

[1] https://releases.llvm.org/9.0.0/tools/clang/docs/DiagnosticsReference.html

[2]  https://releases.llvm.org/10.0.0/tools/clang/docs/DiagnosticsReference.html
Comments
Changeset: 5513f989 Author: Hao Sun <hao.sun@arm.com> Committer: Ningsheng Jian <njian@openjdk.org> Date: 2021-01-14 04:11:20 +0000 URL: https://git.openjdk.java.net/jdk/commit/5513f989
14-01-2021

ILW = Build failures, with clang and non-default build config, disable corresponding build flags = HLL = P4
17-12-2020