public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Ping: PR tree-opt/33615 [1/2] Hoisting of throwing expression for -fnon-call-exceptions
@ 2007-10-07 18:50 Richard Sandiford
  2007-10-08  0:48 ` Zdenek Dvorak
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Sandiford @ 2007-10-07 18:50 UTC (permalink / raw)
  To: gcc-patches

http://gcc.gnu.org/ml/gcc-patches/2007-10/msg00085.html

This didn't draw any comment from maintainers.  Andrew commented that it
might be a good idea to set TREE_SIDE_EFFECTS for things that can throw,
but I don't know whether that'd be easier to maintain than the new
(function) predicate suggested in the covering patch.  Either way,
I hope the patch as-is is strict progress.

Dan approved part 2 (thanks), but I thought I'd better wait on part 1
before checking it in.

Richard

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Ping: PR tree-opt/33615 [1/2] Hoisting of throwing expression for -fnon-call-exceptions
  2007-10-07 18:50 Ping: PR tree-opt/33615 [1/2] Hoisting of throwing expression for -fnon-call-exceptions Richard Sandiford
@ 2007-10-08  0:48 ` Zdenek Dvorak
  0 siblings, 0 replies; 2+ messages in thread
From: Zdenek Dvorak @ 2007-10-08  0:48 UTC (permalink / raw)
  To: Richard Sandiford; +Cc: gcc-patches

Hello,

> http://gcc.gnu.org/ml/gcc-patches/2007-10/msg00085.html
> 
> This didn't draw any comment from maintainers.  Andrew commented that it
> might be a good idea to set TREE_SIDE_EFFECTS for things that can throw,
> but I don't know whether that'd be easier to maintain than the new
> (function) predicate suggested in the covering patch.  Either way,
> I hope the patch as-is is strict progress.

the patch is OK, but see the notes below.

> 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;
>  
>    if (TREE_CODE (lhs) != SSA_NAME

The check for

  if (stmt_ends_bb_p (stmt))
    return MOVE_IMPOSSIBLE;

was supposed to prevent this optimization for expressions throwing
exceptions.  However, we do not create edges to exit for exceptions that
are not caught locally; which seems somewhat wrong, certainly this
can cause problems also for other code hoisting optimizations.

Zdenek

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-10-08  0:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-07 18:50 Ping: PR tree-opt/33615 [1/2] Hoisting of throwing expression for -fnon-call-exceptions Richard Sandiford
2007-10-08  0:48 ` Zdenek Dvorak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).