diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-06 18:57:27 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-06 18:57:27 +0000 |
commit | 5de92639376d02c091b93418f3d4a0b25b92c26f (patch) | |
tree | 6db0f16a08d3e0f5d8feea8a59bd2d27420fa52d /include | |
parent | 4ea69e9efb4ab33b0ce910662afedbc496d319fa (diff) | |
download | gcc-5de92639376d02c091b93418f3d4a0b25b92c26f.tar.gz |
* errors.h (warning, error, fatal, internal_error): Mark as cold.
* predict.c (maybe_hot_bb): Cold functions are never hot; hot functions
are hot.
(probably_cold_bb_p): Cold functions are cold.
(probably_never_executed_bb_p): Cold functions are cold.
(tree_bb_level_predictions): Predict calls to cold functions as not
taken.
(compute_function_frequency): Check hot/cold attributes.
* function.h (function_frequency): Update comments.
* predict.def (PRED_COLD_FUNCTION): Predict cold function.
* c-common.c (handle_hot_attribute, handle_cold_attribute): New.
(c_common_att): Add cold and hot.
* doc/extend.texi (hot,cold attributes): Document.
* ansidecl.h (ATTRIBUTE_COLD, ATTRIBUTE_HOT): New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122632 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'include')
-rw-r--r-- | include/ChangeLog | 4 | ||||
-rw-r--r-- | include/ansidecl.h | 16 |
2 files changed, 20 insertions, 0 deletions
diff --git a/include/ChangeLog b/include/ChangeLog index dc04f662427..e0556667d10 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,7 @@ +2007-03-06 Jan Hubicka <jh@suse.cz> + + * ansidecl.h (ATTRIBUTE_COLD, ATTRIBUTE_HOT): New. + 2007-02-09 Joseph S. Myers <joseph@codesourcery.com> * libiberty.h (pex_write_input): Remove prototype. diff --git a/include/ansidecl.h b/include/ansidecl.h index 16adc47a1bf..c19955a98a6 100644 --- a/include/ansidecl.h +++ b/include/ansidecl.h @@ -367,6 +367,22 @@ So instead we use the macro below and test it against specific values. */ # define ATTRIBUTE_PACKED __attribute__ ((packed)) #endif +/* Attribute `hot' and `cold' was valid as of gcc 4.3. */ +#ifndef ATTRIBUTE_COLD +# if (GCC_VERSION >= 4003) +# define ATTRIBUTE_COLD __attribute__ ((__cold__)) +# else +# define ATTRIBUTE_COLD +# endif /* GNUC >= 4.3 */ +#endif /* ATTRIBUTE_COLD */ +#ifndef ATTRIBUTE_HOT +# if (GCC_VERSION >= 4003) +# define ATTRIBUTE_HOT __attribute__ ((__hot__)) +# else +# define ATTRIBUTE_HOT +# endif /* GNUC >= 4.3 */ +#endif /* ATTRIBUTE_HOT */ + /* We use __extension__ in some places to suppress -pedantic warnings about GCC extensions. This feature didn't work properly before gcc 2.8. */ |