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

Igor Shevlyakov <ishevlyakov at gcc dot gnu.org> changed:

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

--- Comment #2 from Igor Shevlyakov <ishevlyakov at gcc dot gnu.org> ---
Confirmed, mine.  This is a pre-existing problem in the i386 abs/neg
patterns that r17-6672 uncovered.

r17-6672 made ix86_expand_copysign emit copysign (x, -1.0) directly as
*nabs<mode>2_1, {r100 = -abs (x); use SIGNMASK}.  The outer negation is
{r104 = -r100; use SIGNMASK}, and combine simplifies the two to
{r104 = abs (x); use SIGNMASK}.  That matches *abs<mode>2_1, whose splitter
ANDs with the mask operand, which is now the sign mask rather than its
complement.

The same RTL written with the GIMPLE FE (t1 = __ABS x; t2 = -t1; t3 = -t2;
starting at expand) gives "andps <sign mask>" and aborts with GCC 15 and 16
too.  In C the tree passes fold -(-fabs (x)), so the problem stayed hidden
until r17-6672 made it reachable through copysign.

I'm working on a fix in the abs/neg patterns so that they no longer depend
on the mask operand that combine keeps.

Reply via email to