This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fold ABS_EXPR < 0, pr14303/pr15784
- From: Roger Sayle <roger at eyesopen dot com>
- To: "James A. Morrison" <ja2morri at csclub dot uwaterloo dot ca>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 12 Feb 2005 18:36:19 -0700 (MST)
- Subject: Re: Fold ABS_EXPR < 0, pr14303/pr15784
On 12 Feb 2005, James A. Morrison wrote:
> 2005-02-11 James A. Morrison <phython@gcc.gnu.org>
>
> PR tree-optimization/14303
> PR tree-optimization/15784
> * fold-const.c (fold): Fold ABS_EXPR<x> >= 0 to true, when
> possible.
> Fold ABS_EXPR<x> < 0 to false. Fold ABS_EXPR<x> == 0 to x == 0
> and ABS_EXPR<x> != 0 to x != 0.
This is OK for mainline. As a follow-up patch, you might consider the
use of omit_one_operand to perform these transformations even if x
has side-effects. For example, your third transformation is safe even
if arg0 has side-effects.
Thanks,
Roger
--