This commit is contained in:
Jakub Jelinek 2015-01-08 19:01:59 +01:00
parent b75648d9b2
commit 06398e8981
2 changed files with 102 additions and 1 deletions

View File

@ -3,7 +3,7 @@
%global gcc_version 4.9.2 %global gcc_version 4.9.2
# Note, gcc_release must be integer, if you want to add suffixes to # Note, gcc_release must be integer, if you want to add suffixes to
# %{release}, append them after %{gcc_release} on Release: line. # %{release}, append them after %{gcc_release} on Release: line.
%global gcc_release 4 %global gcc_release 5
%global _unpackaged_files_terminate_build 0 %global _unpackaged_files_terminate_build 0
%global _performance_build 1 %global _performance_build 1
%global multilib_64_archs sparc64 ppc64 ppc64p7 s390x x86_64 %global multilib_64_archs sparc64 ppc64 ppc64p7 s390x x86_64
@ -200,6 +200,7 @@ Patch14: gcc49-libgo-p224.patch
Patch15: gcc49-aarch64-async-unw-tables.patch Patch15: gcc49-aarch64-async-unw-tables.patch
Patch16: gcc49-aarch64-unwind-opt.patch Patch16: gcc49-aarch64-unwind-opt.patch
Patch17: gcc49-pr64336.patch Patch17: gcc49-pr64336.patch
Patch18: gcc49-pr64536.patch
Patch1100: cloog-%{cloog_version}-ppc64le-config.patch Patch1100: cloog-%{cloog_version}-ppc64le-config.patch
@ -728,6 +729,7 @@ rm -f libgo/go/crypto/elliptic/p224{,_test}.go
%patch15 -p0 -b .aarch64-async-unw-tables~ %patch15 -p0 -b .aarch64-async-unw-tables~
%patch16 -p0 -b .aarch64-unwind-opt~ %patch16 -p0 -b .aarch64-unwind-opt~
%patch17 -p0 -b .pr64336~ %patch17 -p0 -b .pr64336~
%patch18 -p0 -b .pr64536~
%if 0%{?_enable_debug_packages} %if 0%{?_enable_debug_packages}
cat > split-debuginfo.sh <<\EOF cat > split-debuginfo.sh <<\EOF
@ -2807,6 +2809,10 @@ fi
%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_version}/plugin %{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_version}/plugin
%changelog %changelog
* Thu Jan 8 2015 Jakub Jelinek <jakub@redhat.com> 4.9.2-5
- don't remove tablejumps in rtl_tidy_fallthru_edge (#1136939,
PR rtl-optimization/64536)
* Wed Jan 7 2015 Jakub Jelinek <jakub@redhat.com> 4.9.2-4 * Wed Jan 7 2015 Jakub Jelinek <jakub@redhat.com> 4.9.2-4
- update from the 4.9 branch - update from the 4.9 branch
- PRs ada/64492, c++/38958, c++/60955, c++/63657, c++/63658, c++/64029, - PRs ada/64492, c++/38958, c++/60955, c++/63657, c++/63658, c++/64029,

95
gcc49-pr64536.patch Normal file
View File

@ -0,0 +1,95 @@
2015-01-08 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/64536
* cfgrtl.c (rtl_tidy_fallthru_edge): Don't remove tablejumps.
* gcc.dg/pr64536.c: New test.
--- gcc/cfgrtl.c.jj 2015-01-05 13:07:12.000000000 +0100
+++ gcc/cfgrtl.c 2015-01-08 17:03:18.511218340 +0100
@@ -1782,10 +1782,14 @@ rtl_tidy_fallthru_edge (edge e)
if (INSN_P (q))
return;
+ q = BB_END (b);
+ /* Don't remove table jumps here. */
+ if (tablejump_p (q, NULL, NULL))
+ return;
+
/* Remove what will soon cease being the jump insn from the source block.
If block B consisted only of this single jump, turn it into a deleted
note. */
- q = BB_END (b);
if (JUMP_P (q)
&& onlyjump_p (q)
&& (any_uncondjump_p (q)
--- gcc/testsuite/gcc.dg/pr64536.c.jj 2015-01-08 17:13:32.218929003 +0100
+++ gcc/testsuite/gcc.dg/pr64536.c 2015-01-08 17:28:56.758428958 +0100
@@ -0,0 +1,67 @@
+/* PR rtl-optimization/64536 */
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+/* { dg-additional-options "-fPIC" { target fpic } } */
+
+struct S { long q; } *h;
+long a, b, g, j, k, *c, *d, *e, *f, *i;
+long *baz (void)
+{
+ asm volatile ("" : : : "memory");
+ return e;
+}
+
+void
+bar (int x)
+{
+ int y;
+ for (y = 0; y < x; y++)
+ {
+ switch (b)
+ {
+ case 0:
+ case 2:
+ a++;
+ break;
+ case 3:
+ a++;
+ break;
+ case 1:
+ a++;
+ }
+ if (d)
+ {
+ f = baz ();
+ g = k++;
+ if (&h->q)
+ {
+ j = *f;
+ h->q = *f;
+ }
+ else
+ i = (long *) (h->q = *f);
+ *c++ = (long) f;
+ e += 6;
+ }
+ else
+ {
+ f = baz ();
+ g = k++;
+ if (&h->q)
+ {
+ j = *f;
+ h->q = *f;
+ }
+ else
+ i = (long *) (h->q = *f);
+ *c++ = (long) f;
+ e += 6;
+ }
+ }
+}
+
+int
+main ()
+{
+ return 0;
+}