This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/81884] [6/7/8 Regression] Invalid code generation with zero size arrays or flexible array members


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]...

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]