From 46f8e3b0dc1cbb88c7dde984d0f0c2ce8935011d Mon Sep 17 00:00:00 2001 From: meissner Date: Wed, 23 Jul 2008 10:28:06 +0000 Subject: 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 --- gcc/c-decl.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'gcc/c-decl.c') 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) { -- cgit v1.2.3