JDK-8311847 : Fix -Wconversion for assembler.hpp emit_int8,16 callers
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 22
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-07-11
  • Updated: 2023-07-25
  • Resolved: 2023-07-24
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 22
22 masterFixed
Related Reports
Relates :  
Description
assmbler_x86.hpp has 940 -Wconversion warnings for functions that pass int to emit_int8() that takes a uint8_t.  Some callers also have sign extension which make it look out of range when it isn't really.

Sample:
src/hotspot/cpu/x86/assembler_x86.cpp: In member function 'void Assembler::rorxl(Register, Address, int)':
src/hotspot/cpu/x86/assembler_x86.cpp:13779:13: warning: conversion from 'int' to 'uint8_t' {aka 'unsigned char'} may change value [-Wconversion]
13779 |   emit_int8(imm8);
      |             ^~~~
src/hotspot/cpu/x86/assembler_x86.cpp: In member function 'void Assembler::rorxq(Register, Register, int)':
src/hotspot/cpu/x86/assembler_x86.cpp:13786:41: warning: conversion from 'int' to 'uint8_t' {aka 'unsigned char'} may change value [-Wconversion]
13786 |   emit_int24((unsigned char)0xF0, (0xC0 | encode), imm8);
      |                                   ~~~~~~^~~~~~~~~

Comments
Changeset: 7dd47998 Author: Coleen Phillimore <coleenp@openjdk.org> Date: 2023-07-24 12:09:27 +0000 URL: https://git.openjdk.org/jdk/commit/7dd47998f00712515c25fb852b6c0cf958120508
24-07-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/14822 Date: 2023-07-11 01:26:44 +0000
11-07-2023