This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] fix PR34005 - ICE due to rhs cond_expr (gimplifier patch)


Dorit Nuzman wrote:

        PR tree-optimization/34005
        * tree-gimple.c (is_gimple_formal_tmp_rhs): Add a case for
COND_EXPR.
        * gimplify.c (gimplify_ctx): Add a new member allow_rhs_cond_expr.
        (gimplify_pure_cond_expr): New function.
        (expression_without_side_effects_p): New function.
        (gimplify_cond_expr): Call implify_pure_cond_expr.
gimplify_pure_cond_expr

+ static bool
+ expression_without_side_effects_p (tree expr)

Hmm, why isn't TREE_SIDE_EFFECTS sufficient?


+       if (gimplify_ctxp->allow_rhs_cond_expr
+           && !TREE_SIDE_EFFECTS (*expr_p)
+           && expression_without_side_effects_p (*expr_p))

Which may mean calling recalculate_side_effects() here.



Diego.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]