[Bug tree-optimization/112659] missed-optimization: if (exp) return exp; else return 0;

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Nov 21 22:16:17 GMT 2023


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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #1)
> So maybe
> ```
> (simplify
>  (cond (eq @0 INTEGER_CST@1) zero_p (plus@3 @0 INTEGER_CST@2))
>  @3
> )
> ```

Whoops I forgot the check `wi::to_wide(@1) == -wi::to_wide(@2)` there :).


More information about the Gcc-bugs mailing list