Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8311847

Fix -Wconversion for assembler.hpp emit_int8,16 callers

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 22
    • 22
    • hotspot
    • b08


      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);
            | ~~~~~~^~~~~~~~~

            coleenp Coleen Phillimore
            coleenp Coleen Phillimore
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: