https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95126
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |needs-bisection
Severity|normal |enhancement
Summary|Missed opportunity to turn |[9/10/11/12 Regression]
|static variables into |Missed opportunity to turn
|immediates |static variables into
| |immediates
Target Milestone|--- |9.5
Known to work| |5.1.0
Known to fail| |5.2.0
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Hmm, in GCC 5.1.0 (and before) we used to produce:
mov rdi, QWORD PTR s.1839[rip]
jmp func
In GCC 5.2.0 and above GCC produces:
movzx edi, WORD PTR s.1839[rip+2]
movzx edx, WORD PTR s.1839[rip]
sal rdi, 16
mov rax, rdi
movzx edi, WORD PTR s.1839[rip+4]
or rax, rdx
sal rdi, 32
or rdi, rax
jmp func
In both cases, the expander sees:
<bb 2>:
func (s); [tail call]
return;
But the expander goes bad.
So this has to be a patch which was backported to the GCC 5 branch which caused
to produce even worse code.