summaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorMichael Meissner <meissner@gcc.gnu.org>2008-07-23 10:28:06 +0000
committerMichael Meissner <meissner@gcc.gnu.org>2008-07-23 10:28:06 +0000
commitab442df7fb453434d80a779844fe1a10c0c802ab (patch)
treeefd8e61a3d2ff9dcff5eb5bf03e25922191f7df5 /gcc/c-decl.c
parent5295185c3150a8d31685dc44248aa058246bbe73 (diff)
downloadgcc-ab442df7fb453434d80a779844fe1a10c0c802ab.tar.gz
Add ability to set target options (ix86 only) and optimization options on a function specific basis
From-SVN: r138075
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 5285c02fa00..80ec48f61af 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -1842,6 +1842,17 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
= C_DECL_BUILTIN_PROTOTYPE (olddecl);
}
+ /* Preserve function specific target and optimization options */
+ if (DECL_FUNCTION_SPECIFIC_TARGET (olddecl)
+ && !DECL_FUNCTION_SPECIFIC_TARGET (newdecl))
+ DECL_FUNCTION_SPECIFIC_TARGET (newdecl)
+ = DECL_FUNCTION_SPECIFIC_TARGET (olddecl);
+
+ if (DECL_FUNCTION_SPECIFIC_OPTIMIZATION (olddecl)
+ && !DECL_FUNCTION_SPECIFIC_OPTIMIZATION (newdecl))
+ DECL_FUNCTION_SPECIFIC_OPTIMIZATION (newdecl)
+ = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (olddecl);
+
/* Also preserve various other info from the definition. */
if (!new_is_definition)
{