Page MenuHomePhabricator

Fix __attribute__((annotate("")) with non-zero globals AS
ClosedPublic

Authored by arichardson on Jul 14 2021, 5:29 AM.

Details

Summary

The existing code attempting to bitcast from a value in the default
globals AS to i8 addrspace(0)* was triggering an assertion failure for me.
I found this while compiling poppler for CHERI-RISC-V (we use AS200 for
all globals). The test case uses AMDGPU since that is one of the in-tree
targets with a non-zero default globals address space.
The new test previously triggered a "Invalid constantexpr bitcast!"
assertion an now correctly generates code with addrspace(1) pointers.

Diff Detail

Event Timeline

arichardson created this revision.Jul 14 2021, 5:29 AM
arichardson requested review of this revision.Jul 14 2021, 5:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 14 2021, 5:29 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
rjmccall accepted this revision.Mon, Aug 23, 8:49 PM

Sorry for the delay; LGTM.

This revision is now accepted and ready to land.Mon, Aug 23, 8:49 PM