RE: [match.pd PATCH] PR tree-optimization/126467: 0.0-x -> -x vs. signed zeros.
"Roger Sayle" <[email protected]>
| Newsgroups | gmane.comp.gcc.patches |
|---|---|
| Message-ID | <[email protected]> |
> From: Alexander Monakov <[email protected]> > Sent: 07 August 2026 08:45 > On Wed, 5 Aug 2026, Roger Sayle wrote: > > > gcc/testsuite/ChangeLog > > PR tree-optimization/126467 > > * gcc.dg/pr126467-1.c: New test case. > > * gcc.dg/pr126467-2.c: Likewise. > > * gcc.dg/pr96392.c: Fix incorrect test case. > > Sorry, what is incorrect in this testcase? x is an int there: > > -double negate(int x) > -{ > - return 0.0 - x; > -} Hi Alexander, Yes, x is an int, so when promoted to double (because of the 0.0) it becomes +0.0, and as described +0.0 - +0.0 is not the same as -(double)0. Interestingly, I ran "git blame" to figure out which misguided fool wrote this test case... It turns out it was me. Live and learn. Short answer, this test case now fails with this (any) fix for PR tree-optimization/126467. Thanks for your help/feedback. Roger --