------- Comment #7 from rguenth at gcc dot gnu dot org 2010-08-25 17:26 ------- (In reply to comment #6) > The problem is that func_21 is first marked as > TREE_READONLY/DECL_LOOPING_CONST_OR_PURE_P by local_pure_const, thus there are > no vops on it, but afterwards it is by another local_pure_const made > also TREE_THIS_VOLATILE (i.e. noreturn). > flags_from_decl_or_type doesn't set ECF_CONST for const noreturn functions > though for some reason: > 603 /* Process the pure and const attributes. */ > 604 if (TREE_READONLY (exp) && ! TREE_THIS_VOLATILE (exp)) > 605 flags |= ECF_CONST; > 606 if (DECL_PURE_P (exp)) > 607 flags |= ECF_PURE; > (strangely it does set ECF_PURE for pure noreturn calls), which means when > fixup_noreturn_call calls update_stmt to drop lhs from the call, it adds vops > that were missing before and .MEM needs renaming, but the pass in which > fixup_noreturn_call is called doesn't expect that ssa needs updating. > I wonder what is the reason for that " && ! TREE_THIS_VOLATILE (exp)" above.
I'd say remove it - it probably was a measure to avoid DCEing the side-effect or so, before we had proper looping-pure-or-const. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44485