Testcase: int f(int c) { int i[] = { 0, 1, 2, 3, 4}; typedef int a[]; a *b = (a*)&i[0]; return (*b)[0]; }
--- CUT --- We don't fold this into just return 0 with at least the C++ front-end. I found this while improving PR 26069 and it happens many times with the Fortran front-end more than any other because of inlining and how arrays are done. -- Summary: not longer folding of (int[<unknown>] *) &i[0] into &i Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: missed-optimization, TREE Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36084