On 10/3/18 11:23 AM, Martin Liška wrote: > On 9/25/18 8:48 AM, Martin Liška wrote: >> Hi. >> >> One more tested patch. >> >> Martin >> > > One more tested patch. > > Martin >
Hi. One another tested patch that I'm going to install. Martin
>From 94cd1e55e5baec63b7a80c59fdd8b5c52595c9e9 Mon Sep 17 00:00:00 2001 From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Mon, 19 Nov 2018 15:00:41 +0000 Subject: [PATCH] Backport r266277 gcc/lto/ChangeLog: 2018-11-19 Martin Liska <mli...@suse.cz> PR lto/88077 * lto-symtab.c (lto_symtab_merge): Transform the condition before r256989. gcc/testsuite/ChangeLog: 2018-11-19 Martin Liska <mli...@suse.cz> PR lto/88077 * gcc.dg/lto/pr88077_0.c: New test. * gcc.dg/lto/pr88077_1.c: New test. --- gcc/lto/lto-symtab.c | 5 +++-- gcc/testsuite/gcc.dg/lto/pr88077_0.c | 3 +++ gcc/testsuite/gcc.dg/lto/pr88077_1.c | 6 ++++++ 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/lto/pr88077_0.c create mode 100644 gcc/testsuite/gcc.dg/lto/pr88077_1.c diff --git a/gcc/lto/lto-symtab.c b/gcc/lto/lto-symtab.c index 3663ab7a9b2..cec74894c02 100644 --- a/gcc/lto/lto-symtab.c +++ b/gcc/lto/lto-symtab.c @@ -388,8 +388,9 @@ lto_symtab_merge (symtab_node *prevailing, symtab_node *entry) int a[]={1,2,3}; here the first declaration is COMMON and sizeof(a) == sizeof (int). */ - else if (TREE_CODE (type) == ARRAY_TYPE) - return (TYPE_SIZE (decl) == TYPE_SIZE (TREE_TYPE (type))); + else if (TREE_CODE (type) != ARRAY_TYPE + || (TYPE_SIZE (type) != TYPE_SIZE (TREE_TYPE (type)))) + return false; } return true; diff --git a/gcc/testsuite/gcc.dg/lto/pr88077_0.c b/gcc/testsuite/gcc.dg/lto/pr88077_0.c new file mode 100644 index 00000000000..9e464b6ad4a --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr88077_0.c @@ -0,0 +1,3 @@ +/* { dg-lto-do link } */ + +int HeaderStr; diff --git a/gcc/testsuite/gcc.dg/lto/pr88077_1.c b/gcc/testsuite/gcc.dg/lto/pr88077_1.c new file mode 100644 index 00000000000..fd3de3e77a6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr88077_1.c @@ -0,0 +1,6 @@ +char HeaderStr[1]; + +int main() +{ + return 0; +} -- 2.19.1