On Mon, Dec 05, 2016 at 11:25:02AM -0700, Jeff Law wrote: > >> > >>Thanks for the heads up! I just looked at that code yesterday while > >>analyzing bug 78608, wondering if it was safe. Now I know it isn't. > >>I think it might be best to simply hand code the expression instead > >>of taking a chance on abs. Let me take care of it today along with > >>78608. > > > >I posted a bigger patch to fix this and other related problems on > >Friday (https://gcc.gnu.org/ml/gcc-patches/2016-12/msg00262.html). > >In hindsight, I should have probably committed the fix for this > >on its own. Please let me know if this is blocking you and I'll > >commit this fix by itself today so you don't have to wait for > >the bigger patch to get reviewed and approved. > What's the concern with using std::abs?
We already have abs_hwi and absu_hwi where you choose the semantics you want. std::abs might not even have the right overload for HWI. Jakub