aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto-streamer-in.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/lto-streamer-in.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/lto-streamer-in.c')
-rw-r--r--gcc/lto-streamer-in.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c
index f41aa75..d9c207d 100644
--- a/gcc/lto-streamer-in.c
+++ b/gcc/lto-streamer-in.c
@@ -2377,13 +2377,22 @@ lto_get_builtin_tree (struct lto_input_block *ib, struct data_in *data_in)
gcc_assert (fclass == BUILT_IN_NORMAL || fclass == BUILT_IN_MD);
fcode = (enum built_in_function) lto_input_uleb128 (ib);
- gcc_assert (fcode < END_BUILTINS);
ix = lto_input_sleb128 (ib);
gcc_assert (ix == (int) ix);
- result = built_in_decls[fcode];
- gcc_assert (result);
+ if (fclass == BUILT_IN_NORMAL)
+ {
+ gcc_assert (fcode < END_BUILTINS);
+ result = built_in_decls[fcode];
+ gcc_assert (result);
+ }
+ else if (fclass == BUILT_IN_MD)
+ {
+ result = targetm.builtin_decl (fcode, true);
+ if (!result || result == error_mark_node)
+ fatal_error ("target specific builtin not available");
+ }
asmname = input_string (data_in, ib);
if (asmname)