This is an archive of the discontinued LLVM Phabricator instance.

[ADT] APFloatBase: Prevent collapsing semPPCDoubleDouble and semBogus
ClosedPublic

Authored by mgorny on Dec 25 2016, 2:49 PM.

Details

Summary

Provide a distinct contents for semBogus and semPPCDoubleDouble in order
to prevent compilers from collapsing them to a single memory address,
while we heavily rely on every semantic having distinct address.

This happens if insecure optimization collapsing identical values is
enabled. As a result, APFloats of semBogus are indistinguishable from
semPPCDoubleDouble -- and whenever the move constructor is used, the old
value beings being incorrectly recognized as a semPPCDoubleDouble.

Since the values in semPPCDoubleDouble are not used anywhere,
we can easily solve this issue via altering the value of one of the
fields and therefore ensuring that the collapse can not occur.

Diff Detail

Event Timeline

mgorny updated this revision to Diff 82483.Dec 25 2016, 2:49 PM
mgorny retitled this revision from to [ADT] APFloatBase: Prevent collapsing semPPCDoubleDouble and semBogus.
mgorny updated this object.
mgorny added reviewers: timshen, sberg.
mgorny added a subscriber: llvm-commits.
timshen accepted this revision.Jan 2 2017, 5:00 PM
timshen edited edge metadata.
This revision is now accepted and ready to land.Jan 2 2017, 5:00 PM
This revision was automatically updated to reflect the committed changes.