[Bug tree-optimization/126727] smax(a-b,b-a) -> abs(a-b)

"krahul.gcc at gmail dot com via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126727

krahul.gcc at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |krahul.gcc at gmail dot com

--- Comment #1 from krahul.gcc at gmail dot com ---
(In reply to Drea Pinski from comment #0)
> Take:
> ```
> 
> int __GIMPLE (ssa)
> f2 (int a, int b)
> {
>   int t;
>   int _3;
> 
>   __BB(2):
>   t_2 = a_1(D) - b_5(D);
>   t_4 = b_5(D) - a_1(D);
>   _3 = __MAX (t_2, t_4);
>   return _3;
> }
> ```
> 
> This is not optimized to ABS(t_2)

Not valid with -frounding-math. This looks like a trivial missed optimization.
Can I take it up ?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.