Use of optimization pragmas
Use of optimization pragmas
- Subject: Use of optimization pragmas
- From: jmacveigh <email@hidden>
- Date: Wed, 14 Jan 2009 18:01:31 -0500
Hi,
I'm using Xcode 3.1.2 on a MacPro with 10.5.6.
I have a C++ file that causes GCC 4.0 to abort if the optimization
level is above 0, and my release configuration is using -Os. The error
occurs at the end of a function, so I surrounded that function with
pragmas as follows:
#pragma GCC optimize_for_size off
#pragma GCC optimization_level 0
void CVDataClass::MakeFrameData (void)
{
//body of function
}
#pragma GCC optimization_level reset
#pragma GCC optimize_for_size reset
Now the file compiles, but I get two warnings: "warning: optimization
pragma stack underflow" at the end of the function. (The warning
bubble actually appears before the reset pragmas, but I've noticed
that those bubbles are sometimes off by a line or two.) There are no
other #pragmas, or any other macros, in the body of the function.
The documentation says: "These pragmas form a stack; the "reset"
argument pops the stack, restoring the optimization level to what it
was before the previous optimization pragma."
I could move this function to the bottom of the file and omit the
resets, but I wanted to understand the problem here: have I
misunderstood how these pragmas work, or do I have two bug reports
instead of one?
TIA,
--John
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden