This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/36084] New: not longer folding of (int[<unknown>] *) &i[0] into &i
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Apr 2008 09:40:37 -0000
- Subject: [Bug tree-optimization/36084] New: not longer folding of (int[<unknown>] *) &i[0] into &i
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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