Page MenuHomePhabricator

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

Authored by slavek-kucera on Feb 14 2020, 3:15 AM.

Details

Reviewers
uweigand
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