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

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Aldy Hernandez from comment #4)
> (In reply to Aldy Hernandez from comment #3)
> > We are failing while trying to fold:
> > 
> > c_92 = __builtin_copysignf128 (0.0, c_80(D));
> > 
> > The problem is that c_92 is TFtype but 0.0 is _Float128.  TFtype has a
> > precision of 127 whereas _Float128 has a precision of 128.  This causes the
> > assert in fold_using_range::fold_stmt to fail because range_compatible_p is
> > false.
> > 
> > Are both operands of copysign allowed to have different types / precisions?
> 
> Sorry, what I meant to say is that c_92 is TFtype, whereas
> __builtin_copysignf128 is assuming to return the type of the first operand
> (0.0, which is _Float128).  Is this correct?

It looks like 0.0 has the wrong type here.  Maybe the copysign is the
result of folding that left us with unconverted 0.0 here?

Reduced preprocessed source would be nice, but you can see if
-fdump-tree-all-folding shows a bogus match.pd pattern (but the issue might be
in fold-const.cc as well).

Reply via email to