gimplify: prevent some C++ temporary elision
In this testcase, we were optimizing away the temporary for f(), but
C++17 and above are clear that there is a temporary, and because its
destructor has visible side-effects we can't optimize it away under the
as-if rule. So disable this optimization for TREE_ADDRESSABLE type.
I moved the declaration of volatile_p after the call to
gimple_fold_indirect_ref_rhs to minimize indentation changes; I don't see
any way the value of that flag could be affected by the call.
gcc/ChangeLog:
* gimplify.cc (gimplify_modify_expr_rhs): Don't optimize
x = *(A*)&<expr> to x = <expr> for a TREE_ADDRESSABLE type.
gcc/testsuite/ChangeLog:
* g++.dg/init/elide9.C: New test.