This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: GCC 7 backports
- From: Martin Liška <mliska at suse dot cz>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 24 Apr 2018 17:14:05 +0200
- Subject: Re: GCC 7 backports
- References: <0d8e7755-5c98-28e0-4887-54e079928aea@suse.cz>
Hi.
I'm sending GCC 7 branch backports I've just tested and regbootstrapped.
I'm going to install that.
Thanks,
Martin
>From 3f14f2b8c441f2919a026bd86a5419f4fbdf33f5 Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue, 13 Mar 2018 08:20:27 +0000
Subject: [PATCH 1/9] Backport r258480
gcc/ChangeLog:
2018-03-13 Martin Liska <mliska@suse.cz>
PR ipa/84658.
* (sem_item_optimizer::sem_item_optimizer): Initialize new
vector.
(sem_item_optimizer::~sem_item_optimizer): Release it.
(sem_item_optimizer::merge_classes): Register variable aliases.
(sem_item_optimizer::fixup_pt_set): New function.
(sem_item_optimizer::fixup_points_to_sets): Likewise.
* ipa-icf.h: Declare new variables and functions.
gcc/testsuite/ChangeLog:
2018-03-13 Martin Liska <mliska@suse.cz>
PR ipa/84658.
* g++.dg/ipa/pr84658.C: New test.
---
gcc/ipa-icf.c | 112 ++++++++++++++++++++++++++++++-------
gcc/ipa-icf.h | 12 ++++
gcc/testsuite/g++.dg/ipa/pr84658.C | 30 ++++++++++
3 files changed, 134 insertions(+), 20 deletions(-)
create mode 100644 gcc/testsuite/g++.dg/ipa/pr84658.C
diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c
index 95fad30e83a..9ceee20b652 100644
--- a/gcc/ipa-icf.c
+++ b/gcc/ipa-icf.c
@@ -2132,23 +2132,6 @@ sem_variable::get_hash (void)
return m_hash;
}
-/* Set all points-to UIDs of aliases pointing to node N as UID. */
-
-static void
-set_alias_uids (symtab_node *n, int uid)
-{
- ipa_ref *ref;
- FOR_EACH_ALIAS (n, ref)
- {
- if (dump_file)
- fprintf (dump_file, " Setting points-to UID of [%s] as %d\n",
- xstrdup_for_dump (ref->referring->asm_name ()), uid);
-
- SET_DECL_PT_UID (ref->referring->decl, uid);
- set_alias_uids (ref->referring, uid);
- }
-}
-
/* Merges instance with an ALIAS_ITEM, where alias, thunk or redirection can
be applied. */
@@ -2275,7 +2258,6 @@ sem_variable::merge (sem_item *alias_item)
if (dump_file)
fprintf (dump_file, "Unified; Variable alias has been created.\n");
- set_alias_uids (original, DECL_UID (original->decl));
return true;
}
}
@@ -2295,7 +2277,7 @@ unsigned int sem_item_optimizer::class_id = 0;
sem_item_optimizer::sem_item_optimizer ()
: worklist (0), m_classes (0), m_classes_count (0), m_cgraph_node_hooks (NULL),
- m_varpool_node_hooks (NULL)
+ m_varpool_node_hooks (NULL), m_merged_variables ()
{
m_items.create (0);
bitmap_obstack_initialize (&m_bmstack);
@@ -2320,6 +2302,7 @@ sem_item_optimizer::~sem_item_optimizer ()
m_items.release ();
bitmap_obstack_release (&m_bmstack);
+ m_merged_variables.release ();
}
/* Write IPA ICF summary for symbols. */
@@ -3571,13 +3554,102 @@ sem_item_optimizer::merge_classes (unsigned int prev_class_count)
}
if (dbg_cnt (merged_ipa_icf))
- merged_p |= source->merge (alias);
+ {
+ bool merged = source->merge (alias);
+ merged_p |= merged;
+
+ if (merged && alias->type == VAR)
+ {
+ symtab_pair p = symtab_pair (source->node, alias->node);
+ m_merged_variables.safe_push (p);
+ }
+ }
}
}
+ if (!m_merged_variables.is_empty ())
+ fixup_points_to_sets ();
+
return merged_p;
}
+/* Fixup points to set PT. */
+
+void
+sem_item_optimizer::fixup_pt_set (struct pt_solution *pt)
+{
+ if (pt->vars == NULL)
+ return;
+
+ unsigned i;
+ symtab_pair *item;
+ FOR_EACH_VEC_ELT (m_merged_variables, i, item)
+ if (bitmap_bit_p (pt->vars, DECL_UID (item->second->decl)))
+ bitmap_set_bit (pt->vars, DECL_UID (item->first->decl));
+}
+
+/* Set all points-to UIDs of aliases pointing to node N as UID. */
+
+static void
+set_alias_uids (symtab_node *n, int uid)
+{
+ ipa_ref *ref;
+ FOR_EACH_ALIAS (n, ref)
+ {
+ if (dump_file)
+ fprintf (dump_file, " Setting points-to UID of [%s] as %d\n",
+ xstrdup_for_dump (ref->referring->asm_name ()), uid);
+
+ SET_DECL_PT_UID (ref->referring->decl, uid);
+ set_alias_uids (ref->referring, uid);
+ }
+}
+
+/* Fixup points to analysis info. */
+
+void
+sem_item_optimizer::fixup_points_to_sets (void)
+{
+ /* TODO: remove in GCC 9 and trigger PTA re-creation after IPA passes. */
+
+ cgraph_node *cnode;
+ return;
+
+ FOR_EACH_DEFINED_FUNCTION (cnode)
+ {
+ tree name;
+ unsigned i;
+ function *fn = DECL_STRUCT_FUNCTION (cnode->decl);
+ FOR_EACH_SSA_NAME (i, name, fn)
+ if (POINTER_TYPE_P (TREE_TYPE (name))
+ && SSA_NAME_PTR_INFO (name))
+ fixup_pt_set (&SSA_NAME_PTR_INFO (name)->pt);
+ fixup_pt_set (&fn->gimple_df->escaped);
+
+ /* The above get's us to 99% I guess, at least catching the
+ address compares. Below also gets us aliasing correct
+ but as said we're giving leeway to the situation with
+ readonly vars anyway, so ... */
+ basic_block bb;
+ FOR_EACH_BB_FN (bb, fn)
+ for (gimple_stmt_iterator gsi = gsi_start_bb (bb); !gsi_end_p (gsi);
+ gsi_next (&gsi))
+ {
+ gcall *call = dyn_cast<gcall *> (gsi_stmt (gsi));
+ if (call)
+ {
+ fixup_pt_set (gimple_call_use_set (call));
+ fixup_pt_set (gimple_call_clobber_set (call));
+ }
+ }
+ }
+
+ unsigned i;
+ symtab_pair *item;
+ FOR_EACH_VEC_ELT (m_merged_variables, i, item)
+ set_alias_uids (item->first, DECL_UID (item->first->decl));
+}
+
/* Dump function prints all class members to a FILE with an INDENT. */
void
diff --git a/gcc/ipa-icf.h b/gcc/ipa-icf.h
index c57224c1517..2101747bfd6 100644
--- a/gcc/ipa-icf.h
+++ b/gcc/ipa-icf.h
@@ -141,6 +141,8 @@ public:
unsigned int index;
};
+typedef std::pair<symtab_node *, symtab_node *> symtab_pair;
+
/* Semantic item is a base class that encapsulates all shared functionality
for both semantic function and variable items. */
class sem_item
@@ -563,6 +565,12 @@ private:
processed. */
bool merge_classes (unsigned int prev_class_count);
+ /* Fixup points to analysis info. */
+ void fixup_points_to_sets (void);
+
+ /* Fixup points to set PT. */
+ void fixup_pt_set (struct pt_solution *pt);
+
/* Adds a newly created congruence class CLS to worklist. */
void worklist_push (congruence_class *cls);
@@ -632,6 +640,10 @@ private:
/* Bitmap stack. */
bitmap_obstack m_bmstack;
+
+ /* Vector of merged variables. Needed for fixup of points-to-analysis
+ info. */
+ vec <symtab_pair> m_merged_variables;
}; // class sem_item_optimizer
} // ipa_icf namespace
diff --git a/gcc/testsuite/g++.dg/ipa/pr84658.C b/gcc/testsuite/g++.dg/ipa/pr84658.C
new file mode 100644
index 00000000000..6846e1832bd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ipa/pr84658.C
@@ -0,0 +1,30 @@
+/* PR ipa/84658 */
+/* { dg-do run } */
+/* { dg-options "-O2 -fmerge-all-constants -std=c++11" } */
+
+const int kTestCasesFoo[] = { 0, 1, 2, 3, 4, 5, 8, 15, 16, 17, 512, 1020, 1021, 1022, 1023, 1024 };
+const int kTestCasesBar[] = { 0, 1, 2, 3, 4, 5, 8, 15, 16, 17, 512, 1020, 1021, 1022, 1023, 1024 };
+
+void Foo() {
+ __builtin_printf("foo:");
+ for (int count : kTestCasesFoo) {
+ __builtin_printf("%d,", count);
+ }
+ __builtin_printf(";\n");
+}
+
+void Bar() {
+ __builtin_printf("bar:");
+ for (int count : kTestCasesBar) {
+ __builtin_printf("%d,", count);
+ }
+ __builtin_printf(";\n");
+}
+
+int main() {
+ Foo();
+ Bar();
+}
+
+/* { dg-output "foo:0,1,2,3,4,5,8,15,16,17,512,1020,1021,1022,1023,1024,;(\n|\n\r|\r)*" } */
+/* { dg-output "bar:0,1,2,3,4,5,8,15,16,17,512,1020,1021,1022,1023,1024,;(\n|\n\r|\r)*" } */
--
2.16.3
>From db9199c3581a3683862b381f68982fbed2089d48 Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed, 21 Mar 2018 08:26:49 +0000
Subject: [PATCH 2/9] Backport r258705
gcc/ChangeLog:
2018-03-21 Martin Liska <mliska@suse.cz>
PR ipa/84963
* ipa-icf.c (sem_item_optimizer::fixup_points_to_sets): Remove
not intended return statement.
gcc/testsuite/ChangeLog:
2018-03-21 Martin Liska <mliska@suse.cz>
PR ipa/84963
* gfortran.dg/goacc/pr84963.f90: New test.
---
gcc/ipa-icf.c | 5 +++--
gcc/testsuite/gfortran.dg/goacc/pr84963.f90 | 7 +++++++
2 files changed, 10 insertions(+), 2 deletions(-)
create mode 100644 gcc/testsuite/gfortran.dg/goacc/pr84963.f90
diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c
index 9ceee20b652..c8ca9566cb7 100644
--- a/gcc/ipa-icf.c
+++ b/gcc/ipa-icf.c
@@ -3611,15 +3611,16 @@ void
sem_item_optimizer::fixup_points_to_sets (void)
{
/* TODO: remove in GCC 9 and trigger PTA re-creation after IPA passes. */
-
cgraph_node *cnode;
- return;
FOR_EACH_DEFINED_FUNCTION (cnode)
{
tree name;
unsigned i;
function *fn = DECL_STRUCT_FUNCTION (cnode->decl);
+ if (!gimple_in_ssa_p (fn))
+ continue;
+
FOR_EACH_SSA_NAME (i, name, fn)
if (POINTER_TYPE_P (TREE_TYPE (name))
&& SSA_NAME_PTR_INFO (name))
diff --git a/gcc/testsuite/gfortran.dg/goacc/pr84963.f90 b/gcc/testsuite/gfortran.dg/goacc/pr84963.f90
new file mode 100644
index 00000000000..4548082bee3
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/goacc/pr84963.f90
@@ -0,0 +1,7 @@
+! PR ipa/84963
+! { dg-options "-O2" }
+
+program p
+ print *, sin([1.0, 2.0])
+ print *, cos([1.0, 2.0])
+end
--
2.16.3
>From fddf0d06affd9c378d26136728aa33ca03f481df Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed, 28 Mar 2018 14:45:21 +0000
Subject: [PATCH 3/9] Backport r258924
gcc/ChangeLog:
2018-03-28 Jakub Jelinek <jakub@redhat.com>
Martin Liska <mliska@suse.cz>
PR sanitizer/85081
* gimplify.c (asan_poison_variable): Don't do the check for
gimplify_omp_ctxp here.
(gimplify_decl_expr): Do it here.
(gimplify_target_expr): Likewise.
gcc/testsuite/ChangeLog:
2018-03-28 Jakub Jelinek <jakub@redhat.com>
Martin Liska <mliska@suse.cz>
PR sanitizer/85081
* g++.dg/asan/pr85081.C: New test.
---
gcc/gimplify.c | 10 ++++------
gcc/testsuite/g++.dg/asan/pr85081.C | 20 ++++++++++++++++++++
2 files changed, 24 insertions(+), 6 deletions(-)
create mode 100644 gcc/testsuite/g++.dg/asan/pr85081.C
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 5264a4f3d40..15fc7c9ae8f 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -1125,10 +1125,6 @@ static void
asan_poison_variable (tree decl, bool poison, gimple_stmt_iterator *it,
bool before)
{
- /* When within an OMP context, do not emit ASAN_MARK internal fns. */
- if (gimplify_omp_ctxp)
- return;
-
tree unit_size = DECL_SIZE_UNIT (decl);
tree base = build_fold_addr_expr (decl);
@@ -1640,7 +1636,8 @@ gimplify_decl_expr (tree *stmt_p, gimple_seq *seq_p)
&& TREE_ADDRESSABLE (decl)
&& !TREE_STATIC (decl)
&& !DECL_HAS_VALUE_EXPR_P (decl)
- && dbg_cnt (asan_use_after_scope))
+ && dbg_cnt (asan_use_after_scope)
+ && !gimplify_omp_ctxp)
{
asan_poisoned_variables->add (decl);
asan_poison_variable (decl, false, seq_p);
@@ -6458,7 +6455,8 @@ gimplify_target_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
clobber = build2 (MODIFY_EXPR, TREE_TYPE (temp), temp, clobber);
gimple_push_cleanup (temp, clobber, false, pre_p, true);
}
- if (asan_poisoned_variables && dbg_cnt (asan_use_after_scope))
+ if (asan_poisoned_variables && dbg_cnt (asan_use_after_scope)
+ && !gimplify_omp_ctxp)
{
tree asan_cleanup = build_asan_poison_call_expr (temp);
if (asan_cleanup)
diff --git a/gcc/testsuite/g++.dg/asan/pr85081.C b/gcc/testsuite/g++.dg/asan/pr85081.C
new file mode 100644
index 00000000000..d7dec311450
--- /dev/null
+++ b/gcc/testsuite/g++.dg/asan/pr85081.C
@@ -0,0 +1,20 @@
+/* PR sanitizer/85081 */
+/* { dg-do run } */
+/* { dg-options "-fopenmp-simd" } */
+/* { dg-require-effective-target fopenmp } */
+
+inline const int& max(const int& a, const int& b)
+{
+ return a < b ? b : a;
+}
+
+int main()
+{
+ #pragma omp simd
+ for ( int i = 0; i < 20; ++i )
+ {
+ const int j = max(i, 1);
+ }
+
+ return 0;
+}
--
2.16.3
>From a9309495755c107c6ef9d3704ba122f4c564192f Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue, 10 Apr 2018 07:24:59 +0000
Subject: [PATCH 4/9] Backport r259265
gcc/lto/ChangeLog:
2018-04-10 Richard Biener <rguenther@suse.de>
Martin Liska <mliska@suse.cz>
PR lto/85248
* lto-symtab.c (lto_symtab_merge_p): Handle noreturn attribute.
gcc/testsuite/ChangeLog:
2018-04-10 Jakub Jelinek <jakub@redhat.com>
PR lto/85248
* gcc.dg/lto/pr85248_0.c: New test.
* gcc.dg/lto/pr85248_1.c: New test.
---
gcc/lto/lto-symtab.c | 16 +++++++++++++
gcc/testsuite/gcc.dg/lto/pr85248_0.c | 45 ++++++++++++++++++++++++++++++++++++
gcc/testsuite/gcc.dg/lto/pr85248_1.c | 9 ++++++++
3 files changed, 70 insertions(+)
create mode 100644 gcc/testsuite/gcc.dg/lto/pr85248_0.c
create mode 100644 gcc/testsuite/gcc.dg/lto/pr85248_1.c
diff --git a/gcc/lto/lto-symtab.c b/gcc/lto/lto-symtab.c
index 4cef26897fe..2e7493fc539 100644
--- a/gcc/lto/lto-symtab.c
+++ b/gcc/lto/lto-symtab.c
@@ -571,6 +571,9 @@ lto_symtab_merge_p (tree prevailing, tree decl)
return false;
}
}
+
+ /* FIXME: after MPX is removed, use flags_from_decl_or_type
+ function instead. PR lto/85248. */
if (DECL_ATTRIBUTES (prevailing) != DECL_ATTRIBUTES (decl))
{
tree prev_attr = lookup_attribute ("error", DECL_ATTRIBUTES (prevailing));
@@ -598,6 +601,19 @@ lto_symtab_merge_p (tree prevailing, tree decl)
"warning attribute mismatch\n");
return false;
}
+
+ prev_attr = lookup_attribute ("noreturn", DECL_ATTRIBUTES (prevailing));
+ attr = lookup_attribute ("noreturn", DECL_ATTRIBUTES (decl));
+ if ((prev_attr == NULL) != (attr == NULL)
+ || (prev_attr
+ && TREE_VALUE (TREE_VALUE (prev_attr))
+ != TREE_VALUE (TREE_VALUE (attr))))
+ {
+ if (symtab->dump_file)
+ fprintf (symtab->dump_file, "Not merging decls; "
+ "noreturn attribute mismatch\n");
+ return false;
+ }
}
return true;
}
diff --git a/gcc/testsuite/gcc.dg/lto/pr85248_0.c b/gcc/testsuite/gcc.dg/lto/pr85248_0.c
new file mode 100644
index 00000000000..df61ac976a5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/pr85248_0.c
@@ -0,0 +1,45 @@
+/* PR lto/85248 */
+/* { dg-lto-do run } */
+/* { dg-lto-options { { -flto -O2 } } } */
+
+extern void test_alias (int s, int e) __asm__ (__USER_LABEL_PREFIX__ "test");
+extern void test_noreturn (int s, int e) __asm__ (__USER_LABEL_PREFIX__ "test")
+ __attribute__ ((__noreturn__));
+
+extern inline __attribute__ ((__always_inline__, __gnu_inline__)) void
+test (int s, int e)
+{
+ if (__builtin_constant_p (s) && s != 0)
+ test_noreturn (s, e);
+ else
+ test_alias (s, e);
+}
+
+int
+foo (void)
+{
+ static volatile int a;
+ return a;
+}
+
+static void
+bar (void)
+{
+ test (0, 1);
+ __builtin_exit (0);
+}
+
+static void
+baz ()
+{
+ test (1, 0);
+}
+
+int
+main ()
+{
+ if (foo ())
+ baz ();
+ bar ();
+ __builtin_abort ();
+}
diff --git a/gcc/testsuite/gcc.dg/lto/pr85248_1.c b/gcc/testsuite/gcc.dg/lto/pr85248_1.c
new file mode 100644
index 00000000000..5ce257181fb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/pr85248_1.c
@@ -0,0 +1,9 @@
+/* { dg-options "-fno-lto" } */
+
+void
+test (int s, int e)
+{
+ asm volatile ("" : "+g" (s), "+g" (e) : : "memory");
+ if (s)
+ __builtin_abort ();
+}
--
2.16.3
>From dd3d6bdea315707eb6c188439057adc55596bd50 Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue, 10 Apr 2018 13:52:23 +0000
Subject: [PATCH 5/9] Backport r259274
gcc/lto/ChangeLog:
2018-04-10 Martin Liska <mliska@suse.cz>
PR lto/85248
* lto-symtab.c (lto_symtab_merge_p): Do not check for
TREE_VALUES of error attributes.
---
gcc/lto/lto-symtab.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/gcc/lto/lto-symtab.c b/gcc/lto/lto-symtab.c
index 2e7493fc539..e76929ee588 100644
--- a/gcc/lto/lto-symtab.c
+++ b/gcc/lto/lto-symtab.c
@@ -604,10 +604,7 @@ lto_symtab_merge_p (tree prevailing, tree decl)
prev_attr = lookup_attribute ("noreturn", DECL_ATTRIBUTES (prevailing));
attr = lookup_attribute ("noreturn", DECL_ATTRIBUTES (decl));
- if ((prev_attr == NULL) != (attr == NULL)
- || (prev_attr
- && TREE_VALUE (TREE_VALUE (prev_attr))
- != TREE_VALUE (TREE_VALUE (attr))))
+ if ((prev_attr == NULL) != (attr == NULL))
{
if (symtab->dump_file)
fprintf (symtab->dump_file, "Not merging decls; "
--
2.16.3
>From f2d0f4621a50af541a600134bcee1ceb315ccd5c Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue, 17 Apr 2018 05:41:40 +0000
Subject: [PATCH 6/9] Backport r259429
gcc/ChangeLog:
2018-04-17 Jan Hubicka <jh@suse.cz>
PR lto/85405
* ipa-devirt.c (odr_types_equivalent_p): Handle bit fields.
---
gcc/ipa-devirt.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c
index 0d214170c24..72f790ffc34 100644
--- a/gcc/ipa-devirt.c
+++ b/gcc/ipa-devirt.c
@@ -1577,8 +1577,15 @@ odr_types_equivalent_p (tree t1, tree t2, bool warn, bool *warned,
"in another translation unit"));
return false;
}
- gcc_assert (DECL_NONADDRESSABLE_P (f1)
- == DECL_NONADDRESSABLE_P (f2));
+ if (DECL_BIT_FIELD (f1) != DECL_BIT_FIELD (f2))
+ {
+ warn_odr (t1, t2, f1, f2, warn, warned,
+ G_ ("one field is bitfield while other is not "));
+ return false;
+ }
+ else
+ gcc_assert (DECL_NONADDRESSABLE_P (f1)
+ == DECL_NONADDRESSABLE_P (f2));
}
/* If one aggregate has more fields than the other, they
--
2.16.3
>From 8051b1fa3ddd828b1fb5a1d3a1669b6f29759bd1 Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue, 17 Apr 2018 08:28:21 +0000
Subject: [PATCH 7/9] Backport r259431
gcc/ChangeLog:
2018-04-17 Martin Liska <mliska@suse.cz>
PR lto/85405
* ipa-devirt.c (odr_types_equivalent_p): Remove trailing
in message, remote space in between '_G' and '('.
---
gcc/ipa-devirt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c
index 72f790ffc34..c1b7aa3bea6 100644
--- a/gcc/ipa-devirt.c
+++ b/gcc/ipa-devirt.c
@@ -1580,7 +1580,7 @@ odr_types_equivalent_p (tree t1, tree t2, bool warn, bool *warned,
if (DECL_BIT_FIELD (f1) != DECL_BIT_FIELD (f2))
{
warn_odr (t1, t2, f1, f2, warn, warned,
- G_ ("one field is bitfield while other is not "));
+ G_("one field is bitfield while other is not"));
return false;
}
else
--
2.16.3
>From 47b86ec9ff8a85600dea18e8e0079e43c01a3917 Mon Sep 17 00:00:00 2001
From: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed, 18 Apr 2018 07:02:40 +0000
Subject: [PATCH 8/9] Backport r259459
libsanitizer/ChangeLog:
2018-04-18 Bill Seurer <seurer@linux.vnet.ibm.com>
PR sanitizer/85389
* asan/asan_allocator.h (kAllocatorSpace): For __powerpc64__ change
from 0xa0000000000ULL to ~(uptr)0.
---
libsanitizer/asan/asan_allocator.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libsanitizer/asan/asan_allocator.h b/libsanitizer/asan/asan_allocator.h
index 7eeddadd547..dacfddd5ddf 100644
--- a/libsanitizer/asan/asan_allocator.h
+++ b/libsanitizer/asan/asan_allocator.h
@@ -115,7 +115,7 @@ struct AsanMapUnmapCallback {
#if SANITIZER_CAN_USE_ALLOCATOR64
# if defined(__powerpc64__)
-const uptr kAllocatorSpace = 0xa0000000000ULL;
+const uptr kAllocatorSpace = ~(uptr)0;
const uptr kAllocatorSize = 0x20000000000ULL; // 2T.
typedef DefaultSizeClassMap SizeClassMap;
# elif defined(__aarch64__) && SANITIZER_ANDROID
--
2.16.3
>From 6cfea508597add1f86dc96d87dbd8c1e2460a249 Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Thu, 19 Apr 2018 08:42:52 +0000
Subject: [PATCH 9/9] Backport r259490
gcc/lto/ChangeLog:
2018-04-19 Martin Liska <mliska@suse.cz>
* lto-symtab.c (lto_symtab_resolve_symbols): Do not bail out
for multiple PREVAILING_DEF_IRONLY for common symbols.
---
gcc/lto/lto-symtab.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/gcc/lto/lto-symtab.c b/gcc/lto/lto-symtab.c
index e76929ee588..65eb2b58c72 100644
--- a/gcc/lto/lto-symtab.c
+++ b/gcc/lto/lto-symtab.c
@@ -465,9 +465,14 @@ lto_symtab_resolve_symbols (symtab_node *first)
/* If the chain is already resolved there is nothing else to do. */
if (prevailing)
{
- /* Assert it's the only one. */
+ /* Assert it's the only one.
+ GCC should silence multiple PREVAILING_DEF_IRONLY defs error
+ on COMMON symbols since it isn't error.
+ See: https://sourceware.org/bugzilla/show_bug.cgi?id=23079. */
for (e = prevailing->next_sharing_asm_name; e; e = e->next_sharing_asm_name)
if (lto_symtab_symbol_p (e)
+ && !DECL_COMMON (prevailing->decl)
+ && !DECL_COMMON (e->decl)
&& (e->resolution == LDPR_PREVAILING_DEF_IRONLY
|| e->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP
|| e->resolution == LDPR_PREVAILING_DEF))
--
2.16.3