This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] fold-const.c: Don't handle ASSERT_EXPR. (take2)
- From: Jeffrey A Law <law at redhat dot com>
- To: Kazu Hirata <kazu at cs dot umass dot edu>
- Cc: gcc-patches at gcc dot gnu dot org, dnovillo at redhat dot com
- Date: Tue, 26 Apr 2005 08:48:12 -0600
- Subject: Re: [patch] fold-const.c: Don't handle ASSERT_EXPR. (take2)
- Organization: Red Hat, Inc
- References: <20050426.101821.102579254.kazu@cs.umass.edu>
- Reply-to: law at redhat dot com
On Tue, 2005-04-26 at 10:18 -0400, Kazu Hirata wrote:
> Hi,
>
> Attached is a patch to remove the handling of ASSERT_EXPR from fold
> and abort on ASSERT_EXPR in fold_binary.
>
> First, we never go into the switch statement shown in the patch if
> fold is passed expressions that satisfy IS_EXPR_CODE_CLASS.
> ASSERT_EXPR certainly satisfies IS_EXPR_CODE_CLASS.
>
> Second, AFAICT, VRP never calls fold on ASSERT_EXPR. It does call on
> ASSERT_EXPR_COND, but that's just a tcc_comparison, which fold handles
> fine via fold_binary.
>
> Tested on i686-pc-linux-gnu. OK to apply?
>
> Kazu Hirata
>
> 2005-04-26 Kazu Hirata <kazu@cs.umass.edu>
>
> PR tree-optimization/21047
> * fold-const.c (fold_binary): Abort on ASSERT_EXPR.
> (fold): Don't handle ASSERT_EXPR.
OK.
jeff