5.0.0-0.11

This commit is contained in:
Jakub Jelinek 2015-02-10 19:26:49 +01:00
parent c728afb1bb
commit cf944628eb
10 changed files with 275 additions and 334 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@
/gcc-5.0.0-20150205.tar.bz2
/gcc-5.0.0-20150206.tar.bz2
/gcc-5.0.0-20150208.tar.bz2
/gcc-5.0.0-20150210.tar.bz2

View File

@ -1,9 +1,9 @@
%global DATE 20150208
%global SVNREV 220517
%global DATE 20150210
%global SVNREV 220591
%global gcc_version 5.0.0
# Note, gcc_release must be integer, if you want to add suffixes to
# %{release}, append them after %{gcc_release} on Release: line.
%global gcc_release 0.10
%global gcc_release 0.11
%global _unpackaged_files_terminate_build 0
%global _performance_build 1
%global multilib_64_archs sparc64 ppc64 ppc64p7 s390x x86_64
@ -200,9 +200,10 @@ Patch13: gcc5-aarch64-async-unw-tables.patch
Patch14: gcc5-libsanitize-aarch64-va42.patch
Patch15: gcc5-pr61925.patch
Patch16: gcc5-pr64893.patch
Patch17: gcc5-pr64979.patch
Patch18: gcc5-pr64981.patch
Patch19: gcc5-pr64858.patch
Patch17: gcc5-pr64984.patch
Patch18: gcc5-pr65000.patch
Patch19: gcc5-pr65003.patch
Patch20: gcc5-pr65004.patch
# On ARM EABI systems, we do want -gnueabi to be part of the
# target triple.
@ -754,9 +755,10 @@ rm -f libgo/go/crypto/elliptic/p224{,_test}.go
%patch14 -p0 -b .libsanitize-aarch64-va42~
%patch15 -p0 -b .pr61925~
%patch16 -p0 -b .pr64893~
%patch17 -p0 -b .pr64979~
%patch18 -p0 -b .pr64981~
%patch19 -p0 -b .pr64858~
%patch17 -p0 -b .pr64984~
%patch18 -p0 -b .pr65000~
%patch19 -p0 -b .pr65003~
%patch20 -p0 -b .pr65004~
%if 0%{?_enable_debug_packages}
mkdir dwz-wrapper
@ -2942,6 +2944,18 @@ fi
%doc rpm.doc/changelogs/libcc1/ChangeLog*
%changelog
* Tue Feb 10 2015 Jakub Jelinek <jakub@redhat.com> 5.0.0-0.11
- update from the trunk
- PRs c++/64899, c++/64994, c/64856, gcov-profile/61889, ipa/63566,
ipa/64978, ipa/64982, libgfortran/57822, lto/64076, target/58757,
tree-optimization/43378, tree-optimization/54000,
tree-optimization/64326, tree-optimization/64909,
tree-optimization/64995
- fix C++ FE ICE on internal functions (PR sanitizer/64984)
- fix ICE due to unreachable EH region removal (PR sanitizer/65000)
- fix -fsection-anchors alias handling (#1190243, PR middle-end/65003)
- fix -fsanitize=vptr handling (PR sanitizer/65004)
* Mon Feb 9 2015 Jakub Jelinek <jakub@redhat.com> 5.0.0-0.10
- fix getconf default symlink on 32-bit arches (#1190484)
- fix ICF ICE (PR ipa/64858)

View File

@ -1,133 +0,0 @@
2015-02-09 Martin Liska <mliska@suse.cz>
* ipa-icf.c (sem_item_optimizer::register_hooks): Register hooks
just if not yet registered.
(ipa_icf_generate_summary): Register callgraph hooks.
* g++.dg/ipa/pr64858.C: New test.
--- gcc/ipa-icf.c (revision 220530)
+++ gcc/ipa-icf.c (revision 220531)
@@ -1562,11 +1562,13 @@ sem_item_optimizer::read_summary (void)
void
sem_item_optimizer::register_hooks (void)
{
- m_cgraph_node_hooks = symtab->add_cgraph_removal_hook
- (&sem_item_optimizer::cgraph_removal_hook, this);
-
- m_varpool_node_hooks = symtab->add_varpool_removal_hook
- (&sem_item_optimizer::varpool_removal_hook, this);
+ if (!m_cgraph_node_hooks)
+ m_cgraph_node_hooks = symtab->add_cgraph_removal_hook
+ (&sem_item_optimizer::cgraph_removal_hook, this);
+
+ if (!m_varpool_node_hooks)
+ m_varpool_node_hooks = symtab->add_varpool_removal_hook
+ (&sem_item_optimizer::varpool_removal_hook, this);
}
/* Unregister callgraph and varpool hooks. */
@@ -2438,6 +2440,7 @@ ipa_icf_generate_summary (void)
if (!optimizer)
optimizer = new sem_item_optimizer ();
+ optimizer->register_hooks ();
optimizer->parse_funcs_and_vars ();
}
--- gcc/testsuite/g++.dg/ipa/pr64858.C (revision 0)
+++ gcc/testsuite/g++.dg/ipa/pr64858.C (revision 220531)
@@ -0,0 +1,93 @@
+// { dg-do compile }
+// { dg-options "-O2 -std=gnu++11" }
+
+template <class reference_type> class A
+{
+ reference_type *m_pBody;
+public:
+ A (const A &) { m_pBody->acquire (); }
+};
+class B;
+class C
+{
+protected:
+ B *_pInterface;
+};
+template <class interface_type> class I : C
+{
+public:
+ I (interface_type *);
+};
+class B
+{
+public:
+ virtual void acquire ();
+};
+class D
+{
+protected:
+ void acquire ();
+};
+template <class Ifc1> class J : D, public Ifc1
+{
+ void
+ acquire ()
+ {
+ D::acquire ();
+ }
+};
+class K : B
+{
+};
+class L;
+class F
+{
+ A<L> m_pDocument;
+ F (A<L> const &, int &&);
+};
+class XUnoTunnel;
+class XEventTarget;
+template <class, class> class WeakImplHelper3 : D, B
+{
+ void
+ acquire ()
+ {
+ D::acquire ();
+ }
+};
+template <class> class G
+{
+public:
+ void
+ acquire ()
+ {
+ WeakImplHelper3<XUnoTunnel, XEventTarget> ();
+ }
+};
+struct H
+{
+ H ()
+ : mxAttribList (new J<B>), mxCurrentHandler (0), mxDocHandler (0),
+ mxTokenHandler (0)
+ {
+ }
+ I<J<B> > mxAttribList;
+ I<int> mxCurrentHandler;
+ I<int> mxDocHandler;
+ I<int> mxTokenHandler;
+};
+class L : public G<int>
+{
+};
+class M : public J<K>
+{
+public:
+ M ();
+};
+template <class interface_type> I<interface_type>::I (interface_type *p1)
+{
+ B *a = static_cast<B *> (static_cast<void *> (p1));
+ _pInterface = a;
+ _pInterface->acquire ();
+}
+F::F (A<L> const &p1, int &&) : m_pDocument (p1) { I<K> (new M); }

View File

@ -1,146 +0,0 @@
2015-02-09 Jakub Jelinek <jakub@redhat.com>
PR target/64979
* tree-stdarg.c (pass_stdarg::execute): Scan phi node args for
va_list escapes.
* gcc.dg/tree-ssa/stdarg-7.c: New test.
* gcc.c-torture/execute/pr64979.c: New test.
--- gcc/tree-stdarg.c.jj 2015-01-09 21:59:44.000000000 +0100
+++ gcc/tree-stdarg.c 2015-02-09 13:14:43.880406573 +0100
@@ -856,22 +856,23 @@ pass_stdarg::execute (function *fun)
/* For va_list_simple_ptr, we have to check PHI nodes too. We treat
them as assignments for the purpose of escape analysis. This is
not needed for non-simple va_list because virtual phis don't perform
- any real data movement. */
- if (va_list_simple_ptr)
+ any real data movement. Also, check PHI nodes for taking address of
+ the va_list vars. */
+ tree lhs, rhs;
+ use_operand_p uop;
+ ssa_op_iter soi;
+
+ for (gphi_iterator i = gsi_start_phis (bb); !gsi_end_p (i);
+ gsi_next (&i))
{
- tree lhs, rhs;
- use_operand_p uop;
- ssa_op_iter soi;
+ gphi *phi = i.phi ();
+ lhs = PHI_RESULT (phi);
- for (gphi_iterator i = gsi_start_phis (bb); !gsi_end_p (i);
- gsi_next (&i))
- {
- gphi *phi = i.phi ();
- lhs = PHI_RESULT (phi);
-
- if (virtual_operand_p (lhs))
- continue;
+ if (virtual_operand_p (lhs))
+ continue;
+ if (va_list_simple_ptr)
+ {
FOR_EACH_PHI_ARG (uop, phi, soi, SSA_OP_USE)
{
rhs = USE_FROM_PTR (uop);
@@ -894,6 +895,22 @@ pass_stdarg::execute (function *fun)
}
}
}
+
+ for (unsigned j = 0; !va_list_escapes
+ && j < gimple_phi_num_args (phi); ++j)
+ if ((!va_list_simple_ptr
+ || TREE_CODE (gimple_phi_arg_def (phi, j)) != SSA_NAME)
+ && walk_tree (gimple_phi_arg_def_ptr (phi, j),
+ find_va_list_reference, &wi, NULL))
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fputs ("va_list escapes in ", dump_file);
+ print_gimple_stmt (dump_file, phi, 0, dump_flags);
+ fputc ('\n', dump_file);
+ }
+ va_list_escapes = true;
+ }
}
for (gimple_stmt_iterator i = gsi_start_bb (bb);
@@ -916,8 +933,8 @@ pass_stdarg::execute (function *fun)
if (is_gimple_assign (stmt))
{
- tree lhs = gimple_assign_lhs (stmt);
- tree rhs = gimple_assign_rhs1 (stmt);
+ lhs = gimple_assign_lhs (stmt);
+ rhs = gimple_assign_rhs1 (stmt);
if (va_list_simple_ptr)
{
--- gcc/testsuite/gcc.dg/tree-ssa/stdarg-7.c.jj 2015-02-09 12:54:44.222284401 +0100
+++ gcc/testsuite/gcc.dg/tree-ssa/stdarg-7.c 2015-02-09 12:58:10.406875647 +0100
@@ -0,0 +1,22 @@
+/* PR target/64979 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-stdarg" } */
+
+#include <stdarg.h>
+
+void bar (int x, va_list *ap);
+
+void
+foo (int x, ...)
+{
+ va_list ap;
+ int n;
+
+ va_start (ap, x);
+ n = va_arg (ap, int);
+ bar (x, (va_list *) ((n == 0) ? ((void *) 0) : &ap));
+ va_end (ap);
+}
+
+/* { dg-final { scan-tree-dump "foo: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" } } */
+/* { dg-final { cleanup-tree-dump "stdarg" } } */
--- gcc/testsuite/gcc.c-torture/execute/pr64979.c.jj 2015-02-09 12:54:01.867984625 +0100
+++ gcc/testsuite/gcc.c-torture/execute/pr64979.c 2015-02-09 13:08:17.458818847 +0100
@@ -0,0 +1,36 @@
+/* PR target/64979 */
+
+#include <stdarg.h>
+
+void __attribute__((noinline, noclone))
+bar (int x, va_list *ap)
+{
+ if (ap)
+ {
+ int i;
+ for (i = 0; i < 10; i++)
+ if (i != va_arg (*ap, int))
+ __builtin_abort ();
+ if (va_arg (*ap, double) != 0.5)
+ __builtin_abort ();
+ }
+}
+
+void __attribute__((noinline, noclone))
+foo (int x, ...)
+{
+ va_list ap;
+ int n;
+
+ va_start (ap, x);
+ n = va_arg (ap, int);
+ bar (x, (va_list *) ((n == 0) ? ((void *) 0) : &ap));
+ va_end (ap);
+}
+
+int
+main ()
+{
+ foo (100, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0.5);
+ return 0;
+}

View File

@ -1,45 +0,0 @@
2015-02-09 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/64981
* builtins.c (expand_builtin): Call targetm.expand_builtin
for BUILT_IN_MD builtins regardless of asan_intercepted_p.
* gcc.dg/asan/pr64981.c: New test.
--- gcc/builtins.c.jj 2015-01-21 10:29:52.000000000 +0100
+++ gcc/builtins.c 2015-02-09 14:02:35.814716664 +0100
@@ -5960,6 +5960,9 @@ expand_builtin (tree exp, rtx target, rt
machine_mode target_mode = TYPE_MODE (TREE_TYPE (exp));
int flags;
+ if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD)
+ return targetm.expand_builtin (exp, target, subtarget, mode, ignore);
+
/* When ASan is enabled, we don't want to expand some memory/string
builtins and rely on libsanitizer's hooks. This allows us to avoid
redundant checks and be sure, that possible overflow will be detected
@@ -5968,9 +5971,6 @@ expand_builtin (tree exp, rtx target, rt
if ((flag_sanitize & SANITIZE_ADDRESS) && asan_intercepted_p (fcode))
return expand_call (exp, target, ignore);
- if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD)
- return targetm.expand_builtin (exp, target, subtarget, mode, ignore);
-
/* When not optimizing, generate calls to library functions for a certain
set of builtins. */
if (!optimize
--- gcc/testsuite/gcc.dg/asan/pr64981.c.jj 2015-02-09 14:05:50.252487512 +0100
+++ gcc/testsuite/gcc.dg/asan/pr64981.c 2015-02-09 14:05:34.000000000 +0100
@@ -0,0 +1,12 @@
+/* PR sanitizer/64981 */
+/* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-options "-fsanitize=address -march=x86-64" } */
+
+int
+main ()
+{
+ __builtin_ia32_rdtsc ();
+ return 0;
+}
+
+/* { dg-final { scan-assembler-not "__builtin_ia32_rdtsc" } } */

98
gcc5-pr64984.patch Normal file
View File

@ -0,0 +1,98 @@
2015-02-10 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/64984
* except.c (check_noexcept_r): Return NULL for internal
calls.
* g++.dg/ubsan/pr64984.C: New test.
--- gcc/cp/except.c.jj 2015-01-31 10:07:36.000000000 +0100
+++ gcc/cp/except.c 2015-02-10 09:06:44.712226554 +0100
@@ -1148,7 +1148,7 @@ check_noexcept_r (tree *tp, int * /*walk
{
tree t = *tp;
enum tree_code code = TREE_CODE (t);
- if (code == CALL_EXPR
+ if ((code == CALL_EXPR && CALL_EXPR_FN (t))
|| code == AGGR_INIT_EXPR)
{
/* We can only use the exception specification of the called function
--- gcc/testsuite/g++.dg/ubsan/pr64984.C.jj 2015-02-10 09:52:43.720720833 +0100
+++ gcc/testsuite/g++.dg/ubsan/pr64984.C 2015-02-10 10:00:00.343370913 +0100
@@ -0,0 +1,76 @@
+// PR sanitizer/64984
+// { dg-do compile }
+// { dg-options "-fsanitize=vptr -std=gnu++11" }
+
+template <typename X, X> struct K
+{
+ static constexpr X v = 0;
+ typedef K t;
+};
+template <typename...> struct A;
+template <typename X, typename Y>
+struct A<X, Y> : Y
+{
+};
+template <typename X> X M ();
+template <typename...> struct B;
+template <typename X, typename Y>
+struct B<X, Y> : K<int, noexcept (static_cast<X>(M<Y>()))>
+{
+};
+template <typename X, typename... Y>
+struct G : A<int, B<X, Y...>>::t
+{
+};
+template <typename X> struct J : G<X, X&&>
+{
+};
+template <typename X> X&& foo (X&);
+template <typename X> X&& bar (X&&);
+template <typename X> struct P
+{
+ P (X& x) : q (x) {}
+ X q;
+};
+template <typename...> struct Q;
+template <typename X>
+struct Q<X> : P<X>
+{
+ typedef P<X> r;
+ X& s (Q&);
+ Q (X& x) : r (x) {}
+ Q (Q&& x) noexcept (J<X>::v) : r (foo<X>(s (x)))
+ {
+ }
+};
+template <typename... X> struct I : Q<X...>
+{
+ I ();
+ I (X&... x) : Q<X...>(x...)
+ {
+ }
+};
+template <typename... X>
+I<X&&...> baz (X&&... x)
+{
+ return I <X&&...> (foo<X>(x)...);
+}
+template <typename X> struct F
+{
+ int p;
+ void operator[] (X&& x)
+ {
+ baz (bar (x));
+ }
+};
+struct U
+{
+ virtual ~U ();
+};
+
+int
+main ()
+{
+ F<U> m;
+ m[U ()];
+}

26
gcc5-pr65000.patch Normal file
View File

@ -0,0 +1,26 @@
2015-02-10 Richard Henderson <rth@redhat.com>
PR sanitizer/65000
* tree-eh.c (mark_reachable_handlers): Mark regions mentioned in
__builtin_eh_copy_values as reachable.
--- gcc/tree-eh.c
+++ gcc/tree-eh.c
@@ -3859,6 +3859,17 @@ mark_reachable_handlers (sbitmap *r_reachablep, sbitmap *lp_reachablep)
gimple_eh_dispatch_region (
as_a <geh_dispatch *> (stmt)));
break;
+ case GIMPLE_CALL:
+ if (gimple_call_builtin_p (stmt, BUILT_IN_EH_COPY_VALUES))
+ for (int i = 0; i < 2; ++i)
+ {
+ tree rt = gimple_call_arg (stmt, i);
+ HOST_WIDE_INT ri = tree_to_shwi (rt);
+
+ gcc_assert (ri = (int)ri);
+ bitmap_set_bit (r_reachable, ri);
+ }
+ break;
default:
break;
}

57
gcc5-pr65003.patch Normal file
View File

@ -0,0 +1,57 @@
2015-02-10 Jakub Jelinek <jakub@redhat.com>
PR middle-end/65003
* varasm.c (place_block_symbol): Assert that DECL_RTL of the
ultimate alias is MEM with SYMBOL_REF satisfying
SYMBOL_REF_HAS_BLOCK_INFO_P as its operand. Don't pass the MEM
to place_block_symbol, but instead pass the SYMBOL_REF operand of it.
* g++.dg/opt/pr65003.C: New test.
--- gcc/varasm.c.jj 2015-02-04 15:24:20.000000000 +0100
+++ gcc/varasm.c 2015-02-10 15:37:55.872609142 +0100
@@ -7180,6 +7180,10 @@ place_block_symbol (rtx symbol)
{
rtx target = DECL_RTL (snode->ultimate_alias_target ()->decl);
+ gcc_assert (MEM_P (target)
+ && GET_CODE (XEXP (target, 0)) == SYMBOL_REF
+ && SYMBOL_REF_HAS_BLOCK_INFO_P (XEXP (target, 0)));
+ target = XEXP (target, 0);
place_block_symbol (target);
SYMBOL_REF_BLOCK_OFFSET (symbol) = SYMBOL_REF_BLOCK_OFFSET (target);
return;
--- gcc/testsuite/g++.dg/opt/pr65003.C.jj 2015-02-10 15:50:44.240734029 +0100
+++ gcc/testsuite/g++.dg/opt/pr65003.C 2015-02-10 15:50:39.468814055 +0100
@@ -0,0 +1,31 @@
+// PR middle-end/65003
+// { dg-do compile }
+// { dg-options "-O2" }
+// { dg-additional-options "-fpic" { target fpic } }
+
+struct A
+{
+ void operator= (A &);
+ A ();
+};
+struct B
+{
+ A b;
+};
+struct C
+{
+ virtual bool foo (int &, bool) const;
+};
+struct D : virtual C
+{
+ bool foo (int &, bool) const;
+ B e;
+};
+struct F : D
+{
+ F (int &, const int &, const A &);
+ bool foo (int &, bool) const;
+};
+bool D::foo (int &, bool) const {}
+F::F (int &, const int &, const A &) {}
+bool F::foo (int &, bool) const {}

69
gcc5-pr65004.patch Normal file
View File

@ -0,0 +1,69 @@
2015-02-10 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/65004
* ubsan.c (ubsan_expand_vptr_ifn): Always return true.
* g++.dg/asan/pr65004.C: New test.
--- gcc/ubsan.c.jj 2015-01-28 08:39:53.000000000 +0100
+++ gcc/ubsan.c 2015-02-10 18:44:59.796872508 +0100
@@ -1148,7 +1148,7 @@ ubsan_expand_vptr_ifn (gimple_stmt_itera
/* Get rid of the UBSAN_VPTR call from the IR. */
unlink_stmt_vdef (stmt);
gsi_remove (&gsi, true);
- return gsi_end_p (*gsip);
+ return true;
}
/* Instrument a memory reference. BASE is the base of MEM, IS_LHS says
--- gcc/testsuite/g++.dg/asan/pr65004.C.jj 2015-02-10 18:49:48.521988574 +0100
+++ gcc/testsuite/g++.dg/asan/pr65004.C 2015-02-10 18:51:22.249407985 +0100
@@ -0,0 +1,48 @@
+// PR sanitizer/65004
+// { dg-do compile }
+// { dg-options "-fcompare-debug -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all" }
+
+namespace N {
+ template <typename Signature> struct function;
+ namespace detail {
+ namespace function {
+ struct vtable_base { };
+ }
+ }
+ struct function_base {
+ detail::function::vtable_base * vtable;
+ };
+ template <typename R, typename T0> struct function1 : public function_base { };
+ template <typename R, typename T0> struct function <R (T0)> : public function1 <R, T0> { };
+}
+namespace Bar {
+ typedef N::function <void (const char *)> WarningHandler;
+}
+namespace Foo {
+ struct FooRecord {
+ virtual ~FooRecord ();
+ };
+ struct TestRecord : public FooRecord {
+ long x;
+ };
+}
+namespace Foo {
+ using Bar::WarningHandler;
+ struct FooScanner {
+ WarningHandler warnHandler;
+ int readByte ();
+ long readSignedInteger ();
+ };
+ struct FooRecordReader {
+ FooScanner & scanner;
+ long readSInt ();
+ void readTestRecord (TestRecord * recp);
+ };
+ inline long FooRecordReader::readSInt () {
+ return scanner.readSignedInteger ();
+ }
+ void FooRecordReader::readTestRecord (TestRecord * recp) {
+ int infoByte = scanner.readByte ();
+ recp->x = readSInt ();
+ }
+

View File

@ -1 +1 @@
eacd6e34486f1aa10be6dd625b9dedae gcc-5.0.0-20150208.tar.bz2
6bf42761df510dd8e26b19118d6a8bb7 gcc-5.0.0-20150210.tar.bz2