aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/rs6000
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2005-03-08 21:01:47 +0000
committerFariborz Jahanian <fjahanian@gcc.gnu.org>2005-03-08 21:01:47 +0000
commit4d3e6fae4dd35a70c3b63fad8e02b6d4b4b70002 (patch)
tree8e733d5b7a3ce8d9267f4f50ab0923c79cbd51f2 /gcc/config/rs6000
parent2470e6670af2f53985d726d89c4c3e52e8d7e0b2 (diff)
downloadgcc-4d3e6fae4dd35a70c3b63fad8e02b6d4b4b70002.zip
gcc-4d3e6fae4dd35a70c3b63fad8e02b6d4b4b70002.tar.gz
gcc-4d3e6fae4dd35a70c3b63fad8e02b6d4b4b70002.tar.bz2
Target Hook to issue diagnostics for AltiVec argument to funtion with unknown prototype.
Target Hook to issue diagnostics for AltiVec argument to funtion with unknown prototype. OKed by Mark Mitchel. From-SVN: r96124
Diffstat (limited to 'gcc/config/rs6000')
-rw-r--r--gcc/config/rs6000/rs6000.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index f668b12..9b9d3ae 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -53,6 +53,7 @@
#include "cfglayout.h"
#include "sched-int.h"
#include "tree-gimple.h"
+#include "intl.h"
#if TARGET_XCOFF
#include "xcoffout.h" /* get declarations of xcoff_*_section_name */
#endif
@@ -757,6 +758,7 @@ static bool rs6000_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode,
tree, bool);
static int rs6000_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
tree, bool);
+static const char *invalid_arg_for_unprototyped_fn (tree, tree, tree);
#if TARGET_MACHO
static void macho_branch_islands (void);
static void add_compiler_branch_island (tree, tree, int);
@@ -1003,6 +1005,9 @@ static const char alt_reg_names[][8] =
#undef TARGET_VECTOR_MODE_SUPPORTED_P
#define TARGET_VECTOR_MODE_SUPPORTED_P rs6000_vector_mode_supported_p
+#undef TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN
+#define TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN invalid_arg_for_unprototyped_fn
+
/* MPC604EUM 3.5.2 Weak Consistency between Multiple Processors
The PowerPC architecture requires only weak consistency among
processors--that is, memory accesses between processors need not be
@@ -17504,4 +17509,18 @@ rs6000_vector_mode_supported_p (enum machine_mode mode)
return false;
}
+/* Target hook for invalid_arg_for_unprototyped_fn. */
+static const char *
+invalid_arg_for_unprototyped_fn (tree typelist, tree funcdecl, tree val)
+{
+ return (!rs6000_darwin64_abi
+ && typelist == 0
+ && TREE_CODE (TREE_TYPE (val)) == VECTOR_TYPE
+ && (funcdecl == NULL_TREE
+ || (TREE_CODE (funcdecl) == FUNCTION_DECL
+ && DECL_BUILT_IN_CLASS (funcdecl) != BUILT_IN_MD)))
+ ? N_("AltiVec argument passed to unprototyped function")
+ : NULL;
+}
+
#include "gt-rs6000.h"