https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98778
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|inline-asm |target --- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- else if (!SYMBOL_REF_FAR_ADDR_P (op0) && (SYMBOL_REF_LOCAL_P (op0) || (HAVE_LD_PIE_COPYRELOC && flag_pie && !SYMBOL_REF_WEAK (op0) && !SYMBOL_REF_FUNCTION_P (op0))) && ix86_cmodel != CM_LARGE_PIC) return true; Is why it is accepted. inside legitimate_pic_address_disp_p. SYMBOL_REF_LOCAL_P is true as it is defined in the TU for PIE case.