[Bug tree-optimization/126465] [16/17 Regression] Wrong code with IFN_COND_FMA folding on SVE

"tnfchris at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126465

Tamar Christina <tnfchris at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |tnfchris at gcc dot gnu.org

--- Comment #6 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
(In reply to ktkachov from comment #5)
> (In reply to ktkachov from comment #4)
> > (In reply to Drea Pinski from comment #1)
> > > r16-6508-g772b847d99d5e3 .
> > > 
> > > 
> > >   (simplify
> > >    (negate (fmas@3 @4 @0 @1 @2 @5))
> > >    (if (!HONOR_SIGN_DEPENDENT_ROUNDING (type) && single_use (@3))
> > >     (IFN_COND_FNMS @4 @0 @1 @2 @5))))
> > > 
> > > 
> > > The negate also applies to the other non-fma part while afterwards it does
> > > not.
> > > 
> > >  (simplify
> > >   (negate (IFN_FMS@3 @4 @0 @1 @2 @5))
> > >    (if (!HONOR_SIGN_DEPENDENT_ROUNDING (type) && single_use (@3))
> > >     (IFN_COND_FNMA @4 @0 @1 @2 @5)))
> > > 
> > 
> > More worryingly, why is IFN_FMS taking 4 here when it is a ternary IFN and
> > how come genmatch didn't catch it?
> 
> "taking 4 operands" I meant to say

yes, already part of my patch. genmatch doesn't know the number of operands.
expand would just ICE when used.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.