This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR tree-opt/33615 [1/2] Hoisting of throwing expression for -fnon-call-exceptions
- From: "Andrew Pinski" <pinskia at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org, rsandifo at nildram dot co dot uk
- Date: Mon, 1 Oct 2007 15:55:33 -0700
- Subject: Re: PR tree-opt/33615 [1/2] Hoisting of throwing expression for -fnon-call-exceptions
- References: <87d4vye9rq.fsf@firetop.home>
On 10/1/07, Richard Sandiford <rsandifo@nildram.co.uk> wrote:
> Index: gcc/tree-ssa-loop-im.c
> ===================================================================
> --- gcc/tree-ssa-loop-im.c 2007-10-01 23:23:16.000000000 +0100
> +++ gcc/tree-ssa-loop-im.c 2007-10-01 23:39:36.000000000 +0100
> @@ -260,7 +260,8 @@ movement_possibility (tree stmt)
>
> rhs = GIMPLE_STMT_OPERAND (stmt, 1);
>
> - if (TREE_SIDE_EFFECTS (rhs))
> + if (TREE_SIDE_EFFECTS (rhs)
> + || tree_could_throw_p (rhs))
> return MOVE_IMPOSSIBLE;
Shouldn't TREE_SIDE_EFFECTS be set if the right hand side can throw?
We had the same issue for DCE removing throwable statements for the
same reason.
See http://gcc.gnu.org/ml/gcc-patches/2005-06/msg00419.html
Thanks,
Andrew Pinski