Fix condition in lto-symtab.c (PR lto/88077).
authorMartin Liska <mliska@suse.cz>
Mon, 19 Nov 2018 15:00:41 +0000 (16:00 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Mon, 19 Nov 2018 15:00:41 +0000 (15:00 +0000)
2018-11-19  Martin Liska  <mliska@suse.cz>

PR lto/88077
* lto-symtab.c (lto_symtab_merge): Transform the
condition before r256989.
2018-11-19  Martin Liska  <mliska@suse.cz>

PR lto/88077
* gcc.dg/lto/pr88077_0.c: New test.
* gcc.dg/lto/pr88077_1.c: New test.

From-SVN: r266277

gcc/lto/ChangeLog
gcc/lto/lto-symtab.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/lto/pr88077_0.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/lto/pr88077_1.c [new file with mode: 0644]

index 4798663336c76e2790f920706e36e69f1130adf2..4731e3f33b9fbb57a5d26860118c64af694eb496 100644 (file)
@@ -1,3 +1,9 @@
+2018-11-19  Martin Liska  <mliska@suse.cz>
+
+       PR lto/88077
+       * lto-symtab.c (lto_symtab_merge): Transform the
+       condition before r256989.
+
 2018-11-16  Martin Liska  <mliska@suse.cz>
 
        PR lto/88004
index 18437eb2841120613c3fe1813c9e9ec23a2dd75a..d018a16bd42985fa745de245352d715e0c5e8329 100644 (file)
@@ -374,8 +374,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;
index 0c8672175617262861037c26bb670057f104cb0e..2b9f0c483ad8e6dbbd85625f1539520756a74cad 100644 (file)
        PR lto/87229
        * g++.dg/lto/pr87229_0.C: New testcase.
 
+2018-11-19  Martin Liska  <mliska@suse.cz>
+
+       PR lto/88077
+       * gcc.dg/lto/pr88077_0.c: New test.
+       * gcc.dg/lto/pr88077_1.c: New test.
+
 2018-11-19  Martin Liska  <mliska@suse.cz>
 
        * g++.dg/gcov/pr84548.C: Remove remove-gcda.
diff --git a/gcc/testsuite/gcc.dg/lto/pr88077_0.c b/gcc/testsuite/gcc.dg/lto/pr88077_0.c
new file mode 100644 (file)
index 0000000..9e464b6
--- /dev/null
@@ -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 (file)
index 0000000..fd3de3e
--- /dev/null
@@ -0,0 +1,6 @@
+char HeaderStr[1];
+
+int main()
+{
+  return 0;
+}