[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: |
Paulo Marques |
Subject: |
Re: [avr-gcc-list] Problem with Bit Shift using WinAVR20071221rc1 |
Date: |
Tue, 25 Mar 2008 15:01:54 +0000 |
User-agent: |
Thunderbird 1.5.0.14 (X11/20071210) |
Moritz Federspiel wrote:
Hello everyone!
Hi, Moritz
I got a little Problem on this simple Code:
/-------------code start-------------------/
uint32_t i; t;
for(i=0; i<20; i++)
t = (1<<i);
This isn't actual compilable code... you should send a compilable
example so that others can test it.
The code you shown as several problems:
- the for loop as no side effects, so the compiler could just optimize
it to: t = (1 << 19)
- "t" isn't being used afterwards, so the compiler could just optimize
everything away
Please send a small compilable example so that we can see what is going on.
--
Paulo Marques
Software Development Department - Grupo PIE, S.A.
Phone: +351 252 290600, Fax: +351 252 290601
Web: www.grupopie.com
"All generalizations are false."