This is the mail archive of the
mailing list for the GCC project.
Re: Information regarding issue with While Loop with O3 optimization
- From: Robert Dewar <dewar at adacore dot com>
- To: Raghukrishna Hegde <rkhegde at juniper dot net>
- Cc: gcc-info at gcc dot gnu dot org, gcc-faq at gcc dot gnu dot org, gcc at gcc dot gnu dot org, Puneet Tutliani <puneett at juniper dot net>, Lokesh Kumar <lokesh at juniper dot net>, Arindam Chatterjee <arindam at juniper dot net>
- Date: Tue, 04 Mar 2008 08:50:32 -0500
- Subject: Re: Information regarding issue with While Loop with O3 optimization
- References: <8506939B503B404A84BBB12293FC45F663E64F@emailbng3.jnpr.net>
Raghukrishna Hegde wrote:
I am encountering a strange problem. I have a code
Snippet that contains a while loop.
The snippet is as follows:
While( (expr1) && (expr2) );
Initially the value of both expr1 and expr2 are
Set to 1.
Next, only the value of expr1 is set to 0 within a
you need to make expr1 volatile for this to work, the
optimizer does not have to take care of the possibility
of a handler changing a variable otherwise.