https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68986
--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
And I bet the bug is exactly in the:
/* preferred_stack_boundary is never updated for call
9499 expanded from tls descriptor. Update it here. We don't
update it in
9500 expand stage because according to the comments before
9501 ix86_current_function_calls_tls_descriptor, tls calls may
be optimized
9502 away. */
9503 else if (ix86_current_function_calls_tls_descriptor
9504 && crtl->preferred_stack_boundary <
PREFERRED_STACK_BOUNDARY)
9505 {
9506 crtl->preferred_stack_boundary =
PREFERRED_STACK_BOUNDARY;
9507 if (crtl->stack_alignment_needed <
PREFERRED_STACK_BOUNDARY)
9508 crtl->stack_alignment_needed =
PREFERRED_STACK_BOUNDARY;
9509 }
being performed too late, I believe the drap register is created during
expansion and not later on. Perhaps one could postpone that until some pass
shortly before IRA, but not further.