------- Comment #30 from rguenther at suse dot de  2009-04-16 08:06 -------
Subject: Re:  [4.5 regression] Revision 145338 breaks
 ability to build Ada

On Thu, 16 Apr 2009, ebotcazou at gcc dot gnu dot org wrote:

> ------- Comment #29 from ebotcazou at gcc dot gnu dot org  2009-04-16 07:57 
> -------
> Richard,
> 
> the removal of
> 
>   /* If the RHS of the MODIFY_EXPR may throw or make a nonlocal goto
>      and the LHS is a user variable, then we need to introduce a formal
>      temporary.  This way the optimizers can determine that the user
>      variable is only modified if evaluation of the RHS does not throw.  */
> 
> from is_gimple_reg_or_call_rhs breaks __builtin_setjmp / __builtin_longjmp 
> (and
> probably nonlocal gotos).

Do you happen to have a testcase?  I compensated for the loss of the above
during EH lowering when we split blocks at these points.  Note the comment
continued as

-     Don't force a temp of a non-renamable type; the copy could be
-     arbitrarily expensive.  Instead we will generate a VDEF for
-     the assignment.  */

and the check itself applied as

-      && ((TREE_CODE (t) == CALL_EXPR && TREE_SIDE_EFFECTS (t))
-         || tree_could_throw_p (t)))

thus all non-pure/const calls would get the extra copy.

The intent of the patch was to make the gimple predicates valid after
gimplification (and not only during it), so the fix should be applied
during CFG creation or lowering.

Thanks,
Richard.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39625

Reply via email to