[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Problem with Bit Shift using WinAVR20071221rc1
From: |
hutchinsonandy |
Subject: |
Re: [avr-gcc-list] Problem with Bit Shift using WinAVR20071221rc1 |
Date: |
Tue, 25 Mar 2008 10:55:00 -0400 |
Looks like a bug but
Cut and paste assembler from .lss file into email.
Also try same thing with different optimisations
-O0 (none) -O1 (some) -O2 -O3 -Os
If you are using make file look for optimsation variable about 20 lines
or so from top.
This will give us a clue :-)
Andy
-----Original Message-----
From: Moritz Federspiel <address@hidden>
To: address@hidden
Sent: Tue, 25 Mar 2008 9:41 am
Subject: [avr-gcc-list] Problem with Bit Shift using WinAVR20071221rc1
Hello everyone!
I got a little Problem on this simple Code:
/-------------code start-------------------/
uint32_t i; t;
for(i=0; i<20; i++)
t = (1<<i);
/-------------code stop-------------------/
The results of this should be:
1
2
4
8
16
32
64
128
256
512
1024
2048
4096
8192
16384
-->4294934528
after the 16384 i get 4294934528, I dont know where the problem is.
I cant code in asm, but i watched the produced asm code in AVR-Studios
Debugger and i noticed that only 2 of the 4 bits are copied in the used
registers.
This might be a Compiler failure, or my Code is wrong, or my Compiler
Flags are not correct.
Have you got any solutions for me? I'm not able to write inline asm
code :(
regards MoFe
_______________________________________________
AVR-GCC-list mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list