In g:
3c32575e5b6370270d38a80a7fa8eaa144e083d0 I made a mistake and incorrectly
replaced the type of the arguments of an expression with the type of the
expression. This is of course wrong.
This reverts that change and I have also double checked the other replacements
and they are fine.
gcc/ChangeLog:
PR middle-end/118472
* fold-const.cc (operand_compare::operand_equal_p): Fix incorrect
replacement.
gcc/testsuite/ChangeLog:
PR middle-end/118472
* gcc.dg/pr118472.c: New test.
of op1. Need to check to make sure they are the same. */
if (TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST
&& TREE_CODE (TREE_OPERAND (arg1, 1)) == INTEGER_CST
- && TYPE_PRECISION (type0) != TYPE_PRECISION (type1))
+ && TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (arg0, 1)))
+ != TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (arg1, 1))))
return false;
/* FALLTHRU */
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O3 -fopenmp-simd" } */
+
+typedef int a;
+typedef struct {
+ a b __attribute__((__vector_size__(8)));
+} c;
+
+typedef a d __attribute__((__vector_size__(8)));
+c e, f, g;
+d h, j;
+void k() {
+ c l;
+ l.b[1] = 0;
+ c m = l;
+ __builtin_memcpy(&h, &m, sizeof(h));
+ j = h;
+ {
+ c l;
+ l.b[1] = 0;
+ m = l;
+ __builtin_memcpy(&h, &m, sizeof(h));
+ d m = j;
+ __builtin_memcpy(&g, &m, sizeof(g));
+ e = g;
+ m = h;
+ __builtin_memcpy(&g, &m, sizeof(g));
+#pragma omp simd
+ for (long i = 0; i < f.b[0]; i++)
+ f.b[i] = e.b[i] > g.b[i];
+ }
+}