This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/20243] static initialization .data redundantly copied to ram prior to use.
- From: "schlie at comcast dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Feb 2005 04:41:02 -0000
- Subject: [Bug target/20243] static initialization .data redundantly copied to ram prior to use.
- References: <20050228040434.20243.schlie@comcast.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From schlie at comcast dot net 2005-02-28 04:40 -------
> oh, this is still a target bug.
Possibly (but likely of similar concern for other small embedded targets)
The problem is that the initialization data which is linked in .data (stored in readable flash/rom)
is first copied to RAM, prior to then being copied to the data structure which may require
initialization. (resulting in a needless redundant copy chewing up precious RAM).
As in for example:
struct s{
long a;
long b;
long c;
long d;
};
void main (void){
volatile struct s x = {0, 1, 2, 3};
volatile struct s y = {0, 1, 2, 3};
/* etc. */
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20243