]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/internal-fn.c
middle-end/103038 - avoid ICE with -ftrivial-auto-var-init=pattern
[thirdparty/gcc.git] / gcc / internal-fn.c
index 9e10da0ad5ccc8d4873e157d2fc8e3fbeac4bf74..fd6cb0995d9cbe74a2676acbce5e4cb068d40021 100644 (file)
@@ -3090,8 +3090,12 @@ expand_DEFERRED_INIT (internal_fn, gcall *stmt)
                             (total_bytes * BITS_PER_UNIT, 1);
              wide_int w = wi::from_buffer (buf, total_bytes);
              init = wide_int_to_tree (itype, w);
-             /* Pun the LHS to make sure its type has constant size.  */
-             lhs = build1 (VIEW_CONVERT_EXPR, itype, lhs);
+             /* Pun the LHS to make sure its type has constant size
+                unless it is an SSA name where that's already known.  */
+             if (TREE_CODE (lhs) != SSA_NAME)
+               lhs = build1 (VIEW_CONVERT_EXPR, itype, lhs);
+             else
+               init = build1 (VIEW_CONVERT_EXPR, TREE_TYPE (lhs), init);
            }
        }
       else