This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/36084] 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:45:20 -0000
- Subject: [Bug tree-optimization/36084] not longer folding of (int[<unknown>] *) &i[0] into &i
- References: <bug-36084-6528@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from pinskia at gcc dot gnu dot org 2008-04-30 09:45 -------
Note not doing the folding does cause more stack usage than expected also.
Here is an example which shows that:
int f(int c)
{
int i[1024] = { 0, 1, 2, 3, 4, 2, 1001, 10, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
typedef int a[];
a *b = (a*)&i[0];
return (*b)[0];
}
Try with the C front-end and then try with the C++ front-end and see that we
get slower code and more stack usage with the C++ front-end.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36084