gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > O2/O3 is destroying my memory :(

#7667 - Lupin - Sun Jun 22, 2003 7:20 pm

I tried to turn optimizations on and noticed that by using these compiler options:

CFLAGS = -I $(INCDIR2) -I $(INCDIR) -I $(SRCDIR) -mthumb-interwork -mtune=arm7tdmi -c -Wall -fverbose-asm -O3

....the whole memory gets destroyed, all colors are looking very odd and you could only see the basic shape of the sprites :(

Did anybody experienced that too?

#7684 - tepples - Sun Jun 22, 2003 11:38 pm

Your const data should always be aligned to a 4-byte boundary. Is it?

Have you declared your registers volatile?

Are you using DevKit Advance R5b3 or DevKit Advance R4? There are some known ARM architecture optimizer bugs in the GCC included with DKA R4.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#7727 - Lupin - Mon Jun 23, 2003 4:45 pm

A 4-Byte boundary? What do you mean? sorry for my dumbness :)

I think I declared all registers volatile wich are neccesarry volatile (I'm using pernproject headers and some other stolen ones :))

I'm using the DKA provided by pern project, should I get the beta release? I don't think beta releases are that good, most times they are very *beta* :)

#7732 - tepples - Mon Jun 23, 2003 6:20 pm

Lupin wrote:
A 4-Byte boundary? What do you mean? sorry for my dumbness :)

An ARM processor typically addresses memory in 4-byte chunks, starting at byte addresses that are a multiple of 4. There's an attribute called 'aligned' that aligns a variable to an address at a multiple of however many bytes you specify. See [url=http://www.fnal.gov/docs/products/gcc/v2_95_2/gcc.info,.VariableAttributes.html]GCC docs[/url[.

Quote:
I'm using the DKA provided by pern project, should I get the beta release? I don't think beta releases are that good, most times they are very *beta* :)

From my limited use, I guess that DKA R5b3 is up to at least where DKA R4 was in stability.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.