This commit is contained in:
Jakub Jelinek 2016-08-17 17:24:31 +02:00
parent 39e0659a62
commit 4f5892b0e1
4 changed files with 131 additions and 6 deletions

1
.gitignore vendored
View File

@ -11,3 +11,4 @@
/gcc-6.1.1-20160621.tar.bz2
/gcc-6.1.1-20160721.tar.bz2
/gcc-6.1.1-20160810.tar.bz2
/gcc-6.1.1-20160817.tar.bz2

View File

@ -1,9 +1,9 @@
%global DATE 20160810
%global SVNREV 239320
%global DATE 20160817
%global SVNREV 239541
%global gcc_version 6.1.1
# 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 5
%global gcc_release 6
%global _unpackaged_files_terminate_build 0
%global _performance_build 1
# Hardening slows the compiler way too much.
@ -207,6 +207,7 @@ Patch10: gcc6-no-add-needed.patch
Patch11: gcc6-libgo-p224.patch
Patch12: gcc6-aarch64-async-unw-tables.patch
Patch13: gcc6-libsanitize-aarch64-va42.patch
Patch14: gcc6-pr77259.patch
# On ARM EABI systems, we do want -gnueabi to be part of the
# target triple.
@ -773,6 +774,7 @@ package or when debugging this package.
rm -f libgo/go/crypto/elliptic/p224{,_test}.go
%patch12 -p0 -b .aarch64-async-unw-tables~
%patch13 -p0 -b .libsanitize-aarch64-va42~
%patch14 -p0 -b .pr77259~
%if 0%{?_enable_debug_packages}
mkdir dwz-wrapper
@ -1336,8 +1338,12 @@ for i in `find . -name \*.py`; do
done
touch -r hook.in %{buildroot}%{_datadir}/gdb/auto-load/%{_prefix}/%{_lib}/libstdc++*gdb.py
popd
%py_byte_compile %{__python3} %{buildroot}%{_prefix}/share/gcc-%{gcc_version}/python/
%py_byte_compile %{__python3} %{buildroot}%{_datadir}/gdb/auto-load/%{_prefix}/%{_lib}/
for f in `find %{buildroot}%{_prefix}/share/gcc-%{gcc_version}/python/ \
%{buildroot}%{_datadir}/gdb/auto-load/%{_prefix}/%{_lib}/ -name \*.py`; do
r=${f/$RPM_BUILD_ROOT/}
%{__python3} -c 'import py_compile; py_compile.compile("'$f'", dfile="'$r'")'
%{__python3} -O -c 'import py_compile; py_compile.compile("'$f'", dfile="'$r'")'
done
rm -f $FULLEPATH/libgccjit.so
cp -a objlibgccjit/gcc/libgccjit.so* %{buildroot}%{_prefix}/%{_lib}/
@ -3104,6 +3110,17 @@ fi
%doc rpm.doc/changelogs/libcc1/ChangeLog*
%changelog
* Wed Aug 17 2016 Jakub Jelinek <jakub@redhat.com> 6.1.1-6
- update from the 6 branch
- PRs c++/71972, c++/72868, c++/73456, c/67410, c/71512, c/72816,
debug/71906, driver/72765, fortran/71123, fortran/71936,
fortran/72698, libgfortran/71123, libgfortran/73142, sanitizer/71042,
target/72819, target/72843, target/72853, target/76342,
testsuite/77034, tree-optimization/71083, tree-optimization/73434
- fix devirtualization ICE (#1367212, PR middle-end/77259)
- build python3 bytecode manually to avoid python3-devel bugs (#1204355,
#1366516)
* Wed Aug 10 2016 Jakub Jelinek <jakub@redhat.com> 6.1.1-5
- update from the 6 branch
- PRs c++/52746, c++/55922, c++/63151, c++/68724, c++/69223, c++/70709,

107
gcc6-pr77259.patch Normal file
View File

@ -0,0 +1,107 @@
2016-08-17 Jakub Jelinek <jakub@redhat.com>
PR middle-end/77259
* tree-ssa-pre.c (eliminate_dom_walker::before_dom_children): If
turning a call into __builtin_unreachable-like noreturn call, adjust
gimple_call_set_fntype.
* tree-cfgcleanup.c (fixup_noreturn_call): Remove lhs also if
gimple_call_fntype has void return type.
* g++.dg/ipa/devirt-52.C: New test.
--- gcc/tree-ssa-pre.c.jj 2016-08-16 13:22:49.095671219 +0200
+++ gcc/tree-ssa-pre.c 2016-08-17 10:24:42.498730917 +0200
@@ -4543,6 +4543,15 @@ eliminate_dom_walker::before_dom_childre
lang_hooks.decl_printable_name (fn, 2));
}
gimple_call_set_fndecl (call_stmt, fn);
+ /* If changing the call to __builtin_unreachable
+ or similar noreturn function, adjust gimple_call_fntype
+ too. */
+ if (gimple_call_noreturn_p (call_stmt)
+ && VOID_TYPE_P (TREE_TYPE (TREE_TYPE (fn)))
+ && TYPE_ARG_TYPES (TREE_TYPE (fn))
+ && (TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (fn)))
+ == void_type_node))
+ gimple_call_set_fntype (call_stmt, TREE_TYPE (fn));
maybe_remove_unused_call_args (cfun, call_stmt);
gimple_set_modified (stmt, true);
}
--- gcc/tree-cfgcleanup.c.jj 2016-08-09 09:41:14.000000000 +0200
+++ gcc/tree-cfgcleanup.c 2016-08-17 10:36:24.198791289 +0200
@@ -602,9 +602,14 @@ fixup_noreturn_call (gimple *stmt)
/* If there is an LHS, remove it, but only if its type has fixed size.
The LHS will need to be recreated during RTL expansion and creating
temporaries of variable-sized types is not supported. Also don't
- do this with TREE_ADDRESSABLE types, as assign_temp will abort. */
+ do this with TREE_ADDRESSABLE types, as assign_temp will abort.
+ Drop LHS regardless of TREE_ADDRESSABLE, if the function call
+ has been changed into a call that does not return a value, like
+ __builtin_unreachable or __cxa_pure_virtual. */
tree lhs = gimple_call_lhs (stmt);
- if (should_remove_lhs_p (lhs))
+ if (lhs
+ && (should_remove_lhs_p (lhs)
+ || VOID_TYPE_P (TREE_TYPE (gimple_call_fntype (stmt)))))
{
gimple_call_set_lhs (stmt, NULL_TREE);
--- gcc/testsuite/g++.dg/ipa/devirt-52.C.jj 2016-08-17 10:23:39.775528901 +0200
+++ gcc/testsuite/g++.dg/ipa/devirt-52.C 2016-08-17 10:23:39.775528901 +0200
@@ -0,0 +1,56 @@
+// PR middle-end/77259
+// { dg-do compile { target c++11 } }
+// { dg-options "-O2" }
+
+template <typename, typename = int> class A;
+template <typename, typename> struct A
+{
+ A (A &&);
+};
+template <typename S, typename T, typename U>
+A<S> operator+(S *, const A<T, U> &);
+template <typename S, typename T, typename U>
+void operator+(const A<T, U> &, S *);
+struct B
+{
+ template <typename V> B (V);
+};
+template <typename V> V foo (B) {}
+class C;
+template <typename> struct D
+{
+ C *operator->() { return d; }
+ C *d;
+};
+struct C
+{
+ virtual A<int> bar ();
+};
+struct E
+{
+ ~E ();
+ virtual A<char> bar (const B &) const;
+};
+template <typename> struct F : E
+{
+};
+template <typename W> struct F<D<W>> : E
+{
+ A<char> bar (const B &) const try
+ {
+ D<W> a = baz ();
+ }
+ catch (int)
+ {
+ }
+ D<W> baz () const
+ {
+ D<C> b = foo<D<C>>(0);
+ "" + b->bar () + "";
+ }
+};
+struct G : F<D<int>>
+{
+ G (int);
+};
+void test () { G (0); }

View File

@ -1 +1 @@
9ef71e4cb7b9aab01d88955c13c820d3 gcc-6.1.1-20160810.tar.bz2
353d904ccfe4dc9cfd8d9ddf67e4ad1d gcc-6.1.1-20160817.tar.bz2