rhill       14/05/15 00:51:49

  Modified:             09_all_default-ssp.patch README.history
  Added:                30_all_freebsd-pie.patch
                        93_all_pr60971-wrong-code.patch
                        95_all_pr60960-wrong-code.patch
                        96_all_pr59952-avx2-no-rtm.patch
                        97_all_pr60965-devirt-placement-new.patch
  Removed:              92_all_freebsd-pie.patch
  Log:
  More backports.

Revision  Changes    Path
1.3                  src/patchsets/gcc/4.9.0/gentoo/09_all_default-ssp.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.0/gentoo/09_all_default-ssp.patch?rev=1.3&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.0/gentoo/09_all_default-ssp.patch?rev=1.3&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.0/gentoo/09_all_default-ssp.patch?r1=1.2&r2=1.3

Index: 09_all_default-ssp.patch
===================================================================
RCS file: 
/var/cvsroot/gentoo/src/patchsets/gcc/4.9.0/gentoo/09_all_default-ssp.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- 09_all_default-ssp.patch    12 May 2014 14:18:26 -0000      1.2
+++ 09_all_default-ssp.patch    15 May 2014 00:51:49 -0000      1.3
@@ -5,8 +5,8 @@
        We Add -fstack-protector-strong as default and change
        ssp-buffer-size
 
---- a/configure.ac     2013-02-05 23:36:20.000000000 +0100
-+++ b/configure.ac     2013-12-30 22:22:47.241772166 +0100
+--- a/configure.ac
++++ b/configure.ac
 @@ -3238,6 +3238,9 @@ case $build in
      esac ;;
  esac
@@ -17,8 +17,8 @@
  AC_SUBST(stage1_cflags)
  
  # Enable --enable-checking in stage1 of the compiler.
---- a/configure        2013-02-05 23:36:20.000000000 +0100
-+++ b/configure        2013-12-30 22:57:04.301738428 +0100
+--- a/configure
++++ b/configure
 @@ -14453,7 +14453,8 @@ case $build in
      esac ;;
  esac
@@ -29,8 +29,8 @@
  
  # Enable --enable-checking in stage1 of the compiler.
  # Check whether --enable-stage1-checking was given.
---- a/Makefile.in      2013-01-14 17:15:21.000000000 +0100
-+++ b/Makefile.in      2013-12-30 22:26:24.381768605 +0100
+--- a/Makefile.in
++++ b/Makefile.in
 @@ -362,7 +362,7 @@ BUILD_PREFIX_1 = @BUILD_PREFIX_1@
  
  # Flags to pass to stage2 and later makes.  They are defined
@@ -52,8 +52,8 @@
  GOCFLAGS = $(CFLAGS)
  
  TFLAGS =
---- a/gcc/doc/invoke.texi      2014-04-14 17:07:07.000000000 +0200
-+++ b/gcc/doc/invoke.texi      2014-04-24 01:59:21.230308265 +0200
+--- a/gcc/doc/invoke.texi
++++ b/gcc/doc/invoke.texi
 @@ -9239,6 +9251,11 @@ Like @option{-fstack-protector} but incl
  be protected --- those that have local array definitions, or have
  references to local frame addresses.



1.5                  src/patchsets/gcc/4.9.0/gentoo/README.history

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.0/gentoo/README.history?rev=1.5&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.0/gentoo/README.history?rev=1.5&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.0/gentoo/README.history?r1=1.4&r2=1.5

Index: README.history
===================================================================
RCS file: /var/cvsroot/gentoo/src/patchsets/gcc/4.9.0/gentoo/README.history,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- README.history      13 May 2014 02:03:43 -0000      1.4
+++ README.history      15 May 2014 00:51:49 -0000      1.5
@@ -12,6 +12,7 @@
        + 25_all_alpha-mieee-default.patch
        + 26_all_alpha-asm-mcpu.patch
        + 29_all_arm_armv4t-default.patch
+       + 30_all_freebsd-pie.patch
        + 34_all_ia64_note.GNU-stack.patch
        + 38_all_sh_pr24836_all-archs.patch
        + 42_all_superh_default-multilib.patch
@@ -21,5 +22,8 @@
        + 67_all_gcc-poison-system-directories.patch.updateme
        + 74_all_gcc49_cloog-dl.patch
        + 90_all_pr55930-dependency-tracking.patch
-       + 92_all_freebsd-pie.patch
+       + 93_all_pr60971.patch
        + 94_all_pr60902-ffmpeg-miscompile.patch
+       + 95_all_pr60960-wrong-code.patch
+       + 96_all_pr59952-avx2-no-rtm.patch
+       + 97_all_pr60965-devirt-placement-new.patch



