This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/81884] [6/7/8 Regression] Invalid code generation with zero size arrays or flexible array members
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 18 Aug 2017 13:14:18 +0000
- Subject: [Bug tree-optimization/81884] [6/7/8 Regression] Invalid code generation with zero size arrays or flexible array members
- Auto-submitted: auto-generated
- References: <bug-81884-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81884
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Regresses gfortran.dg/reassoc_4.f because we no longer DSE
@@ -207,6 +207,7 @@
_28 = *weight_94(D);
_29 = _27 * _28;
_30 = _10 + _29;
+ *s_91(D)[_9] = _30;
_173 = _12 + 9;
_174 = _17 + _173;
_175 = _19 + _174;
@@ -226,6 +227,7 @@
_193 = _189 * _192;
_194 = _28 * _193;
_195 = _185 + _194;
+ *s_91(D)[_9] = _195;
...
so the restriction is too broad. Now the question is if we want to allow
struct S { int a[0]; };
struct S (*p)[1];
and (*p)[0].a[4]. Or array of size n and (*p)[n-1].a[4]...