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

Inconsistent types for ideal_reg

    Details

    • Subcomponent:
    • Resolved In Build:
      b21
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        There is an inconsistency about whether register categories used with Node and those used with Type are signed.

        - The Node class defines "uint Node::ideal_reg()" and "uint Node::NotAMachineReg" is a special value which "must be > max. machine register".

        - The Type class has "int ideal_reg()" which deals in the same values.

        This mostly results in some implicit potentially narrowing conversions in various places, due to the chosen value of NotAMachineReg. However, the initialization of the Type::_type_info array includes some having their ideal_reg member initialized to NotAMachineReg. Such implicit narrowings are forbidden by C++11.

        The invalid narrowings could be worked around via casts. But that's building in assumptions about the value of NotAMachineReg. And it seems like it might be better to remove the inconsistency, if possible.

        [This is a followup to JDK-8160353.]

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  kbarrett Kim Barrett
                  Reporter:
                  kbarrett Kim Barrett
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: