I have bootstrapped / tested the following backports on 
x86_64-unknown-linux-gnu.

Richard.

2016-05-23  Richard Biener  <rguent...@suse.de>

        Backport from mainline
        2015-12-11  Segher Boessenkool  <seg...@kernel.crashing.org>

        PR rtl-optimization/68814
        * rtlanal.c (set_noop_p): Use BITS_BIG_ENDIAN instead of
        BYTES_BIG_ENDIAN.

        2016-01-12  Jan Hubicka  <hubi...@ucw.cz>

        PR lto/69003
        * lto-partition.c (rename_statics): Fix pasto.

        2016-01-13  Jan Hubicka  <hubi...@ucw.cz>

        PR ipa/66487
        * ipa-polymorphic-call.c (inlined_polymorphic_ctor_dtor_block_p):
        use block_ultimate_origin
        (noncall-stmt_may_be_vtbl_ptr_store): Likewise.
        
        2016-02-08  Jakub Jelinek  <ja...@redhat.com>

        PR ipa/69239
        * g++.dg/ipa/pr69239.C: New test.

        2016-01-21  Roman Zhuykov  <zhr...@ispras.ru>

        PR target/69252
        * modulo-sched.c (optimize_sc): Allow branch-scheduling to add a new
        first stage.

        2016-01-21  Martin Sebor  <mse...@redhat.com>

        PR target/69252
        * gcc.target/powerpc/pr69252.c: New test.


Index: gcc/rtlanal.c
===================================================================
--- gcc/rtlanal.c       (revision 231546)
+++ gcc/rtlanal.c       (revision 231547)
@@ -1534,7 +1534,7 @@ set_noop_p (const_rtx set)
 
   if (GET_CODE (dst) == ZERO_EXTRACT)
     return rtx_equal_p (XEXP (dst, 0), src)
-          && ! BYTES_BIG_ENDIAN && XEXP (dst, 2) == const0_rtx
+          && !BITS_BIG_ENDIAN && XEXP (dst, 2) == const0_rtx
           && !side_effects_p (src);
 
   if (GET_CODE (dst) == STRICT_LOW_PART)
Index: gcc/lto/lto-partition.c
===================================================================
--- gcc/lto/lto-partition.c     (revision 232524)
+++ gcc/lto/lto-partition.c     (revision 232525)
@@ -1077,8 +1077,8 @@ rename_statics (lto_symtab_encoder_t enc
                  IDENTIFIER_POINTER
                    (DECL_ASSEMBLER_NAME (s->get_alias_target()->decl))))
        && ((s->real_symbol_p ()
-             && !DECL_EXTERNAL (node->decl)
-            && !TREE_PUBLIC (node->decl))
+             && !DECL_EXTERNAL (s->decl)
+            && !TREE_PUBLIC (s->decl))
            || may_need_named_section_p (encoder, s))
        && (!encoder
            || lto_symtab_encoder_lookup (encoder, s) != LCC_NOT_FOUND))
Index: gcc/ipa-polymorphic-call.c
===================================================================
--- gcc/ipa-polymorphic-call.c  (revision 232355)
+++ gcc/ipa-polymorphic-call.c  (revision 232356)
@@ -484,7 +484,7 @@ contains_type_p (tree outer_type, HOST_W
 tree
 inlined_polymorphic_ctor_dtor_block_p (tree block, bool check_clones)
 {
-  tree fn = BLOCK_ABSTRACT_ORIGIN (block);
+  tree fn = block_ultimate_origin (block);
   if (fn == NULL || TREE_CODE (fn) != FUNCTION_DECL)
     return NULL_TREE;
 
@@ -1143,7 +1143,7 @@ noncall_stmt_may_be_vtbl_ptr_store (gimp
   for (tree block = gimple_block (stmt); block && TREE_CODE (block) == BLOCK;
        block = BLOCK_SUPERCONTEXT (block))
     if (BLOCK_ABSTRACT_ORIGIN (block)
-       && TREE_CODE (BLOCK_ABSTRACT_ORIGIN (block)) == FUNCTION_DECL)
+       && TREE_CODE (block_ultimate_origin (block)) == FUNCTION_DECL)
       return inlined_polymorphic_ctor_dtor_block_p (block, false);
   return (TREE_CODE (TREE_TYPE (current_function_decl)) == METHOD_TYPE
          && (DECL_CXX_CONSTRUCTOR_P (current_function_decl)
Index: gcc/testsuite/g++.dg/ipa/pr69239.C
===================================================================
--- gcc/testsuite/g++.dg/ipa/pr69239.C  (revision 0)
+++ gcc/testsuite/g++.dg/ipa/pr69239.C  (revision 233224)
@@ -0,0 +1,71 @@
+// PR ipa/69239
+// { dg-do run }
+// { dg-options "-O2 --param=early-inlining-insns=196" }
+// { dg-additional-options "-fPIC" { target fpic } }
+
+struct D
+{
+  float f;
+  D () {}
+  virtual float bar (float z);
+};
+
+struct A
+{
+  A ();
+  virtual int foo (int i);
+};
+
+struct B : public D, public A
+{
+  virtual int foo (int i);
+};
+
+float
+D::bar (float)
+{
+  return f / 2;
+}
+
+int
+A::foo (int i)
+{
+  return i + 1;
+}
+
+int
+B::foo (int i)
+{
+  return i + 2;
+}
+
+int __attribute__ ((noinline,noclone))
+baz ()
+{
+  return 1;
+}
+
+static int __attribute__ ((noinline))
+fn (A *obj, int i)
+{
+  return obj->foo (i);
+}
+
+inline __attribute__ ((always_inline))
+A::A ()
+{
+  if (fn (this, baz ()) != 2)
+    __builtin_abort ();
+}
+
+static void
+bah ()
+{
+  B b;
+}
+
+int
+main ()
+{
+  bah ();
+}
Index: gcc/testsuite/gcc.target/powerpc/pr69252.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/pr69252.c  (revision 0)
+++ gcc/testsuite/gcc.target/powerpc/pr69252.c  (revision 232712)
@@ -0,0 +1,28 @@
+/* PR target/69252 - [4.9/5/6 Regression] gcc.dg/vect/vect-iv-9.c FAILs
+   with -Os -fmodulo-sched -fmodulo-sched-allow-regmoves -fsched-pressure  */
+/* { dg-do run } */
+/* { dg-options "-Os -fmodulo-sched -fmodulo-sched-allow-regmoves 
-fsched-pressure " } */
+#define N 26
+int a[N];
+__attribute__ ((noinline, noclone))
+     int main1 (int X)
+{
+  int s = X;
+  int i;
+  for (i = 0; i < N; i++)
+    s += (i + a[i]);
+  return s;
+}
+
+int
+main (void)
+{
+  int s, i;
+  for (i = 0; i < N; i++)
+    a[i] = 2 * i;
+  s = main1 (3);
+  if (s != 978)
+    __builtin_abort ();
+  return 0;
+}
+
Index: gcc/modulo-sched.c
===================================================================
--- gcc/modulo-sched.c  (revision 232711)
+++ gcc/modulo-sched.c  (revision 232712)
@@ -985,7 +985,7 @@ optimize_sc (partial_schedule_ptr ps, dd
       int row = SMODULO (branch_cycle, ps->ii);
       int num_splits = 0;
       sbitmap must_precede, must_follow, tmp_precede, tmp_follow;
-      int c;
+      int min_cycle, c;
 
       if (dump_file)
        fprintf (dump_file, "\nTrying to schedule node %d "
@@ -1040,6 +1040,7 @@ optimize_sc (partial_schedule_ptr ps, dd
        if (next_ps_i->id == g->closing_branch->cuid)
          break;
 
+      min_cycle = PS_MIN_CYCLE (ps) - SMODULO (PS_MIN_CYCLE (ps), ps->ii);
       remove_node_from_ps (ps, next_ps_i);
       success =
        try_scheduling_node_in_cycle (ps, g->closing_branch->cuid, c,
@@ -1079,6 +1080,10 @@ optimize_sc (partial_schedule_ptr ps, dd
          ok = true;
        }
 
+      /* This might have been added to a new first stage.  */
+      if (PS_MIN_CYCLE (ps) < min_cycle)
+       reset_sched_times (ps, 0);
+
       free (must_precede);
       free (must_follow);
     }

Reply via email to