From b898d037f36e31b1ec3c33e9b254c86b213138d3 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 19 May 2016 17:02:30 +0200 Subject: [PATCH] LTO: display file name if LTO version check fails * lto-section-in.c (lto_get_section_data): Call lto_check_version with additional argument. * lto-streamer.c (lto_check_version): Add new argument. * lto-streamer.h (lto_check_version): Likewise. From-SVN: r236464 --- gcc/ChangeLog | 7 +++++++ gcc/lto-section-in.c | 3 ++- gcc/lto-streamer.c | 7 ++++--- gcc/lto-streamer.h | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 42e6224c4a0..3f2a5920ff0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-05-19 Martin Liska + + * lto-section-in.c (lto_get_section_data): Call + lto_check_version with additional argument. + * lto-streamer.c (lto_check_version): Add new argument. + * lto-streamer.h (lto_check_version): Likewise. + 2016-05-19 Kyrylo Tkachov * config/arm/arm.c (arm_new_rtx_costs, SIGN_EXTEND case): diff --git a/gcc/lto-section-in.c b/gcc/lto-section-in.c index 93b82be81ff..d8e74d70745 100644 --- a/gcc/lto-section-in.c +++ b/gcc/lto-section-in.c @@ -168,7 +168,8 @@ lto_get_section_data (struct lto_file_decl_data *file_data, } lto_check_version (((const lto_header *)data)->major_version, - ((const lto_header *)data)->minor_version); + ((const lto_header *)data)->minor_version, + file_data->file_name); return data; } diff --git a/gcc/lto-streamer.c b/gcc/lto-streamer.c index 5e35aac8fe9..bfde1fe7763 100644 --- a/gcc/lto-streamer.c +++ b/gcc/lto-streamer.c @@ -376,12 +376,13 @@ lto_orig_address_remove (tree t) /* Check that the version MAJOR.MINOR is the correct version number. */ void -lto_check_version (int major, int minor) +lto_check_version (int major, int minor, const char *file_name) { if (major != LTO_major_version || minor != LTO_minor_version) fatal_error (input_location, - "bytecode stream generated with LTO version %d.%d instead " - "of the expected %d.%d", + "bytecode stream in file '%s' generated with LTO version " + "%d.%d instead of the expected %d.%d", + file_name, major, minor, LTO_major_version, LTO_minor_version); } diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h index 01c15ff1a9d..92efdb8e008 100644 --- a/gcc/lto-streamer.h +++ b/gcc/lto-streamer.h @@ -844,7 +844,7 @@ extern void lto_orig_address_map (tree, intptr_t); extern intptr_t lto_orig_address_get (tree); extern void lto_orig_address_remove (tree); #endif -extern void lto_check_version (int, int); +extern void lto_check_version (int, int, const char *); extern void lto_streamer_hooks_init (void); /* In lto-streamer-in.c */