1.1                  src/patchsets/gcc/4.9.0/gentoo/30_all_freebsd-pie.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.0/gentoo/30_all_freebsd-pie.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.0/gentoo/30_all_freebsd-pie.patch?rev=1.1&content-type=text/plain

Index: 30_all_freebsd-pie.patch
===================================================================
https://bugs.gentoo.org/415185
http://gcc.gnu.org/ml/gcc-patches/2012-05/msg00555.html

From: Alexis Ballier <aball...@gentoo.org>
To: gcc-patc...@gcc.gnu.org
Cc: Alexis Ballier <aball...@gentoo.org>
Date: Tue, 8 May 2012 09:53:43 -0400
Subject: [PATCH] gcc/config/freebsd-spec.h: Fix building PIE executables. Link 
them with crt{begin,end}S.o and Scrt1.o which are PIC instead of 
crt{begin,end}.o and crt1.o which are not. Spec synced from gnu-user.h.

gcc/config/i386/freebsd.h: Likewise.
---
 gcc/config/freebsd-spec.h |    9 +++------
 gcc/config/i386/freebsd.h |    9 +++------
 2 files changed, 6 insertions(+), 12 deletions(-)

--- a/gcc/config/freebsd-spec.h
+++ b/gcc/config/freebsd-spec.h
@@ -64,11 +64,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If 
not, see
        before entering `main'.  */
    
 #define FBSD_STARTFILE_SPEC \
-  "%{!shared: \
-     %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
-                      %{!p:%{profile:gcrt1.o%s} \
-                        %{!profile:crt1.o%s}}}} \
-   crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
+  "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
+   crti.o%s %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
 
 /* Provide a ENDFILE_SPEC appropriate for FreeBSD.  Here we tack on
    the magical crtend.o file (see crtstuff.c) which provides part of 
@@ -77,7 +74,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If 
not, see
        `crtn.o'.  */
 
 #define FBSD_ENDFILE_SPEC \
-  "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
+  "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
 
 /* Provide a LIB_SPEC appropriate for FreeBSD as configured and as
    required by the user-land thread model.  Before __FreeBSD_version
--- a/gcc/config/i386/freebsd.h
+++ b/gcc/config/i386/freebsd.h
@@ -67,11 +67,8 @@ along with GCC; see the file COPYING3.  If not see
    
 #undef STARTFILE_SPEC
 #define STARTFILE_SPEC \
-  "%{!shared: \
-     %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
-                      %{!p:%{profile:gcrt1.o%s} \
-                        %{!profile:crt1.o%s}}}} \
-   crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
+  "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
+   crti.o%s %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
 
 /* Provide a ENDFILE_SPEC appropriate for FreeBSD.  Here we tack on
    the magical crtend.o file (see crtstuff.c) which provides part of 
@@ -81,7 +78,7 @@ along with GCC; see the file COPYING3.  If not see
 
 #undef ENDFILE_SPEC
 #define ENDFILE_SPEC \
-  "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
+  "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
 
 /* Provide a LINK_SPEC appropriate for FreeBSD.  Here we provide support
    for the special GCC options -static and -shared, which allow us to
-- 
1.7.8.6



1.1                  
src/patchsets/gcc/4.9.0/gentoo/93_all_pr60971-wrong-code.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.0/gentoo/93_all_pr60971-wrong-code.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.0/gentoo/93_all_pr60971-wrong-code.patch?rev=1.1&content-type=text/plain

Index: 93_all_pr60971-wrong-code.patch
===================================================================
http://gcc.gnu.org/PR60971


commit d4cbd343229d110dcc97fc0f6ee224bb66c9e3d0
Author: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Tue Apr 29 14:45:24 2014 +0000

        PR tree-optimization/60971
        * tree-tailcall.c (process_assignment): Reject conversions which
        reduce precision.
    
        * c-c++-common/turtore/pr60971.c: New test.
    
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@209901 
138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog                                |  6 +++++
 gcc/testsuite/ChangeLog                      |  5 ++++
 gcc/testsuite/c-c++-common/torture/pr60971.c | 34 ++++++++++++++++++++++++++++
 gcc/tree-tailcall.c                          | 14 ++++++++++--
 4 files changed, 57 insertions(+), 2 deletions(-)

--- a/gcc/tree-tailcall.c
+++ b/gcc/tree-tailcall.c
@@ -285,9 +285,19 @@ process_assignment (gimple stmt, gimple_stmt_iterator 
call, tree *m,
     {
       /* Reject a tailcall if the type conversion might need
         additional code.  */
