https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56139
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|tree-optimization |ipa Target Milestone|--- |13.0 Keywords| |deferred Known to fail| |4.7.1 Severity|enhancement |normal CC| |marxin at gcc dot gnu.org Summary|unmodified static data |[9/10/11/12 Regression] |could go in .rodata, not |unmodified static data |.data |could go in .rodata, not | |.data --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- We do handle: static int x[] = {1, 2, 3, 4}; void bar (int x); int func(int i) { bar(x[i]); return 0; } Just fine. It is the IR of the other case where we mess up. And it looks like it is a regression too. I suspect it is because we used to be able to create back the ARARY_REF in GCC 4.6.x and that was removed in GCC 4.7 as it caused other issues.