avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] stack(?) problems


From: Tobias Pflug
Subject: [avr-gcc-list] stack(?) problems
Date: Mon, 06 Aug 2007 12:12:43 +0200

Hi, 

I am currently in the process of porting code written for
the ImageCraft C compiler to gcc. Now i'm having some
problems where very trivial code does not work:


int test;
int *p;

int main()
{
  test = 0;
  p = &test;
  ...
}

avr-nm main.elf | grep test
0000000000804020 b test

When testing the code in gdb:
[After the value assignments of course]

(gdb) print p
$1 = (int *) 0x800000
(gdb) print &test
$2 = (int *) 0x804020

I can't provide the full code because of copyright/NDA issues. I'm using
gcc-4.1.0 Code was tried with -O1 and -Os. 

Compiler flags:

avr-gcc -c -mmcu=atmega128 -I. -gstabs   -O1 -funsigned-char
-funsigned-bitfields -fpack-struct -fshort-enums -Wall
-Wstrict-prototypes

Any ideas what's going wrong and what I could try?

Thanks alot.
regards,

Tobias Pflug





reply via email to

[Prev in Thread] Current Thread [Next in Thread]