summaryrefslogtreecommitdiffstats
path: root/gcc/c-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index fbb5f88fac8..c9ffd9c9aa3 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -5046,7 +5046,6 @@ handle_hot_attribute (tree *node, tree name, tree ARG_UNUSED (args),
name, "cold");
*no_add_attrs = true;
}
-
else
{
tree old_opts = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (*node);
@@ -5054,6 +5053,7 @@ handle_hot_attribute (tree *node, tree name, tree ARG_UNUSED (args),
/* If we are not at -O3, but are optimizing, turn on -O3
optimizations just for this one function. */
if (((optimize > 0 && optimize < 3) || optimize_size)
+ && targetm.target_option.hot_attribute_sets_optimization
&& (!old_opts || old_opts == optimization_default_node))
{
/* Create the hot optimization node if needed. */
@@ -5071,9 +5071,9 @@ handle_hot_attribute (tree *node, tree name, tree ARG_UNUSED (args),
DECL_FUNCTION_SPECIFIC_OPTIMIZATION (*node)
= optimization_hot_node;
}
+ /* Most of the rest of the hot processing is done later with
+ lookup_attribute. */
}
- /* Most of the rest of the hot processing is done later with
- lookup_attribute. */
}
else
{
@@ -5105,6 +5105,7 @@ handle_cold_attribute (tree *node, tree name, tree ARG_UNUSED (args),
/* If we are optimizing, but not optimizing for space, turn on -Os
optimizations just for this one function. */
if (optimize && !optimize_size
+ && targetm.target_option.cold_attribute_sets_optimization
&& (!old_opts || old_opts == optimization_default_node))
{
/* Create the cold optimization node if needed. */
@@ -5122,6 +5123,8 @@ handle_cold_attribute (tree *node, tree name, tree ARG_UNUSED (args),
DECL_FUNCTION_SPECIFIC_OPTIMIZATION (*node)
= optimization_cold_node;
}
+ /* Most of the rest of the cold processing is done later with
+ lookup_attribute. */
}
}
else
OpenPOWER on IntegriCloud