aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2020-04-17 10:57:03 +0200
committerMartin Liska <mliska@suse.cz>2020-04-17 10:57:03 +0200
commitb835645c7a51b7e99092abe61d677aa491836f95 (patch)
tree28feadc0609944c51414455e3256fbb088ff2f1b /gcc/lto
parenta64468a3034dd8e2d0794a5be84b8da544ffe2c3 (diff)
downloadgcc-b835645c7a51b7e99092abe61d677aa491836f95.zip
gcc-b835645c7a51b7e99092abe61d677aa491836f95.tar.gz
gcc-b835645c7a51b7e99092abe61d677aa491836f95.tar.bz2
Initialize file_data->lto_section_header before lto_mode_identity_table call.
PR lto/94612 * lto-common.c: Initialize file_data->lto_section_header before lto_mode_identity_table call. It is needed because it decompresses a LTO section.
Diffstat (limited to 'gcc/lto')
-rw-r--r--gcc/lto/ChangeLog7
-rw-r--r--gcc/lto/lto-common.c11
2 files changed, 13 insertions, 5 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 829b26d..a0c1489 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,10 @@
+2020-04-17 Martin Liska <mliska@suse.cz>
+
+ PR lto/94612
+ * lto-common.c: Initialize file_data->lto_section_header
+ before lto_mode_identity_table call. It is needed because
+ it decompresses a LTO section.
+
2020-04-08 Martin Liska <mliska@suse.cz>
PR c++/94314
diff --git a/gcc/lto/lto-common.c b/gcc/lto/lto-common.c
index e073abc..cee5f0e 100644
--- a/gcc/lto/lto-common.c
+++ b/gcc/lto/lto-common.c
@@ -2197,11 +2197,6 @@ lto_file_finalize (struct lto_file_decl_data *file_data, lto_file *file,
file_data->renaming_hash_table = lto_create_renaming_table ();
file_data->file_name = file->filename;
file_data->order = order;
-#ifdef ACCEL_COMPILER
- lto_input_mode_table (file_data);
-#else
- file_data->mode_table = lto_mode_identity_table;
-#endif
/* Read and verify LTO section. */
data = lto_get_summary_section_data (file_data, LTO_section_lto, &len);
@@ -2217,6 +2212,12 @@ lto_file_finalize (struct lto_file_decl_data *file_data, lto_file *file,
file_data->lto_section_header.minor_version,
file_data->file_name);
+#ifdef ACCEL_COMPILER
+ lto_input_mode_table (file_data);
+#else
+ file_data->mode_table = lto_mode_identity_table;
+#endif
+
data = lto_get_summary_section_data (file_data, LTO_section_decls, &len);
if (data == NULL)
{