Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix check for whether wide relocation offsets are needed on Power #3567

Merged
merged 1 commit into from
Feb 14, 2019

Conversation

aviansie-ben
Copy link
Contributor

Previously, there was special-case code in the collectModifier method on
TR::ExternalRelocation which was trying to handle relocations whose
targets were actually the address of the TR::Instruction rather than the
binary-encoded instruction. However, this is now being handled by
TR::BeforeBinaryEncodingExternalRelocation overriding the
getUpdateLocation method. As a result, this check was calculating the
wrong update location. The apply method was using the correct update
location and thus only calculation of whether wide offsets were needed
was affected by this problem.

This issue went unnoticed for a considerable length of time since the
pseudo-random nature of the incorrect update location would almost
always result in wide offsets being used. Using wide offsets when not
needed is unnecessary, but does not cause any correctness issues.

Signed-off-by: Ben Thomas ben@benthomas.ca

Previously, there was special-case code in the collectModifier method on
TR::ExternalRelocation which was trying to handle relocations whose
targets were actually the address of the TR::Instruction rather than the
binary-encoded instruction. However, this is now being handled by
TR::BeforeBinaryEncodingExternalRelocation overriding the
getUpdateLocation method. As a result, this check was calculating the
wrong update location. The apply method was using the correct update
location and thus only calculation of whether wide offsets were needed
was affected by this problem.

This issue went unnoticed for a considerable length of time since the
pseudo-random nature of the incorrect update location would almost
always result in wide offsets being used. Using wide offsets when not
needed is unnecessary, but does not cause any correctness issues.

Signed-off-by: Ben Thomas <ben@benthomas.ca>
@fjeremic
Copy link
Contributor

fjeremic commented Feb 13, 2019

The apply method was using the correct update
location and thus only calculation of whether wide offsets were needed
was affected by this problem.

This issue went unnoticed for a considerable length of time since the
pseudo-random nature of the incorrect update location would almost
always result in wide offsets being used. Using wide offsets when not
needed is unnecessary, but does not cause any correctness issues.

FYI in case you've never come across it. The JIT has a TR_Randomize option which you can use to generate random numbers and force certain "rarely taken" paths to be taken. This can provoke these types of issues by putting in randomgen code to randomly use wide offsets. See #3568 for a recent example.

@0xdaryl
Copy link
Contributor

0xdaryl commented Feb 14, 2019

@genie-omr build all

@0xdaryl 0xdaryl self-assigned this Feb 14, 2019
@0xdaryl 0xdaryl merged commit f9a06b0 into eclipse-omr:master Feb 14, 2019
@aviansie-ben aviansie-ben deleted the power-aot-wide-offsets branch February 15, 2019 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants