[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Question about gcc preprocessing andport/pinassignmen
From: |
David Brown |
Subject: |
Re: [avr-gcc-list] Question about gcc preprocessing andport/pinassignments |
Date: |
Fri, 10 Dec 2004 16:22:11 +0100 |
> From: David Kelly <address@hidden>
> >
> >On Dec 9, 2004, at 7:43 PM, Dave Hylands wrote:
> >
> >>In the example I showed, a = ( b = 3 ) + 4; we know that a will be
> >>assigned 7 and b will be assigned 3. We don't know the order that these
> >>assignments will take place in.
>
> It's worse than that. Given
>
> b = 3;
> a = b + 4;
>
> we don't know in which order the assignments will take place. Unless 'a'
> and 'b' are volatile.
>
There is a big difference - in the "a = (b = 3) + 4" case, we don't know the
order of the assignments *even if they are volatile*. In the second case,
we know the order if they are volatile, and if they are not volatile, then
who cares? C does not specify that a and b have to be assigned to at all -
in fact, they don't have to exist in the generated code at all if they are
local. All the compiler needs do is generate code that will function as
though the two statements we executed in the given order.
- Re: [avr-gcc-list] Question about gcc preprocessing and port/pinassignments, (continued)
- Re: [avr-gcc-list] Question about gcc preprocessing and port/pinassignments, E. Weddington, 2004/12/09
- Re: [avr-gcc-list] Question about gcc preprocessing andport/pinassignments, Graham Davies, 2004/12/09
- Re: [avr-gcc-list] Question about gcc preprocessing andport/pinassignments, Jeff Barlow, 2004/12/09
- Re: [avr-gcc-list] Question about gcc preprocessing andport/pinassignments, Ben L. Titzer, 2004/12/09
- Re: [avr-gcc-list] Question about gcc preprocessingandport/pinassignments, Graham Davies, 2004/12/09
- Re: [avr-gcc-list] Question about gcc preprocessing and port/pinassignments, Dave Hansen, 2004/12/09
- Re: [avr-gcc-list] Question about gcc preprocessing and port/pin assignments, Julius Luukko, 2004/12/10
RE: [avr-gcc-list] Question about gcc preprocessing and port/pin assignments, Dave Hylands, 2004/12/09