[Bug target/36494] Char arrays gets corrupted in avr programs.

2008-06-12 Thread martin at kfib dot org
--- Comment #5 from martin at kfib dot org 2008-06-12 09:13 --- Never mind, I will do it. I'm a total klutz and I apologize. This is very, very embarrassing. If someone ever have a similar problem, make sure they're not running avr-objcopy with the flag -j .text... -- martin at

[Bug target/36494] Char arrays gets corrupted in avr programs.

2008-06-11 Thread martin at kfib dot org
--- Comment #3 from martin at kfib dot org 2008-06-11 21:13 --- Exact line for compiling is: avr-gcc -mmcu=atmega48 -Walltest.c -o test And now I'm very confused. I KNOW I've tried with and without optimization before and that it made no difference (or possibly I'm a major

[Bug target/36494] Char arrays gets corrupted in avr programs.

2008-06-11 Thread hutchinsonandy at aim dot com
--- Comment #4 from hutchinsonandy at aim dot com 2008-06-11 22:05 --- I'm sure Eric will weight in again to verify code posted executes correctly (it looks correct to me). I suspect you have some config or memory issue. For example, unoptimized, the string is stored at location

[Bug target/36494] Char arrays gets corrupted in avr programs.

2008-06-10 Thread pinskia at gcc dot gnu dot org
-- pinskia at gcc dot gnu dot org changed: What|Removed |Added Severity|major |normal Component|c |target GCC

[Bug target/36494] Char arrays gets corrupted in avr programs.

2008-06-10 Thread hutchinsonandy at gcc dot gnu dot org
--- Comment #1 from hutchinsonandy at gcc dot gnu dot org 2008-06-11 02:35 --- Please post command line used to compile and assembler produced. I cannot reproduce this on 4.4 or 4.2.2. At high optimisation (-Os) it compiles to load PORTC with 3 directly. (as one would expect): 13

[Bug target/36494] Char arrays gets corrupted in avr programs.

2008-06-10 Thread eric dot weddington at atmel dot com
--- Comment #2 from eric dot weddington at atmel dot com 2008-06-11 05:50 --- Compiling code with -O0 (so it doesn't optimize the program away) and running it through the debugger in AVR Studio still shows that main returns a 3, which indicates that both conditions (testing a[0] and