This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: fold-const patch for PR41442
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Bernd Schmidt <bernds at codesourcery dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 24 Apr 2010 20:34:37 +0200
- Subject: Re: fold-const patch for PR41442
- References: <4BD32CDA.8080608@codesourcery.com>
On Sat, Apr 24, 2010 at 7:39 PM, Bernd Schmidt <bernds@codesourcery.com> wrote:
> This implements the folding requested in PR41442, i.e.:
>
> ?if ((p1->next && !p2->next) || p2->next)
>
> to
>
> ?if (p1->next || p2->next)
>
> Bootstrapped and regression tested on i686-linux. ?Ok?
+ if (TREE_SIDE_EFFECTS (op) || TREE_SIDE_EFFECTS (cmpop))
+ return 0;
+
+ if (TREE_CODE_CLASS (code) != tcc_comparison)
+ return 0;
use NULL_TREE.
Ok with that change.
Thanks,
Richard.
>
> Bernd
>