https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97715

--- Comment #9 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to qinzhao from comment #6)
> (In reply to Jakub Jelinek from comment #3)
> > ;; Floating-point register constraints.
> > (define_register_constraint "f"
> >  "TARGET_80387 || TARGET_FLOAT_RETURNS_IN_80387 ? FLOAT_REGS : NO_REGS"
> >  "Any 80387 floating-point (stack) register.")
> > 
> > So, zero_all_st_registers really should just
> >   if (!TARGET_80387 && !TARGET_FLOAT_RETURNS_IN_80387)
> >     return false;
> > somewhere early.
> 
> I can do this to avoid the ICE. however, the st/mm register set will NOT be
> zeroed under such situation when user requests to zero them with
> -fzero-call-used-regs=all.

True, but we can't do anything about that.  Function has to exit in x87 mode,
even when there are no x87 registers.  That means emms has to be used at the
end of a function, and no %mm can be touched afterwards.

The above proposed solution is correct.

Reply via email to