In this PR, IPA-CP was misled into using NOP_EXPR rather than
VIEW_CONVERT_EXPR to reinterpret a vector of 4 shorts as a vector
of 2 ints. This tripped the tree-cfg.c assert I'd added in r278245.
2019-12-02 Richard Sandiford <richard.sandiford@arm.com>
gcc/
PR middle-end/92741
* fold-const.c (fold_convertible_p): Check vector types more
thoroughly.
gcc/testsuite/
PR middle-end/92741
* gcc.dg/pr92741.c: New test.
From-SVN: r278910
2019-12-02 Richard Sandiford <richard.sandiford@arm.com>
+ PR middle-end/92741
+ * fold-const.c (fold_convertible_p): Check vector types more
+ thoroughly.
+
+2019-12-02 Richard Sandiford <richard.sandiford@arm.com>
+
* config/aarch64/aarch64.c (aarch64_report_sve_required): New function.
(aarch64_expand_mov_immediate): Use it when attempting to measure
the length of an SVE vector.
case REAL_TYPE:
case FIXED_POINT_TYPE:
- case VECTOR_TYPE:
case VOID_TYPE:
return TREE_CODE (type) == TREE_CODE (orig);
+ case VECTOR_TYPE:
+ return (VECTOR_TYPE_P (orig)
+ && known_eq (TYPE_VECTOR_SUBPARTS (type),
+ TYPE_VECTOR_SUBPARTS (orig))
+ && fold_convertible_p (TREE_TYPE (type), TREE_TYPE (orig)));
+
default:
return false;
}
2019-12-02 Richard Sandiford <richard.sandiford@arm.com>
+ PR middle-end/92741
+ * gcc.dg/pr92741.c: New test.
+
+2019-12-02 Richard Sandiford <richard.sandiford@arm.com>
+
* gcc.target/aarch64/sve/acle/general/nosve_4.c: New test.
* gcc.target/aarch64/sve/acle/general/nosve_5.c: Likewise.
* gcc.target/aarch64/sve/pcs/nosve_4.c: Expected a second error
--- /dev/null
+/* { dg-options "-O2 -fexceptions -fnon-call-exceptions -fno-inline" } */
+
+typedef int vh __attribute__ ((__vector_size__ (2 * sizeof (int))));
+typedef short int cq __attribute__ ((__vector_size__ (4 * sizeof (short int))));
+
+static void
+id (int *r8, vh *tu)
+{
+ *(vh *) r8 = *tu;
+}
+
+void
+mr (void)
+{
+ int r8;
+ cq he = { 0, };
+
+ id (&r8, (vh *) &he);
+}