@@ -4559,7 +4559,7 @@ gimplify_modify_expr (tree *expr_p, gimp
/* Try to alleviate the effects of the gimplification creating artificial
temporaries (see for example is_gimple_reg_rhs) on the debug info. */
if (!gimplify_ctxp->into_ssa
- && DECL_P (*from_p)
+ && TREE_CODE (*from_p) == VAR_DECL
&& DECL_IGNORED_P (*from_p)
&& DECL_P (*to_p)
&& !DECL_IGNORED_P (*to_p))
@@ -0,0 +1,16 @@
+// PR c++/44808
+// { dg-do compile }
+
+struct S
+{
+ void *a, *b;
+ int c;
+};
+
+S
+foo ()
+{
+ S x;
+ S y = x;
+ return x;
+}