aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-01-23 00:14:27 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2016-01-23 00:14:27 +0100
commit62041cfc096feb6e4e4a9bf5bbeab906dad708fa (patch)
tree716f6f2730dc130c33b02e1dbd3f1feda7fdc850
parentd403fc9a7b069eb27229796569ef654a5600e562 (diff)
downloadgcc-62041cfc096feb6e4e4a9bf5bbeab906dad708fa.zip
gcc-62041cfc096feb6e4e4a9bf5bbeab906dad708fa.tar.gz
gcc-62041cfc096feb6e4e4a9bf5bbeab906dad708fa.tar.bz2
re PR other/69432 (ICE in connect_traces, at dwarf2cfi.c with -O3 -m32 -minline-stringops-dynamically)
PR target/69432 * config/i386/i386.c: Include dojump.h. (expand_small_movmem_or_setmem, expand_set_or_movmem_prologue_epilogue_by_misaligned_moves): Spelling fixes. (ix86_expand_set_or_movmem): Call do_pending_stack_adjust () early if dynamic_check != -1. * g++.dg/opt/pr69432.C: New test. From-SVN: r232754
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/i386/i386.c14
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/opt/pr69432.C62
4 files changed, 88 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b86024d..9712574 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2016-01-22 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/69432
+ * config/i386/i386.c: Include dojump.h.
+ (expand_small_movmem_or_setmem,
+ expand_set_or_movmem_prologue_epilogue_by_misaligned_moves): Spelling
+ fixes.
+ (ix86_expand_set_or_movmem): Call do_pending_stack_adjust () early
+ if dynamic_check != -1.
+
2016-01-21 Jeff Law <law@redhat.com>
PR middle-end/69347
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 92d8ee1..34b57a4 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -75,6 +75,7 @@ along with GCC; see the file COPYING3. If not see
#include "dbgcnt.h"
#include "case-cfn-macros.h"
#include "regrename.h"
+#include "dojump.h"
/* This file should be included last. */
#include "target-def.h"
@@ -25700,7 +25701,7 @@ expand_small_movmem_or_setmem (rtx destmem, rtx srcmem,
if (DYNAMIC_CHECK)
Round COUNT down to multiple of SIZE
<< optional caller supplied zero size guard is here >>
- << optional caller suppplied dynamic check is here >>
+ << optional caller supplied dynamic check is here >>
<< caller supplied main copy loop is here >>
}
done_label:
@@ -25875,8 +25876,8 @@ expand_set_or_movmem_prologue_epilogue_by_misaligned_moves (rtx destmem, rtx src
else
*min_size = 0;
- /* Our loops always round down the bock size, but for dispatch to library
- we need precise value. */
+ /* Our loops always round down the block size, but for dispatch to
+ library we need precise value. */
if (dynamic_check)
*count = expand_simple_binop (GET_MODE (*count), AND, *count,
GEN_INT (-size), *count, 1, OPTAB_DIRECT);
@@ -26469,6 +26470,13 @@ ix86_expand_set_or_movmem (rtx dst, rtx src, rtx count_exp, rtx val_exp,
size_needed = GET_MODE_SIZE (move_mode) * unroll_factor;
epilogue_size_needed = size_needed;
+ /* If we are going to call any library calls conditionally, make sure any
+ pending stack adjustment happen before the first conditional branch,
+ otherwise they will be emitted before the library call only and won't
+ happen from the other branches. */
+ if (dynamic_check != -1)
+ do_pending_stack_adjust ();
+
desired_align = decide_alignment (align, alg, expected_size, move_mode);
if (!TARGET_ALIGN_STRINGOPS || noalign)
align = desired_align;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 0b4b2d7..7cb0739 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2016-01-22 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/69432
+ * g++.dg/opt/pr69432.C: New test.
+
2016-01-22 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* gcc.target/powerpc/pr63354c: Adjust target selector to include
diff --git a/gcc/testsuite/g++.dg/opt/pr69432.C b/gcc/testsuite/g++.dg/opt/pr69432.C
new file mode 100644
index 0000000..1f23f2c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr69432.C
@@ -0,0 +1,62 @@
+// PR target/69432
+// { dg-do compile }
+// { dg-options "-O3" }
+// { dg-additional-options "-minline-stringops-dynamically" { target i?86-*-* x86_64-*-* } }
+
+template <typename S, typename T, typename U>
+void
+f1 (S x, T y, U z)
+{
+ for (; y; --y, ++x)
+ *x = z;
+}
+
+template <typename S, typename T, typename U>
+void f2 (S x, T y, U z)
+{
+ f1 (x, y, z);
+}
+
+struct A {};
+struct B { static char f3 (A, unsigned); };
+
+template <typename S, typename U>
+void f4 (S, U);
+
+struct C
+{
+ template <typename S, typename T, typename U>
+ static S f5 (S x, T y, U z) { f2 (x, y, z); }
+};
+
+template <typename S, typename T, typename U>
+void f6 (S x, T y, U z) { C::f5 (x, y, z); }
+
+template <typename S, typename T, typename U, typename V>
+void f7 (S x, T y, U z, V) { f6 (x, y, z); }
+
+struct E
+{
+ struct D : A { char e; D (A); };
+ A f;
+ E (int x) : g(f) { f8 (x); }
+ ~E ();
+ D g;
+ void f9 (int x) { x ? B::f3 (g, x) : char (); }
+ void f8 (int x) { f9 (x); }
+};
+
+struct F : E
+{
+ F (int x) : E(x) { f10 (x); f4 (this, 0); }
+ char h;
+ void f10 (int x) { f7 (&g.e, x, h, 0); }
+};
+
+long a;
+
+void
+test ()
+{
+ F b(a);
+}