This is an archive of the discontinued LLVM Phabricator instance.

SystemZ target - Incorrect code generated for accessing thread_local variables when high-word feature is enabled
AbandonedPublic

Authored by uweigand on Feb 14 2020, 3:15 AM.

Details

Reviewers
slavek-kucera
Summary

I came across a bug in the generated code for SystemZ target when accessing thread_local variables in functions that have 7 or more parameters.

The problem can be seen here
https://godbolt.org/z/v77J_p

while extracting the values from AR0 and AR1

ear     %r0, %a0                 ; copy AR0 to GR0L
risblg  %r14, %r0, 0, 159, 32    <<<<<<<< copy GR0H to GR14L
sllg    %r14, %r14, 32
ear     %r0, %a1              
risblg  %r14, %r0, 0, 159, 32    <<<<<<<< the same issue here

the compiler thinks there is an option to copy the content of access registers into high half of the general purpose register, which is not available on the platform.

Bug report: https://bugs.llvm.org/show_bug.cgi?id=44254

Diff Detail

Event Timeline

slavek-kucera created this revision.Feb 14 2020, 3:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 14 2020, 3:16 AM
jonpa added a subscriber: jonpa.Feb 27 2020, 12:31 PM

Patch suggested at https://reviews.llvm.org/D75014 with a different approach.

This was actually fixed in a different way here: https://reviews.llvm.org/D75014
I'm closing this review now.

uweigand commandeered this revision.Jul 7 2020, 5:27 AM
uweigand abandoned this revision.
uweigand edited reviewers, added: slavek-kucera; removed: uweigand.