summaryrefslogtreecommitdiffstats
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authormeissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4>2008-07-23 10:28:06 +0000
committermeissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4>2008-07-23 10:28:06 +0000
commit46f8e3b0dc1cbb88c7dde984d0f0c2ce8935011d (patch)
treeefd8e61a3d2ff9dcff5eb5bf03e25922191f7df5 /gcc/c-decl.c
parente22d2ad745ca3d2ac08936833a802ffc161fc89b (diff)
downloadppe42-gcc-46f8e3b0dc1cbb88c7dde984d0f0c2ce8935011d.tar.gz
ppe42-gcc-46f8e3b0dc1cbb88c7dde984d0f0c2ce8935011d.zip
Add ability to set target options (ix86 only) and optimization options on a function specific basis
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138075 138bc75d-0d04-0410-961f-82ee72b054a4
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)
{
OpenPOWER on IntegriCloud