This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: volatile is not volatile enough


On Wed, Jun 25, 2003 at 03:20:57PM +0200, Jan Engelhardt wrote:
> Hi,
> 
> given a statement like
>   int a[2];
>   func2(func1(a), a[0], a[1]);
> where a is modified by func1, func2 receives wrong input on the stack. In
> detail, first a[1], then a[0] and then a is pushed onto the stack, then func1
> gets called and pops off its a -- which is modified after.
> Adding the keyword volatile doesnot help.
> 
> I am using gcc 3.3 20030226 (prerelease) SuSE Linux 8.2.

This isn't a GCC bug.  The order of evaluation of function arguments is
undefined - including nested function calls.


-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]