7.2.1-5
This commit is contained in:
parent
3597b2c793
commit
2678e30d91
17
gcc.spec
17
gcc.spec
@ -235,12 +235,8 @@ Patch8: gcc7-no-add-needed.patch
|
|||||||
Patch9: gcc7-aarch64-async-unw-tables.patch
|
Patch9: gcc7-aarch64-async-unw-tables.patch
|
||||||
Patch10: gcc7-foffload-default.patch
|
Patch10: gcc7-foffload-default.patch
|
||||||
Patch11: gcc7-Wno-format-security.patch
|
Patch11: gcc7-Wno-format-security.patch
|
||||||
Patch12: gcc7-pr81314.patch
|
Patch12: gcc7-pr83556.patch
|
||||||
Patch13: gcc7-pr81325.patch
|
Patch13: gcc7-aarch64-sanitizer-fix.patch
|
||||||
Patch14: gcc7-pr82112-1.patch
|
|
||||||
Patch15: gcc7-pr82112-2.patch
|
|
||||||
Patch16: gcc7-pr81929.patch
|
|
||||||
Patch17: gcc7-aarch64-sanitizer-fix.patch
|
|
||||||
|
|
||||||
Patch1000: nvptx-tools-no-ptxas.patch
|
Patch1000: nvptx-tools-no-ptxas.patch
|
||||||
Patch1001: nvptx-tools-build.patch
|
Patch1001: nvptx-tools-build.patch
|
||||||
@ -847,13 +843,9 @@ package or when debugging this package.
|
|||||||
%patch9 -p0 -b .aarch64-async-unw-tables~
|
%patch9 -p0 -b .aarch64-async-unw-tables~
|
||||||
%patch10 -p0 -b .foffload-default~
|
%patch10 -p0 -b .foffload-default~
|
||||||
%patch11 -p0 -b .Wno-format-security~
|
%patch11 -p0 -b .Wno-format-security~
|
||||||
%patch12 -p0 -b .pr81314~
|
%patch12 -p0 -b .pr83556~
|
||||||
%patch13 -p0 -b .pr81325~
|
|
||||||
%patch14 -p0 -b .pr82112-1~
|
|
||||||
%patch15 -p0 -b .pr82112-2~
|
|
||||||
%patch16 -p0 -b .pr81929~
|
|
||||||
%if 0%{?fedora} > 27
|
%if 0%{?fedora} > 27
|
||||||
%patch17 -p0 -b .aarch64-sanitizer-fix~
|
%patch13 -p0 -b .aarch64-sanitizer-fix~
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
cd nvptx-tools-%{nvptx_tools_gitrev}
|
cd nvptx-tools-%{nvptx_tools_gitrev}
|
||||||
@ -3344,6 +3336,7 @@ fi
|
|||||||
- fix sccvn ICE (#1506809, PR tree-optimization/82264)
|
- fix sccvn ICE (#1506809, PR tree-optimization/82264)
|
||||||
- fix ICE in dwarf2out force_type_die (#1516576, #1516577, PR debug/82155)
|
- fix ICE in dwarf2out force_type_die (#1516576, #1516577, PR debug/82155)
|
||||||
- fix power6 ICE in store_data_bypass_p (#1522675, PR target/80101)
|
- fix power6 ICE in store_data_bypass_p (#1522675, PR target/80101)
|
||||||
|
- fix replace_placeholders (PR c++/83556)
|
||||||
|
|
||||||
* Wed Nov 29 2017 Jeff Law <law@redhat.com> 7.2.1-4
|
* Wed Nov 29 2017 Jeff Law <law@redhat.com> 7.2.1-4
|
||||||
- Fix problem with large outgoing args and -fstack-clash-protection
|
- Fix problem with large outgoing args and -fstack-clash-protection
|
||||||
|
@ -1,72 +0,0 @@
|
|||||||
2017-09-15 Jakub Jelinek <jakub@redhat.com>
|
|
||||||
|
|
||||||
Backported from mainline
|
|
||||||
2017-09-14 Jakub Jelinek <jakub@redhat.com>
|
|
||||||
|
|
||||||
PR c++/81314
|
|
||||||
* cp-gimplify.c (omp_var_to_track): Look through references.
|
|
||||||
(omp_cxx_notice_variable): Likewise.
|
|
||||||
|
|
||||||
* testsuite/libgomp.c++/pr81314.C: New test.
|
|
||||||
|
|
||||||
--- gcc/cp/cp-gimplify.c (revision 252769)
|
|
||||||
+++ gcc/cp/cp-gimplify.c (revision 252770)
|
|
||||||
@@ -895,6 +895,8 @@ omp_var_to_track (tree decl)
|
|
||||||
tree type = TREE_TYPE (decl);
|
|
||||||
if (is_invisiref_parm (decl))
|
|
||||||
type = TREE_TYPE (type);
|
|
||||||
+ else if (TREE_CODE (type) == REFERENCE_TYPE)
|
|
||||||
+ type = TREE_TYPE (type);
|
|
||||||
while (TREE_CODE (type) == ARRAY_TYPE)
|
|
||||||
type = TREE_TYPE (type);
|
|
||||||
if (type == error_mark_node || !CLASS_TYPE_P (type))
|
|
||||||
@@ -947,6 +949,8 @@ omp_cxx_notice_variable (struct cp_gener
|
|
||||||
tree type = TREE_TYPE (decl);
|
|
||||||
if (is_invisiref_parm (decl))
|
|
||||||
type = TREE_TYPE (type);
|
|
||||||
+ else if (TREE_CODE (type) == REFERENCE_TYPE)
|
|
||||||
+ type = TREE_TYPE (type);
|
|
||||||
while (TREE_CODE (type) == ARRAY_TYPE)
|
|
||||||
type = TREE_TYPE (type);
|
|
||||||
get_copy_ctor (type, tf_none);
|
|
||||||
--- libgomp/testsuite/libgomp.c++/pr81314.C (nonexistent)
|
|
||||||
+++ libgomp/testsuite/libgomp.c++/pr81314.C (revision 252770)
|
|
||||||
@@ -0,0 +1,38 @@
|
|
||||||
+// PR c++/81314
|
|
||||||
+// { dg-do link }
|
|
||||||
+
|
|
||||||
+template <int N>
|
|
||||||
+struct S {
|
|
||||||
+ S () { s = 0; }
|
|
||||||
+ S (const S &x) { s = x.s; }
|
|
||||||
+ ~S () {}
|
|
||||||
+ int s;
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+void
|
|
||||||
+foo (S<2> &x)
|
|
||||||
+{
|
|
||||||
+ #pragma omp taskloop
|
|
||||||
+ for (int i = 0; i < 100; ++i)
|
|
||||||
+ x.s++;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void
|
|
||||||
+bar (S<3> &x)
|
|
||||||
+{
|
|
||||||
+ #pragma omp task
|
|
||||||
+ x.s++;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+int
|
|
||||||
+main ()
|
|
||||||
+{
|
|
||||||
+ S<2> s;
|
|
||||||
+ S<3> t;
|
|
||||||
+ #pragma omp parallel
|
|
||||||
+ #pragma omp master
|
|
||||||
+ {
|
|
||||||
+ foo (s);
|
|
||||||
+ bar (t);
|
|
||||||
+ }
|
|
||||||
+}
|
|
@ -1,199 +0,0 @@
|
|||||||
2017-09-15 Jakub Jelinek <jakub@redhat.com>
|
|
||||||
|
|
||||||
Backported from mainline
|
|
||||||
2017-09-14 Jakub Jelinek <jakub@redhat.com>
|
|
||||||
|
|
||||||
PR target/81325
|
|
||||||
* cfgbuild.c (find_bb_boundaries): Ignore debug insns in decisions
|
|
||||||
if and where to split a bb, except for splitting before debug insn
|
|
||||||
sequences followed by non-label real insn. Delete debug insns
|
|
||||||
in between basic blocks.
|
|
||||||
|
|
||||||
* g++.dg/cpp0x/pr81325.C: New test.
|
|
||||||
|
|
||||||
--- gcc/cfgbuild.c (revision 252751)
|
|
||||||
+++ gcc/cfgbuild.c (revision 252752)
|
|
||||||
@@ -442,9 +442,10 @@ find_bb_boundaries (basic_block bb)
|
|
||||||
rtx_insn *end = BB_END (bb), *x;
|
|
||||||
rtx_jump_table_data *table;
|
|
||||||
rtx_insn *flow_transfer_insn = NULL;
|
|
||||||
+ rtx_insn *debug_insn = NULL;
|
|
||||||
edge fallthru = NULL;
|
|
||||||
|
|
||||||
- if (insn == BB_END (bb))
|
|
||||||
+ if (insn == end)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (LABEL_P (insn))
|
|
||||||
@@ -455,27 +456,49 @@ find_bb_boundaries (basic_block bb)
|
|
||||||
{
|
|
||||||
enum rtx_code code = GET_CODE (insn);
|
|
||||||
|
|
||||||
+ if (code == DEBUG_INSN)
|
|
||||||
+ {
|
|
||||||
+ if (flow_transfer_insn && !debug_insn)
|
|
||||||
+ debug_insn = insn;
|
|
||||||
+ }
|
|
||||||
/* In case we've previously seen an insn that effects a control
|
|
||||||
flow transfer, split the block. */
|
|
||||||
- if ((flow_transfer_insn || code == CODE_LABEL)
|
|
||||||
- && inside_basic_block_p (insn))
|
|
||||||
+ else if ((flow_transfer_insn || code == CODE_LABEL)
|
|
||||||
+ && inside_basic_block_p (insn))
|
|
||||||
{
|
|
||||||
- fallthru = split_block (bb, PREV_INSN (insn));
|
|
||||||
+ rtx_insn *prev = PREV_INSN (insn);
|
|
||||||
+
|
|
||||||
+ /* If the first non-debug inside_basic_block_p insn after a control
|
|
||||||
+ flow transfer is not a label, split the block before the debug
|
|
||||||
+ insn instead of before the non-debug insn, so that the debug
|
|
||||||
+ insns are not lost. */
|
|
||||||
+ if (debug_insn && code != CODE_LABEL && code != BARRIER)
|
|
||||||
+ prev = PREV_INSN (debug_insn);
|
|
||||||
+ fallthru = split_block (bb, prev);
|
|
||||||
if (flow_transfer_insn)
|
|
||||||
{
|
|
||||||
BB_END (bb) = flow_transfer_insn;
|
|
||||||
|
|
||||||
+ rtx_insn *next;
|
|
||||||
/* Clean up the bb field for the insns between the blocks. */
|
|
||||||
for (x = NEXT_INSN (flow_transfer_insn);
|
|
||||||
x != BB_HEAD (fallthru->dest);
|
|
||||||
- x = NEXT_INSN (x))
|
|
||||||
- if (!BARRIER_P (x))
|
|
||||||
- set_block_for_insn (x, NULL);
|
|
||||||
+ x = next)
|
|
||||||
+ {
|
|
||||||
+ next = NEXT_INSN (x);
|
|
||||||
+ /* Debug insns should not be in between basic blocks,
|
|
||||||
+ drop them on the floor. */
|
|
||||||
+ if (DEBUG_INSN_P (x))
|
|
||||||
+ delete_insn (x);
|
|
||||||
+ else if (!BARRIER_P (x))
|
|
||||||
+ set_block_for_insn (x, NULL);
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
bb = fallthru->dest;
|
|
||||||
remove_edge (fallthru);
|
|
||||||
flow_transfer_insn = NULL;
|
|
||||||
+ debug_insn = NULL;
|
|
||||||
if (code == CODE_LABEL && LABEL_ALT_ENTRY_P (insn))
|
|
||||||
make_edge (ENTRY_BLOCK_PTR_FOR_FN (cfun), bb, 0);
|
|
||||||
}
|
|
||||||
@@ -498,17 +521,23 @@ find_bb_boundaries (basic_block bb)
|
|
||||||
/* In case expander replaced normal insn by sequence terminating by
|
|
||||||
return and barrier, or possibly other sequence not behaving like
|
|
||||||
ordinary jump, we need to take care and move basic block boundary. */
|
|
||||||
- if (flow_transfer_insn)
|
|
||||||
+ if (flow_transfer_insn && flow_transfer_insn != end)
|
|
||||||
{
|
|
||||||
BB_END (bb) = flow_transfer_insn;
|
|
||||||
|
|
||||||
/* Clean up the bb field for the insns that do not belong to BB. */
|
|
||||||
- x = flow_transfer_insn;
|
|
||||||
- while (x != end)
|
|
||||||
+ rtx_insn *next;
|
|
||||||
+ for (x = NEXT_INSN (flow_transfer_insn); ; x = next)
|
|
||||||
{
|
|
||||||
- x = NEXT_INSN (x);
|
|
||||||
- if (!BARRIER_P (x))
|
|
||||||
+ next = NEXT_INSN (x);
|
|
||||||
+ /* Debug insns should not be in between basic blocks,
|
|
||||||
+ drop them on the floor. */
|
|
||||||
+ if (DEBUG_INSN_P (x))
|
|
||||||
+ delete_insn (x);
|
|
||||||
+ else if (!BARRIER_P (x))
|
|
||||||
set_block_for_insn (x, NULL);
|
|
||||||
+ if (x == end)
|
|
||||||
+ break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
--- gcc/testsuite/g++.dg/cpp0x/pr81325.C (nonexistent)
|
|
||||||
+++ gcc/testsuite/g++.dg/cpp0x/pr81325.C (revision 252752)
|
|
||||||
@@ -0,0 +1,84 @@
|
|
||||||
+// PR target/81325
|
|
||||||
+// { dg-do compile { target c++11 } }
|
|
||||||
+// { dg-options "-O2 -fcompare-debug" }
|
|
||||||
+
|
|
||||||
+struct A { A(const char *, const int & = 0); };
|
|
||||||
+template <typename> struct B;
|
|
||||||
+template <typename> struct C {
|
|
||||||
+ int _M_i;
|
|
||||||
+ void m_fn1() { __atomic_fetch_add(&_M_i, 0, __ATOMIC_RELAXED); }
|
|
||||||
+};
|
|
||||||
+struct D {
|
|
||||||
+ int *Data;
|
|
||||||
+ long Length = 0;
|
|
||||||
+ D(int) : Data() {}
|
|
||||||
+};
|
|
||||||
+template <> struct B<int> : C<int> {};
|
|
||||||
+struct F {
|
|
||||||
+ B<int> RefCount;
|
|
||||||
+ void m_fn2() { RefCount.m_fn1(); }
|
|
||||||
+};
|
|
||||||
+struct G {
|
|
||||||
+ F *Obj;
|
|
||||||
+ G(const G &p1) : Obj(p1.Obj) {
|
|
||||||
+ if (Obj) {
|
|
||||||
+ F *a = 0;
|
|
||||||
+ a->m_fn2();
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+};
|
|
||||||
+struct H {
|
|
||||||
+ int CPlusPlus : 1;
|
|
||||||
+};
|
|
||||||
+struct I {
|
|
||||||
+ enum {} KindId;
|
|
||||||
+};
|
|
||||||
+template <typename ResultT, typename ArgT> struct J {
|
|
||||||
+ void operator()();
|
|
||||||
+ ResultT operator()(ArgT) {}
|
|
||||||
+};
|
|
||||||
+struct K {
|
|
||||||
+ int AllowBind;
|
|
||||||
+ I SupportedKind;
|
|
||||||
+ I RestrictKind;
|
|
||||||
+ G Implementation;
|
|
||||||
+};
|
|
||||||
+struct L {
|
|
||||||
+ L(int) : Implementation(Implementation) {}
|
|
||||||
+ K Implementation;
|
|
||||||
+};
|
|
||||||
+struct M {
|
|
||||||
+ int Param1;
|
|
||||||
+};
|
|
||||||
+struct N {
|
|
||||||
+ N(int, L &p2) : Param2(p2) {}
|
|
||||||
+ L Param2;
|
|
||||||
+};
|
|
||||||
+struct O {
|
|
||||||
+ L m_fn3();
|
|
||||||
+};
|
|
||||||
+L ignoringImpCasts(L);
|
|
||||||
+J<O, L> b;
|
|
||||||
+L hasName(const A &);
|
|
||||||
+M hasOverloadedOperatorName(D);
|
|
||||||
+J<O, int> c;
|
|
||||||
+struct P {
|
|
||||||
+ void m_fn4(L, int);
|
|
||||||
+};
|
|
||||||
+struct Q {
|
|
||||||
+ void m_fn5(P *);
|
|
||||||
+};
|
|
||||||
+H d;
|
|
||||||
+void Q::m_fn5(P *p1) {
|
|
||||||
+ if (!d.CPlusPlus) {
|
|
||||||
+ c();
|
|
||||||
+ L e = 0, f = ignoringImpCasts(e);
|
|
||||||
+ b(ignoringImpCasts(f)).m_fn3();
|
|
||||||
+ }
|
|
||||||
+ hasOverloadedOperatorName(0);
|
|
||||||
+ hasName("");
|
|
||||||
+ L g = 0;
|
|
||||||
+ N(0, g);
|
|
||||||
+ L h(0);
|
|
||||||
+ p1->m_fn4(h, 0);
|
|
||||||
+}
|
|
@ -1,73 +0,0 @@
|
|||||||
2017-09-14 Jakub Jelinek <jakub@redhat.com>
|
|
||||||
|
|
||||||
PR sanitizer/81929
|
|
||||||
* tree.c (struct replace_placeholders_t): Add pset field.
|
|
||||||
(replace_placeholders_r): Call cp_walk_tree with d->pset as
|
|
||||||
last argument instead of NULL. Formatting fix.
|
|
||||||
(replace_placeholders): Add pset variable, add its address
|
|
||||||
into data. Pass &pset instead of NULL to cp_walk_tree.
|
|
||||||
|
|
||||||
* g++.dg/ubsan/pr81929.C: New test.
|
|
||||||
|
|
||||||
--- gcc/cp/tree.c.jj 2017-09-12 09:35:47.000000000 +0200
|
|
||||||
+++ gcc/cp/tree.c 2017-09-14 17:38:07.717064412 +0200
|
|
||||||
@@ -3063,6 +3063,7 @@ struct replace_placeholders_t
|
|
||||||
{
|
|
||||||
tree obj; /* The object to be substituted for a PLACEHOLDER_EXPR. */
|
|
||||||
bool seen; /* Whether we've encountered a PLACEHOLDER_EXPR. */
|
|
||||||
+ hash_set<tree> *pset; /* To avoid walking same trees multiple times. */
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Like substitute_placeholder_in_expr, but handle C++ tree codes and
|
|
||||||
@@ -3085,8 +3086,8 @@ replace_placeholders_r (tree* t, int* wa
|
|
||||||
case PLACEHOLDER_EXPR:
|
|
||||||
{
|
|
||||||
tree x = obj;
|
|
||||||
- for (; !(same_type_ignoring_top_level_qualifiers_p
|
|
||||||
- (TREE_TYPE (*t), TREE_TYPE (x)));
|
|
||||||
+ for (; !same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (*t),
|
|
||||||
+ TREE_TYPE (x));
|
|
||||||
x = TREE_OPERAND (x, 0))
|
|
||||||
gcc_assert (TREE_CODE (x) == COMPONENT_REF);
|
|
||||||
*t = x;
|
|
||||||
@@ -3118,8 +3119,7 @@ replace_placeholders_r (tree* t, int* wa
|
|
||||||
valp = &TARGET_EXPR_INITIAL (*valp);
|
|
||||||
}
|
|
||||||
d->obj = subob;
|
|
||||||
- cp_walk_tree (valp, replace_placeholders_r,
|
|
||||||
- data_, NULL);
|
|
||||||
+ cp_walk_tree (valp, replace_placeholders_r, data_, d->pset);
|
|
||||||
d->obj = obj;
|
|
||||||
}
|
|
||||||
*walk_subtrees = false;
|
|
||||||
@@ -3151,10 +3151,11 @@ replace_placeholders (tree exp, tree obj
|
|
||||||
return exp;
|
|
||||||
|
|
||||||
tree *tp = &exp;
|
|
||||||
- replace_placeholders_t data = { obj, false };
|
|
||||||
+ hash_set<tree> pset;
|
|
||||||
+ replace_placeholders_t data = { obj, false, &pset };
|
|
||||||
if (TREE_CODE (exp) == TARGET_EXPR)
|
|
||||||
tp = &TARGET_EXPR_INITIAL (exp);
|
|
||||||
- cp_walk_tree (tp, replace_placeholders_r, &data, NULL);
|
|
||||||
+ cp_walk_tree (tp, replace_placeholders_r, &data, &pset);
|
|
||||||
if (seen_p)
|
|
||||||
*seen_p = data.seen;
|
|
||||||
return exp;
|
|
||||||
--- gcc/testsuite/g++.dg/ubsan/pr81929.C.jj 2017-09-14 17:48:09.052611540 +0200
|
|
||||||
+++ gcc/testsuite/g++.dg/ubsan/pr81929.C 2017-09-14 17:49:21.644711332 +0200
|
|
||||||
@@ -0,0 +1,14 @@
|
|
||||||
+// PR sanitizer/81929
|
|
||||||
+// { dg-do compile }
|
|
||||||
+// { dg-options "-std=c++14 -fsanitize=undefined" }
|
|
||||||
+
|
|
||||||
+struct S { S &operator<< (long); S foo (); S (); };
|
|
||||||
+
|
|
||||||
+void
|
|
||||||
+bar ()
|
|
||||||
+{
|
|
||||||
+ static_cast<S&>(S () << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0
|
|
||||||
+ << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0
|
|
||||||
+ << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0
|
|
||||||
+ << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0).foo ();
|
|
||||||
+}
|
|
@ -1,94 +0,0 @@
|
|||||||
2017-09-15 Jakub Jelinek <jakub@redhat.com>
|
|
||||||
|
|
||||||
Backported from mainline
|
|
||||||
2017-09-12 Jakub Jelinek <jakub@redhat.com>
|
|
||||||
|
|
||||||
PR target/82112
|
|
||||||
* c-common.c (sync_resolve_size): Instead of c_dialect_cxx ()
|
|
||||||
assertion check that in the condition.
|
|
||||||
(get_atomic_generic_size): Likewise. Before testing if parameter
|
|
||||||
has pointer type, if it has array type, call for C++
|
|
||||||
default_conversion to perform array-to-pointer conversion.
|
|
||||||
|
|
||||||
* c-c++-common/pr82112.c: New test.
|
|
||||||
* gcc.dg/pr82112.c: New test.
|
|
||||||
|
|
||||||
--- gcc/c-family/c-common.c (revision 252002)
|
|
||||||
+++ gcc/c-family/c-common.c (revision 252003)
|
|
||||||
@@ -6478,10 +6478,9 @@ sync_resolve_size (tree function, vec<tr
|
|
||||||
}
|
|
||||||
|
|
||||||
argtype = type = TREE_TYPE ((*params)[0]);
|
|
||||||
- if (TREE_CODE (type) == ARRAY_TYPE)
|
|
||||||
+ if (TREE_CODE (type) == ARRAY_TYPE && c_dialect_cxx ())
|
|
||||||
{
|
|
||||||
/* Force array-to-pointer decay for C++. */
|
|
||||||
- gcc_assert (c_dialect_cxx());
|
|
||||||
(*params)[0] = default_conversion ((*params)[0]);
|
|
||||||
type = TREE_TYPE ((*params)[0]);
|
|
||||||
}
|
|
||||||
@@ -6646,10 +6645,9 @@ get_atomic_generic_size (location_t loc,
|
|
||||||
|
|
||||||
/* Get type of first parameter, and determine its size. */
|
|
||||||
type_0 = TREE_TYPE ((*params)[0]);
|
|
||||||
- if (TREE_CODE (type_0) == ARRAY_TYPE)
|
|
||||||
+ if (TREE_CODE (type_0) == ARRAY_TYPE && c_dialect_cxx ())
|
|
||||||
{
|
|
||||||
/* Force array-to-pointer decay for C++. */
|
|
||||||
- gcc_assert (c_dialect_cxx());
|
|
||||||
(*params)[0] = default_conversion ((*params)[0]);
|
|
||||||
type_0 = TREE_TYPE ((*params)[0]);
|
|
||||||
}
|
|
||||||
@@ -6688,6 +6686,12 @@ get_atomic_generic_size (location_t loc,
|
|
||||||
/* __atomic_compare_exchange has a bool in the 4th position, skip it. */
|
|
||||||
if (n_param == 6 && x == 3)
|
|
||||||
continue;
|
|
||||||
+ if (TREE_CODE (type) == ARRAY_TYPE && c_dialect_cxx ())
|
|
||||||
+ {
|
|
||||||
+ /* Force array-to-pointer decay for C++. */
|
|
||||||
+ (*params)[x] = default_conversion ((*params)[x]);
|
|
||||||
+ type = TREE_TYPE ((*params)[x]);
|
|
||||||
+ }
|
|
||||||
if (!POINTER_TYPE_P (type))
|
|
||||||
{
|
|
||||||
error_at (loc, "argument %d of %qE must be a pointer type", x + 1,
|
|
||||||
--- gcc/testsuite/gcc.dg/pr82112.c (nonexistent)
|
|
||||||
+++ gcc/testsuite/gcc.dg/pr82112.c (revision 252003)
|
|
||||||
@@ -0,0 +1,21 @@
|
|
||||||
+/* PR target/82112 */
|
|
||||||
+/* { dg-do compile } */
|
|
||||||
+/* { dg-options "-std=gnu90" } */
|
|
||||||
+
|
|
||||||
+struct S { int a[10]; } bar (void);
|
|
||||||
+int b, c;
|
|
||||||
+
|
|
||||||
+void
|
|
||||||
+foo (void)
|
|
||||||
+{
|
|
||||||
+ __atomic_load (bar ().a, &b, __ATOMIC_ACQUIRE); /* { dg-error "argument 1 of .__atomic_load. must be a non-void pointer type" } */
|
|
||||||
+ __atomic_load (&b, bar ().a, __ATOMIC_ACQUIRE); /* { dg-error "argument 2 of .__atomic_load. must be a pointer type" } */
|
|
||||||
+ __atomic_store (bar ().a, &b, __ATOMIC_SEQ_CST); /* { dg-error "argument 1 of .__atomic_store. must be a non-void pointer type" } */
|
|
||||||
+ __atomic_store (&b, bar ().a, __ATOMIC_SEQ_CST); /* { dg-error "argument 2 of .__atomic_store. must be a pointer type" } */
|
|
||||||
+ __atomic_exchange (bar ().a, &b, &c, __ATOMIC_RELAXED); /* { dg-error "argument 1 of .__atomic_exchange. must be a non-void pointer type" } */
|
|
||||||
+ __atomic_exchange (&b, bar ().a, &c, __ATOMIC_RELAXED); /* { dg-error "argument 2 of .__atomic_exchange. must be a pointer type" } */
|
|
||||||
+ __atomic_exchange (&b, &c, bar ().a, __ATOMIC_RELAXED); /* { dg-error "argument 3 of .__atomic_exchange. must be a pointer type" } */
|
|
||||||
+ __atomic_compare_exchange (bar ().a, &b, &c, 1, __ATOMIC_RELAXED, __ATOMIC_RELAXED); /* { dg-error "argument 1 of .__atomic_compare_exchange. must be a non-void pointer type" } */
|
|
||||||
+ __atomic_compare_exchange (&b, bar ().a, &c, 1, __ATOMIC_RELAXED, __ATOMIC_RELAXED); /* { dg-error "argument 2 of .__atomic_compare_exchange. must be a pointer type" } */
|
|
||||||
+ __atomic_compare_exchange (&b, &c, bar ().a, 1, __ATOMIC_RELAXED, __ATOMIC_RELAXED); /* { dg-error "argument 3 of .__atomic_compare_exchange. must be a pointer type" } */
|
|
||||||
+}
|
|
||||||
--- gcc/testsuite/c-c++-common/pr82112.c (nonexistent)
|
|
||||||
+++ gcc/testsuite/c-c++-common/pr82112.c (revision 252003)
|
|
||||||
@@ -0,0 +1,13 @@
|
|
||||||
+/* PR target/82112 */
|
|
||||||
+/* { dg-do compile } */
|
|
||||||
+
|
|
||||||
+int c[10], d[10], e[10], f[10], g[10], h[10], i[10], j[10], k[10], l[10];
|
|
||||||
+
|
|
||||||
+void
|
|
||||||
+foo (void)
|
|
||||||
+{
|
|
||||||
+ __atomic_load (c, d, __ATOMIC_ACQUIRE);
|
|
||||||
+ __atomic_store (e, f, __ATOMIC_SEQ_CST);
|
|
||||||
+ __atomic_exchange (g, h, i, __ATOMIC_RELAXED);
|
|
||||||
+ __atomic_compare_exchange (j, k, l, 1, __ATOMIC_RELAXED, __ATOMIC_RELAXED);
|
|
||||||
+}
|
|
@ -1,101 +0,0 @@
|
|||||||
2017-09-15 Jakub Jelinek <jakub@redhat.com>
|
|
||||||
|
|
||||||
Backported from mainline
|
|
||||||
2017-09-12 Jakub Jelinek <jakub@redhat.com>
|
|
||||||
|
|
||||||
PR target/82112
|
|
||||||
* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): For
|
|
||||||
ALTIVEC_BUILTIN_VEC_LD if arg1 has array type call default_conversion
|
|
||||||
on it early, rather than manual conversion late. For
|
|
||||||
ALTIVEC_BUILTIN_VEC_ST if arg2 has array type call default_conversion
|
|
||||||
instead of performing manual conversion.
|
|
||||||
|
|
||||||
* gcc.target/powerpc/pr82112.c: New test.
|
|
||||||
* g++.dg/ext/altivec-18.C: New test.
|
|
||||||
|
|
||||||
--- gcc/config/rs6000/rs6000-c.c (revision 252027)
|
|
||||||
+++ gcc/config/rs6000/rs6000-c.c (revision 252028)
|
|
||||||
@@ -6489,7 +6489,13 @@ altivec_resolve_overloaded_builtin (loca
|
|
||||||
|
|
||||||
/* Strip qualifiers like "const" from the pointer arg. */
|
|
||||||
tree arg1_type = TREE_TYPE (arg1);
|
|
||||||
- if (!POINTER_TYPE_P (arg1_type) && TREE_CODE (arg1_type) != ARRAY_TYPE)
|
|
||||||
+ if (TREE_CODE (arg1_type) == ARRAY_TYPE && c_dialect_cxx ())
|
|
||||||
+ {
|
|
||||||
+ /* Force array-to-pointer decay for C++. */
|
|
||||||
+ arg1 = default_conversion (arg1);
|
|
||||||
+ arg1_type = TREE_TYPE (arg1);
|
|
||||||
+ }
|
|
||||||
+ if (!POINTER_TYPE_P (arg1_type))
|
|
||||||
goto bad;
|
|
||||||
|
|
||||||
tree inner_type = TREE_TYPE (arg1_type);
|
|
||||||
@@ -6509,15 +6515,6 @@ altivec_resolve_overloaded_builtin (loca
|
|
||||||
if (!ptrofftype_p (TREE_TYPE (arg0)))
|
|
||||||
arg0 = build1 (NOP_EXPR, sizetype, arg0);
|
|
||||||
|
|
||||||
- tree arg1_type = TREE_TYPE (arg1);
|
|
||||||
- if (TREE_CODE (arg1_type) == ARRAY_TYPE)
|
|
||||||
- {
|
|
||||||
- arg1_type = TYPE_POINTER_TO (TREE_TYPE (arg1_type));
|
|
||||||
- tree const0 = build_int_cstu (sizetype, 0);
|
|
||||||
- tree arg1_elt0 = build_array_ref (loc, arg1, const0);
|
|
||||||
- arg1 = build1 (ADDR_EXPR, arg1_type, arg1_elt0);
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
tree addr = fold_build2_loc (loc, POINTER_PLUS_EXPR, arg1_type,
|
|
||||||
arg1, arg0);
|
|
||||||
tree aligned = fold_build2_loc (loc, BIT_AND_EXPR, arg1_type, addr,
|
|
||||||
@@ -6572,12 +6569,11 @@ altivec_resolve_overloaded_builtin (loca
|
|
||||||
arg1 = build1 (NOP_EXPR, sizetype, arg1);
|
|
||||||
|
|
||||||
tree arg2_type = TREE_TYPE (arg2);
|
|
||||||
- if (TREE_CODE (arg2_type) == ARRAY_TYPE)
|
|
||||||
+ if (TREE_CODE (arg2_type) == ARRAY_TYPE && c_dialect_cxx ())
|
|
||||||
{
|
|
||||||
- arg2_type = TYPE_POINTER_TO (TREE_TYPE (arg2_type));
|
|
||||||
- tree const0 = build_int_cstu (sizetype, 0);
|
|
||||||
- tree arg2_elt0 = build_array_ref (loc, arg2, const0);
|
|
||||||
- arg2 = build1 (ADDR_EXPR, arg2_type, arg2_elt0);
|
|
||||||
+ /* Force array-to-pointer decay for C++. */
|
|
||||||
+ arg2 = default_conversion (arg2);
|
|
||||||
+ arg2_type = TREE_TYPE (arg2);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Find the built-in to make sure a compatible one exists; if not
|
|
||||||
--- gcc/testsuite/gcc.target/powerpc/pr82112.c (nonexistent)
|
|
||||||
+++ gcc/testsuite/gcc.target/powerpc/pr82112.c (revision 252028)
|
|
||||||
@@ -0,0 +1,16 @@
|
|
||||||
+/* PR target/82112 */
|
|
||||||
+/* { dg-do compile } */
|
|
||||||
+/* { dg-require-effective-target powerpc_altivec_ok } */
|
|
||||||
+/* { dg-options "-maltivec -std=gnu90" } */
|
|
||||||
+
|
|
||||||
+#include <altivec.h>
|
|
||||||
+
|
|
||||||
+struct __attribute__((aligned (16))) S { unsigned char c[64]; } bar (void);
|
|
||||||
+vector unsigned char v;
|
|
||||||
+
|
|
||||||
+void
|
|
||||||
+foo (void)
|
|
||||||
+{
|
|
||||||
+ vec_ld (0, bar ().c); /* { dg-error "invalid parameter combination for AltiVec intrinsic" } */
|
|
||||||
+ vec_st (v, 0, bar ().c); /* { dg-error "invalid parameter combination for AltiVec intrinsic" } */
|
|
||||||
+}
|
|
||||||
--- gcc/testsuite/g++.dg/ext/altivec-18.C (nonexistent)
|
|
||||||
+++ gcc/testsuite/g++.dg/ext/altivec-18.C (revision 252028)
|
|
||||||
@@ -0,0 +1,14 @@
|
|
||||||
+// PR target/82112
|
|
||||||
+// { dg-do compile { target powerpc*-*-* } }
|
|
||||||
+// { dg-require-effective-target powerpc_altivec_ok }
|
|
||||||
+// { dg-options "-maltivec" }
|
|
||||||
+
|
|
||||||
+#include <altivec.h>
|
|
||||||
+
|
|
||||||
+__attribute__((aligned (16))) extern const unsigned char c[16];
|
|
||||||
+
|
|
||||||
+void
|
|
||||||
+foo (void)
|
|
||||||
+{
|
|
||||||
+ vec_ld (0, c);
|
|
||||||
+}
|
|
84
gcc7-pr83556.patch
Normal file
84
gcc7-pr83556.patch
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
2017-12-23 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
PR c++/83556
|
||||||
|
* tree.c (replace_placeholders_r): Pass NULL as last argument to
|
||||||
|
cp_walk_tree instead of d->pset. If non-TREE_CONSTANT and
|
||||||
|
non-PLACEHOLDER_EXPR tree has been seen already, set *walk_subtrees
|
||||||
|
to false and return.
|
||||||
|
(replace_placeholders): Pass NULL instead of &pset as last argument
|
||||||
|
to cp_walk_tree.
|
||||||
|
|
||||||
|
* g++.dg/cpp0x/pr83556.C: New test.
|
||||||
|
|
||||||
|
--- gcc/cp/tree.c.jj 2017-12-15 16:10:37.000000000 +0100
|
||||||
|
+++ gcc/cp/tree.c 2017-12-22 23:24:16.720428548 +0100
|
||||||
|
@@ -3106,6 +3106,11 @@ replace_placeholders_r (tree* t, int* wa
|
||||||
|
{
|
||||||
|
constructor_elt *ce;
|
||||||
|
vec<constructor_elt,va_gc> *v = CONSTRUCTOR_ELTS (*t);
|
||||||
|
+ if (d->pset->add (*t))
|
||||||
|
+ {
|
||||||
|
+ *walk_subtrees = false;
|
||||||
|
+ return NULL_TREE;
|
||||||
|
+ }
|
||||||
|
for (unsigned i = 0; vec_safe_iterate (v, i, &ce); ++i)
|
||||||
|
{
|
||||||
|
tree *valp = &ce->value;
|
||||||
|
@@ -3125,7 +3130,7 @@ replace_placeholders_r (tree* t, int* wa
|
||||||
|
valp = &TARGET_EXPR_INITIAL (*valp);
|
||||||
|
}
|
||||||
|
d->obj = subob;
|
||||||
|
- cp_walk_tree (valp, replace_placeholders_r, data_, d->pset);
|
||||||
|
+ cp_walk_tree (valp, replace_placeholders_r, data_, NULL);
|
||||||
|
d->obj = obj;
|
||||||
|
}
|
||||||
|
*walk_subtrees = false;
|
||||||
|
@@ -3133,6 +3138,8 @@ replace_placeholders_r (tree* t, int* wa
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
+ if (d->pset->add (*t))
|
||||||
|
+ *walk_subtrees = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -3161,7 +3168,7 @@ replace_placeholders (tree exp, tree obj
|
||||||
|
replace_placeholders_t data = { obj, false, &pset };
|
||||||
|
if (TREE_CODE (exp) == TARGET_EXPR)
|
||||||
|
tp = &TARGET_EXPR_INITIAL (exp);
|
||||||
|
- cp_walk_tree (tp, replace_placeholders_r, &data, &pset);
|
||||||
|
+ cp_walk_tree (tp, replace_placeholders_r, &data, NULL);
|
||||||
|
if (seen_p)
|
||||||
|
*seen_p = data.seen;
|
||||||
|
return exp;
|
||||||
|
--- gcc/testsuite/g++.dg/cpp0x/pr83556.C.jj 2017-12-22 23:30:10.771126002 +0100
|
||||||
|
+++ gcc/testsuite/g++.dg/cpp0x/pr83556.C 2017-12-22 23:29:21.000000000 +0100
|
||||||
|
@@ -0,0 +1,28 @@
|
||||||
|
+// PR c++/83556
|
||||||
|
+// { dg-do run { target c++11 } }
|
||||||
|
+
|
||||||
|
+int
|
||||||
|
+foo ()
|
||||||
|
+{
|
||||||
|
+ return 1;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+struct A
|
||||||
|
+{
|
||||||
|
+ int a = foo ();
|
||||||
|
+ int b = 1;
|
||||||
|
+ int c = a ? 1 * b : 2 * b;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+struct B
|
||||||
|
+{
|
||||||
|
+ A d {};
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+int
|
||||||
|
+main ()
|
||||||
|
+{
|
||||||
|
+ B e {};
|
||||||
|
+ if (e.d.c != 1)
|
||||||
|
+ __builtin_abort ();
|
||||||
|
+}
|
Loading…
Reference in New Issue
Block a user