-      if (gimple_assign_cast_p (stmt)
-         && TYPE_MODE (TREE_TYPE (dest)) != TYPE_MODE (TREE_TYPE (src_var)))
+      if (gimple_assign_cast_p (stmt))
+       {
+         if (TYPE_MODE (TREE_TYPE (dest)) != TYPE_MODE (TREE_TYPE (src_var)))
+           return false;
+
+         /* Even if the type modes are the same, if the precision of the
+            type is smaller than mode's precision,
+            reduce_to_bit_field_precision would generate additional code.  */
+         if (INTEGRAL_TYPE_P (TREE_TYPE (dest))
+             && (GET_MODE_PRECISION (TYPE_MODE (TREE_TYPE (dest)))
+                 > TYPE_PRECISION (TREE_TYPE (dest))))
            return false;
+       }
 
       if (src_var != *ass_var)
        return false;
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/torture/pr60971.c
@@ -0,0 +1,34 @@
+/* PR tree-optimization/60971 */
+/* { dg-do run } */
+
+#ifndef __cplusplus
+#define bool _Bool
+#endif
+
+volatile unsigned char c;
+
+__attribute__((noinline)) unsigned char
+foo (void)
+{
+  return c;
+}
+
+__attribute__((noinline)) bool
+bar (void)
+{
+  return foo () & 1;
+}
+
+int
+main ()
+{
+  c = 0x41;
+  c = bar ();
+  if (c != 1)
+    __builtin_abort ();
+  c = 0x20;
+  c = bar ();
+  if (c != 0)
+    __builtin_abort ();
+  return 0;
+}



1.1                  
src/patchsets/gcc/4.9.0/gentoo/95_all_pr60960-wrong-code.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.0/gentoo/95_all_pr60960-wrong-code.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.0/gentoo/95_all_pr60960-wrong-code.patch?rev=1.1&content-type=text/plain

Index: 95_all_pr60960-wrong-code.patch
===================================================================
http://gcc.gnu.org/PR60960


commit a493a39ec94ab336ddbeaee65ba70e77a68b2e18
Author: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Fri Apr 25 13:53:45 2014 +0000

        PR tree-optimization/60960
        * tree-vect-generic.c (expand_vector_operation): Only call
        expand_vector_divmod if type's mode satisfies VECTOR_MODE_P.
    
        * gcc.c-torture/execute/pr60960.c: New test.
    
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@209803 
138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog                                 |  6 +++++
 gcc/testsuite/ChangeLog                       |  5 ++++
 gcc/testsuite/gcc.c-torture/execute/pr60960.c | 38 +++++++++++++++++++++++++++
 gcc/tree-vect-generic.c                       |  3 ++-
 4 files changed, 51 insertions(+), 1 deletion(-)

--- a/gcc/tree-vect-generic.c
+++ b/gcc/tree-vect-generic.c
@@ -971,7 +971,8 @@ expand_vector_operation (gimple_stmt_iterator *gsi, tree 
type, tree compute_type
 
          if (!optimize
              || !VECTOR_INTEGER_TYPE_P (type)
-             || TREE_CODE (rhs2) != VECTOR_CST)
+             || TREE_CODE (rhs2) != VECTOR_CST
+             || !VECTOR_MODE_P (TYPE_MODE (type)))
            break;
 
          ret = expand_vector_divmod (gsi, type, rhs1, rhs2, code);
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr60960.c
@@ -0,0 +1,38 @@
+/* PR tree-optimization/60960 */
+
+typedef unsigned char v4qi __attribute__ ((vector_size (4)));
+
+__attribute__((noinline, noclone)) v4qi
+f1 (v4qi v)
+{
+  return v / 2;
+}
+
+__attribute__((noinline, noclone)) v4qi
+f2 (v4qi v)
+{
+  return v / (v4qi) { 2, 2, 2, 2 };
+}
+
+__attribute__((noinline, noclone)) v4qi
+f3 (v4qi x, v4qi y)
+{
+  return x / y;
+}
+
+int
+main ()
+{
+  v4qi x = { 5, 5, 5, 5 };
+  v4qi y = { 2, 2, 2, 2 };
+  v4qi z = f1 (x);
+  if (__builtin_memcmp (&y, &z, sizeof (y)) != 0)
+    __builtin_abort ();
+  z = f2 (x);
+  if (__builtin_memcmp (&y, &z, sizeof (y)) != 0)
+    __builtin_abort ();
+  z = f3 (x, y);
+  if (__builtin_memcmp (&y, &z, sizeof (y)) != 0)
+    __builtin_abort ();
+  return 0;
+}



1.1                  
src/patchsets/gcc/4.9.0/gentoo/96_all_pr59952-avx2-no-rtm.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.0/gentoo/96_all_pr59952-avx2-no-rtm.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.0/gentoo/96_all_pr59952-avx2-no-rtm.patch?rev=1.1&content-type=text/plain

Index: 96_all_pr59952-avx2-no-rtm.patch
===================================================================
https://gcc.gnu.org/PR59952


