This is the mail archive of the
mailing list for the GCC project.
Information regarding issue with While Loop with O3 optimization
- From: "Raghukrishna Hegde" <rkhegde at juniper dot net>
- To: <gcc-info at gcc dot gnu dot org>, <gcc-faq at gcc dot gnu dot org>, <gcc at gcc dot gnu dot org>
- Cc: "Puneet Tutliani" <puneett at juniper dot net>, "Lokesh Kumar" <lokesh at juniper dot net>, "Arindam Chatterjee" <arindam at juniper dot net>, "Raghukrishna Hegde" <rkhegde at juniper dot net>
- Date: Tue, 4 Mar 2008 19:17:06 +0530
- Subject: Information regarding issue with While Loop with O3 optimization
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
I compile this program with -O3 optimization. The gcc
Version information is as follows:
gcc (GCC) 4.1.1 20070105 (Red Hat 4.1.1-52)
When I run this program, it goes into a tight loop.
Now when I send a SIGINT to this program,
Then the program is not exiting.
I repeat the same procedure by compiling the same
code with -O0 optimization option. Now when I
Send the SIGINT signal the program exits
Has anyone encountered similar kind of behavior?
Is there any issue with GCC 4.1.1 related to O3 optimization