Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: Windows images; bug fixes; othelo updates; new sdk;
From: Nix (nix_at_esperi.demon.co.uk)
Date: 2003-07-31


On Mon, 28 Jul 2003, BlueChip mused:
> static char scs[] = {
> of_plx, of_colon, of_h, of_dash, of_0, of_eos, /* 0 */
> of_plo, of_colon, of_h, of_dash, of_0, of_eos /* 6 */
> };
[snip]
> ...I would have preferred to have reomved the "static" (whoch should
> also fix the problem) but for some reason best known unto others this
> generates a compile error which whinges about a call to memcpy ...so
> the fix is just a bodge job to get it working again.

GCC may choose to use block moves for array initializers, depending upon

- whether doing so would smash the stack
- whether it would be more efficient to emit an unrolled initialization
- and many, *many* other conditions

See emit_block_move() and callers, particularly expand_assignment(), in
gcc/expr.c.

And, no, you can't turn that behaviour off. While freestanding C
implementations (like Rockbox) are permitted to not implement memcpy(),
GCC's -ffreestanding switch isn't fully implemented yet. Specifically,
this bit isn't implemented.

(Implementing it poorly wouldn't be hard; simply arrange to force
may_use_call to 0 in emit_block_move(). Implementing it efficiently,
that is, granting the compiler knowledge of the increased expense of
block copying in those situations, is harder.)

        ... trying to get up the nerve to flash his FM...

-- 
`We cannot get a new line down the pipe due to a blockage and we cannot
 dig up the road to clear the blockage because it is covered with the
 wrong type of tarmac.' --- British Telecom, via Mark Lowes



Page was last modified "Jan 10 2012" The Rockbox Crew
aaa