This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/59863] const array in function is placed on stack
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 17 Jan 2014 23:30:57 +0000
- Subject: [Bug c/59863] const array in function is placed on stack
- Auto-submitted: auto-generated
- References: <bug-59863-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59863
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This is caused by checking TREE_ADDRESSABLE on the a decl which is correct
thing to do but the issue is there is no addressing taking in the code (only an
implicit one with a[i]:
/* An array that is indexed by a non-constant
cannot be stored in a register; we must be able to do
address arithmetic on its address.
Likewise an array of elements of variable size. */