Hi All,
I believe PR101750 to be a testism. The reduced case accesses h[0] but h is
uninitialized and so the changes added in r12-2523 makes the compiler realize
this and replaces the code with a trap.
This fixes the case by just making the variable static.
regtested on aarch64-none-linux-gnu and no issues.
Ok for master?
Thanks,
Tamar
gcc/testsuite/ChangeLog:
PR tree-optimization/101750
* g++.dg/vect/pr99149.cc: Fix access of h.
--- inline copy of patch --
diff --git a/gcc/testsuite/g++.dg/vect/pr99149.cc
b/gcc/testsuite/g++.dg/vect/pr99149.cc
index
00ebe9d9cdf600ada8e66b4b854f0e18ad0b6a7d..4b885a5d432130d5eff3e96c833ec6c97de3e95d
100755
--- a/gcc/testsuite/g++.dg/vect/pr99149.cc
+++ b/gcc/testsuite/g++.dg/vect/pr99149.cc
@@ -11,8 +11,8 @@ public:
a operator*(a d) { return a(b * b - c * c, b * c + c * d.b); }
};
int f, g;
-class {
- a *h;
+class mp {
+ static a *h;
a *i;
public:
--
diff --git a/gcc/testsuite/g++.dg/vect/pr99149.cc b/gcc/testsuite/g++.dg/vect/pr99149.cc
index 00ebe9d9cdf600ada8e66b4b854f0e18ad0b6a7d..4b885a5d432130d5eff3e96c833ec6c97de3e95d 100755
--- a/gcc/testsuite/g++.dg/vect/pr99149.cc
+++ b/gcc/testsuite/g++.dg/vect/pr99149.cc
@@ -11,8 +11,8 @@ public:
a operator*(a d) { return a(b * b - c * c, b * c + c * d.b); }
};
int f, g;
-class {
- a *h;
+class mp {
+ static a *h;
a *i;
public: