This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/20243] static initialization .data redundantly copied to ram prior to use.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]