aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/rs6000/rs6000.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-10-09 22:31:53 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-10-09 22:31:53 +0000
commite9e4b3a892d0d19418f23bb17bdeac33f9a8bfd2 (patch)
tree8ac7173644937212b4dfddf787410b0ecfa43674 /gcc/config/rs6000/rs6000.c
parentd0a9804e353b33d339e20f0aa2bd458a4ff08649 (diff)
downloadgcc-e9e4b3a892d0d19418f23bb17bdeac33f9a8bfd2.zip
gcc-e9e4b3a892d0d19418f23bb17bdeac33f9a8bfd2.tar.gz
gcc-e9e4b3a892d0d19418f23bb17bdeac33f9a8bfd2.tar.bz2
re PR lto/41638 (Back-end builtins are mishandled)
2009-10-09 Richard Guenther <rguenther@suse.de> PR lto/41638 * target-def.h (TARGET_BUILTIN_DECL): Define. (TARGET_INITIALIZER): Add TARGET_BUILTIN_DECL. * target.h (struct gcc_target): Add builtin_decl target hook. * doc/tm.texi (TARGET_BUILTIN_DECL): Document. * lto-streamer-in.c (lto_get_builtin_tree): Fix handling of target builtins. * lto-streamer-out.c (lto_output_tree_pointers): Use sorry, not gcc_unreachable. (lto_output_builtin_tree): Sorry if the target does not support streaming target builtins. * config/rs6000/rs6000.c (TARGET_BUILTIN_DECL): Define. (rs6000_builtin_decl): New function. * config/i386/i386.c (TARGET_BUILTIN_DECL): Define. (ix86_builtin_decl): New function. From-SVN: r152606
Diffstat (limited to 'gcc/config/rs6000/rs6000.c')
-rw-r--r--gcc/config/rs6000/rs6000.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 333babc..319af63 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -947,6 +947,8 @@ static bool rs6000_builtin_support_vector_misalignment (enum
static void def_builtin (int, const char *, tree, int);
static bool rs6000_vector_alignment_reachable (const_tree, bool);
static void rs6000_init_builtins (void);
+static tree rs6000_builtin_decl (unsigned, bool);
+
static rtx rs6000_expand_unop_builtin (enum insn_code, tree, rtx);
static rtx rs6000_expand_binop_builtin (enum insn_code, tree, rtx);
static rtx rs6000_expand_ternop_builtin (enum insn_code, tree, rtx);
@@ -1332,6 +1334,8 @@ static const struct attribute_spec rs6000_attribute_table[] =
#undef TARGET_INIT_BUILTINS
#define TARGET_INIT_BUILTINS rs6000_init_builtins
+#undef TARGET_BUILTIN_DECL
+#define TARGET_BUILTIN_DECL rs6000_builtin_decl
#undef TARGET_EXPAND_BUILTIN
#define TARGET_EXPAND_BUILTIN rs6000_expand_builtin
@@ -11144,6 +11148,17 @@ rs6000_init_builtins (void)
#endif
}
+/* Returns the rs6000 builtin decl for CODE. */
+
+static tree
+rs6000_builtin_decl (unsigned code, bool initialize_p ATTRIBUTE_UNUSED)
+{
+ if (code >= RS6000_BUILTIN_COUNT)
+ return error_mark_node;
+
+ return rs6000_builtin_decls[code];
+}
+
/* Search through a set of builtins and enable the mask bits.
DESC is an array of builtins.
SIZE is the total number of builtins.