aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2009-07-08 22:22:37 -0400
committerDJ Delorie <dj@gcc.gnu.org>2009-07-08 22:22:37 -0400
commitae30c1fa3d408d80ddae53efa00586ed45277120 (patch)
tree5dceaab5956e7270a9645ecea172b15766db765c /gcc
parente6fe9294ed39353e790ddc75f15996b26434d305 (diff)
downloadgcc-ae30c1fa3d408d80ddae53efa00586ed45277120.zip
gcc-ae30c1fa3d408d80ddae53efa00586ed45277120.tar.gz
gcc-ae30c1fa3d408d80ddae53efa00586ed45277120.tar.bz2
mep.c: (mep_option_can_inline_p): New.
* config/mep/mep.c: (mep_option_can_inline_p): New. (TARGET_OPTION_CAN_INLINE_P): Define. From-SVN: r149400
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/mep/mep.c20
2 files changed, 25 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c78577a..6fefd14 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-08 DJ Delorie <dj@redhat.com>
+
+ * config/mep/mep.c: (mep_option_can_inline_p): New.
+ (TARGET_OPTION_CAN_INLINE_P): Define.
+
2009-07-08 Mark Wielaard <mjw@redhat.com>
PR debug/40659
diff --git a/gcc/config/mep/mep.c b/gcc/config/mep/mep.c
index 7237a03..9b489f9 100644
--- a/gcc/config/mep/mep.c
+++ b/gcc/config/mep/mep.c
@@ -170,6 +170,7 @@ static tree mep_validate_interrupt (tree *, tree, tree, int, bool *);
static tree mep_validate_io_cb (tree *, tree, tree, int, bool *);
static tree mep_validate_vliw (tree *, tree, tree, int, bool *);
static bool mep_function_attribute_inlinable_p (const_tree);
+static bool mep_option_can_inline_p (tree, tree);
static bool mep_lookup_pragma_disinterrupt (const char *);
static int mep_multiple_address_regions (tree, bool);
static int mep_attrlist_to_encoding (tree, tree);
@@ -235,6 +236,8 @@ static tree mep_gimplify_va_arg_expr (tree, tree, tree *, tree *);
#define TARGET_INSERT_ATTRIBUTES mep_insert_attributes
#undef TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P
#define TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P mep_function_attribute_inlinable_p
+#undef TARGET_OPTION_CAN_INLINE_P
+#define TARGET_OPTION_CAN_INLINE_P mep_option_can_inline_p
#undef TARGET_SECTION_TYPE_FLAGS
#define TARGET_SECTION_TYPE_FLAGS mep_section_type_flags
#undef TARGET_ASM_NAMED_SECTION
@@ -4106,6 +4109,23 @@ mep_function_attribute_inlinable_p (const_tree callee)
&& lookup_attribute ("interrupt", attrs) == 0);
}
+static bool
+mep_option_can_inline_p (tree caller, tree callee)
+{
+ if (TREE_CODE (callee) == ADDR_EXPR)
+ callee = TREE_OPERAND (callee, 0);
+
+ if (TREE_CODE (callee) == FUNCTION_DECL
+ && DECL_DECLARED_INLINE_P (callee)
+ && !mep_vliw_function_p (caller)
+ && mep_vliw_function_p (callee))
+ {
+ error ("cannot call inline VLIW functions from core functions");
+ return true;
+ }
+ return false;
+}
+
#define FUNC_CALL 1
#define FUNC_DISINTERRUPT 2