[Bug middle-end/101294] [12 Regression] ICE: in maybe_legitimize_operand, at optabs.c:7614 with -mavx since r12-1958-gedafb35bdadf309e

hjl.tools at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri Jul 2 14:03:34 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101294

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
This works:

diff --git a/gcc/expr.c b/gcc/expr.c
index 025033c9ecf..bd85bbfdd6f 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -7078,7 +7078,8 @@ store_constructor (tree exp, rtx target, int cleared,
poly_int64 size,
       && eltmode == GET_MODE_INNER (mode)
       && ((icode = optab_handler (vec_duplicate_optab, mode))
      != CODE_FOR_nothing)
-      && (elt = uniform_vector_p (exp)))
+      && (elt = uniform_vector_p (exp))
+      && !VECTOR_TYPE_P (TREE_TYPE (elt)))
     {
       class expand_operand ops[2];
       create_output_operand (&ops[0], target, mode);


More information about the Gcc-bugs mailing list