[Bug tree-optimization/36084] not longer folding of (int[<unknown>] *) &i[0] into &i

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Apr 30 09:46:00 GMT 2008



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



More information about the Gcc-bugs mailing list