aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorSteve Ellcey <sje@cup.hp.com>2009-10-29 16:44:02 +0000
committerSteve Ellcey <sje@gcc.gnu.org>2009-10-29 16:44:02 +0000
commit2b7e2984ce29a528a8a280191947742a19624b0b (patch)
tree4c4f74fb7f7c6c8fe0a62100be5c7ce3bf5175c4 /gcc/doc
parent44e824996b295fb81976a35028097fea1b89c809 (diff)
downloadgcc-2b7e2984ce29a528a8a280191947742a19624b0b.zip
gcc-2b7e2984ce29a528a8a280191947742a19624b0b.tar.gz
gcc-2b7e2984ce29a528a8a280191947742a19624b0b.tar.bz2
re PR middle-end/37565 (__optimize__ attribute doesn't work correctly)
2009-10-29 Steve Ellcey <sje@cup.hp.com> PR middle-end/37565 PR target/38018 * doc/tm.texi (OVERRIDE_OPTIONS): Update. (TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE): New. * optc-gen.awk (cl_target_option_restore): Include call to targetm.override_options_after_change. * target-def.h (TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE): New. * target.h (override_options_after_change): New. * c-common.c (parse_optimize_options): Call targetm.override_options_after_change. * config/ia64/ia64.c (TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE): New. (ia64_override_options_after_change): New. (ia64_override_options) Add call to above. From-SVN: r153714
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/tm.texi14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 0f33d3d..984bbd7 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -814,8 +814,22 @@ parsed.
Don't use this macro to turn on various extra optimizations for
@option{-O}. That is what @code{OPTIMIZATION_OPTIONS} is for.
+
+If you need to do something whenever the optimization level is
+changed via the optimize attribute or pragma, see
+@code{TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE}
@end defmac
+@deftypefn {Target Hook} void TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE (void)
+This target function is similar to the macro @code{OVERRIDE_OPTIONS}
+but is called when the optimize level is changed via an attribute or
+pragma or when it is reset at the end of the code affected by the
+attribute or pragma. It is not called at the beginning of compilation
+when @code{OVERRIDE_OPTIONS} is called so if you want to perform these
+actions then, you should have @code{OVERRIDE_OPTIONS} call
+@code{TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE}.
+@end deftypefn
+
@defmac C_COMMON_OVERRIDE_OPTIONS
This is similar to @code{OVERRIDE_OPTIONS} but is only used in the C
language frontends (C, Objective-C, C++, Objective-C++) and so can be