RFR: 8309685: Fix -Wconversion warnings in assembler and register code [v3]

Coleen Phillimore coleenp at openjdk.org
Thu Jun 15 16:29:01 UTC 2023


On Thu, 15 Jun 2023 02:07:36 GMT, Dean Long <dlong at openjdk.org> wrote:

>> Changing checked_cast<> to not convert to a signed type for T1 leads to very puzzling compiler errors.  For these emit_int8 etc functions, maybe a straight cast is the best thing, and leaving the definition checked_cast<> alone.  I'd be happy to do that as I had in my first patch.
>
> I don't know what checked_cast<> should do for negative values when going between signed --> unsigned and for values greater than signed max for unsigned --> signed.  It seems like both should fail because the sign changes.

Widening the arguments to the emit functions caused the sign extensions, so ideally, the signed bits should be chopped off, but only really in this case.  Maybe fixing all the call sites might be better in this case.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/14396#discussion_r1231269058


More information about the hotspot-dev mailing list