On Mon, 1 Aug 2016, Joseph Myers wrote: > On Mon, 1 Aug 2016, Richard Biener wrote: > > > I don't think so - the pattern is as much a canonicalization as an > > optimization. If the target cannot expand copysign then the > > middle-end expander should try an alternative like the a / abs(x) > > form. Though if copysign cannot be open-coded then I don't see > > how abs can be opencoded (which basically is copysign (1.0, x)). > > It's expanded incorrectly in those cases (see bug 29253).
Heh, looks like I worked on this 8 years ago... Fixing the copysign expansion issue should be as easy as making sure expand_copysign_absneg is not used if the mode has signed zeros. Richard.