PR c++/23337
* gimplify.c (gimplify_init_ctor_eval): If we see an element of
vector type, don't try to construct it element by element. Add an
assertion that we use a FIELD_DECL when building a COMPONENT_REF.
testsuite/
PR c++/23337
* g++.dg/ext/vector2.C: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103177
138bc75d-0d04-0410-961f-
82ee72b054a4
+2005-08-16 Ian Lance Taylor <ian@airs.com>
+
+ PR c++/23337
+ * gimplify.c (gimplify_init_ctor_eval): If we see an element of
+ vector type, don't try to construct it element by element. Add an
+ assertion that we use a FIELD_DECL when building a COMPONENT_REF.
+
2005-08-16 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
* fold-const.c (fold_ternary): Simplify folding of a CALL_EXPR.
purpose, NULL_TREE, NULL_TREE);
}
else
- cref = build (COMPONENT_REF, TREE_TYPE (purpose),
- unshare_expr (object), purpose, NULL_TREE);
+ {
+ gcc_assert (TREE_CODE (purpose) == FIELD_DECL);
+ cref = build (COMPONENT_REF, TREE_TYPE (purpose),
+ unshare_expr (object), purpose, NULL_TREE);
+ }
- if (TREE_CODE (value) == CONSTRUCTOR)
+ if (TREE_CODE (value) == CONSTRUCTOR
+ && TREE_CODE (TREE_TYPE (value)) != VECTOR_TYPE)
gimplify_init_ctor_eval (cref, CONSTRUCTOR_ELTS (value),
pre_p, cleared);
else
+2005-08-16 Ian Lance Taylor <ian@airs.com>
+
+ PR c++/23337
+ * g++.dg/ext/vector2.C: New.
+
2005-08-16 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/23428
--- /dev/null
+// PR c++/23337; caused an ICE in component_ref_field_offset
+// { dg-options "" }
+// { dg-options "-mmmx" { target { i?86-*-* && ilp32 } } } */
+// { dg-options "-mmmx" { target { x86_64-*-* && ilp32 } } } */
+typedef int vec __attribute__ ((vector_size (8)));
+extern int bar (vec);
+int
+foo (int i)
+{
+ vec a[] = { (vec) { 0, i }, (vec) { 4, 5 } };
+ return bar (a[0]) + bar (a[1]);
+}