commit 53a22ec99f29d60ec33a30628e05106b11612833
Author: uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Thu May 8 19:23:45 2014 +0000

        PR target/59952
        * config/i386/i386.c (PTA_HASWELL): Remove PTA_RTM.
    
    
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@210236 
138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog          | 5 +++++
 gcc/config/i386/i386.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -3128,7 +3128,7 @@ ix86_option_override_internal (bool main_args_p,
   (PTA_SANDYBRIDGE | PTA_FSGSBASE | PTA_RDRND | PTA_F16C)
 #define PTA_HASWELL \
   (PTA_IVYBRIDGE | PTA_AVX2 | PTA_BMI | PTA_BMI2 | PTA_LZCNT \
-   | PTA_FMA | PTA_MOVBE | PTA_RTM | PTA_HLE)
+   | PTA_FMA | PTA_MOVBE | PTA_HLE)
 #define PTA_BROADWELL \
   (PTA_HASWELL | PTA_ADX | PTA_PRFCHW | PTA_RDSEED)
 #define PTA_BONNELL \



1.1                  
src/patchsets/gcc/4.9.0/gentoo/97_all_pr60965-devirt-placement-new.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.0/gentoo/97_all_pr60965-devirt-placement-new.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.0/gentoo/97_all_pr60965-devirt-placement-new.patch?rev=1.1&content-type=text/plain

Index: 97_all_pr60965-devirt-placement-new.patch
===================================================================
Fixes OpenJDK, IcedTea, Qt, and Chromium crashes.
https://gcc.gnu.org/PR60965


commit 6977ccded4335bd8c0215ccfcab861598f8e9388
Author: hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Mon May 5 19:40:34 2014 +0000

        PR ipa/60965
        * g++.dg/ipa/devirt-31.C: New testcase.
        * g++.dg/ipa/devirt-11.C: Adjust testcase.
        * ipa-devirt.c (get_class_context): Allow POD to change to non-POD.
    
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@210079 
138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog                        |  5 +++++
 gcc/ipa-devirt.c                     | 11 +++++++++++
 gcc/testsuite/ChangeLog              |  6 ++++++
 gcc/testsuite/g++.dg/ipa/devirt-11.C |  2 +-
 gcc/testsuite/g++.dg/ipa/devirt-31.C | 23 +++++++++++++++++++++++
 5 files changed, 46 insertions(+), 1 deletion(-)

--- a/gcc/ipa-devirt.c
+++ b/gcc/ipa-devirt.c
@@ -987,6 +987,17 @@ give_up:
   context->outer_type = expected_type;
   context->offset = 0;
   context->maybe_derived_type = true;
+  context->maybe_in_construction = true;
+  /* POD can be changed to an instance of a polymorphic type by
+     placement new.  Here we play safe and assume that any
+     non-polymorphic type is POD.  */
+  if ((TREE_CODE (type) != RECORD_TYPE
+       || !TYPE_BINFO (type)
+       || !polymorphic_type_binfo_p (TYPE_BINFO (type)))
+      && (TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST
+         || (offset + tree_to_uhwi (TYPE_SIZE (expected_type)) <=
+             tree_to_uhwi (TYPE_SIZE (type)))))
+    return true;
   return false;
 }
 
--- a/gcc/testsuite/g++.dg/ipa/devirt-11.C
+++ b/gcc/testsuite/g++.dg/ipa/devirt-11.C
@@ -45,5 +45,5 @@ bar ()
 /* While inlining function called once we should devirtualize a new call to fn2
    and two to fn3. While doing so the new symbol for fn2 needs to be
    introduced.  */
-/* { dg-final { scan-ipa-dump-times "Discovered a virtual call to a known 
target" 3 "inline"  } } */
+/* { dg-final { scan-ipa-dump-times "Discovered a virtual call to a known 
target" 1 "inline"  } } */
 /* { dg-final { cleanup-ipa-dump "inline" } } */
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ipa/devirt-31.C
@@ -0,0 +1,23 @@
+/* { dg-options "-O2 -std=c++11 -fdump-ipa-inline"  } */
+#include <new>
+
+class EmbeddedObject {
+public:
+  virtual int val() { return 2; }
+};
+
+class Container {
+  alignas(EmbeddedObject) char buffer[sizeof(EmbeddedObject)];
+public:
+  EmbeddedObject *obj() { return (EmbeddedObject*)buffer; }
+  Container() { new (buffer) EmbeddedObject(); }
+};
+
+Container o;
+
+int main()
+{
+  __builtin_printf("%d\n", o.obj()->val());
+}
+/* { dg-final { scan-ipa-dump-not "__builtin_unreachable"  "inline"  } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */




Reply via email to