66 lines
2.2 KiB
Diff
66 lines
2.2 KiB
Diff
2014-02-13 Jakub Jelinek <jakub@redhat.com>
|
|
|
|
* tree-vect-transform.c (get_initial_def_for_induction): Skip debug
|
|
statements.
|
|
(vect_finalize_reduction): Likewise.
|
|
(vect_transform_stmt): Likewise.
|
|
|
|
* gcc.c-torture/compile/20140213.c: New test.
|
|
|
|
--- gcc/tree-vect-transform.c.jj 2010-04-27 20:50:45.000000000 +0200
|
|
+++ gcc/tree-vect-transform.c 2014-02-13 14:48:01.073404362 +0100
|
|
@@ -1853,7 +1853,8 @@ get_initial_def_for_induction (gimple iv
|
|
exit_phi = NULL;
|
|
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, loop_arg)
|
|
{
|
|
- if (!flow_bb_inside_loop_p (iv_loop, gimple_bb (USE_STMT (use_p))))
|
|
+ if (!is_gimple_debug (USE_STMT (use_p))
|
|
+ && !flow_bb_inside_loop_p (iv_loop, gimple_bb (USE_STMT (use_p))))
|
|
{
|
|
exit_phi = USE_STMT (use_p);
|
|
break;
|
|
@@ -2736,7 +2737,8 @@ vect_finalize_reduction:
|
|
phis = VEC_alloc (gimple, heap, 10);
|
|
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, scalar_dest)
|
|
{
|
|
- if (!flow_bb_inside_loop_p (loop, gimple_bb (USE_STMT (use_p))))
|
|
+ if (!is_gimple_debug (USE_STMT (use_p))
|
|
+ && !flow_bb_inside_loop_p (loop, gimple_bb (USE_STMT (use_p))))
|
|
{
|
|
exit_phi = USE_STMT (use_p);
|
|
VEC_quick_push (gimple, phis, exit_phi);
|
|
@@ -7162,7 +7164,8 @@ vect_transform_stmt (gimple stmt, gimple
|
|
|
|
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, scalar_dest)
|
|
{
|
|
- if (!flow_bb_inside_loop_p (innerloop, gimple_bb (USE_STMT (use_p))))
|
|
+ if (!is_gimple_debug (USE_STMT (use_p))
|
|
+ && !flow_bb_inside_loop_p (innerloop, gimple_bb (USE_STMT (use_p))))
|
|
{
|
|
exit_phi = USE_STMT (use_p);
|
|
STMT_VINFO_VEC_STMT (vinfo_for_stmt (exit_phi)) = vec_stmt;
|
|
--- gcc/testsuite/gcc.c-torture/compile/20140213.c.jj 2013-08-25 18:20:55.717911035 +0200
|
|
+++ gcc/testsuite/gcc.c-torture/compile/20140213.c 2014-02-13 16:23:45.631401820 +0100
|
|
@@ -0,0 +1,21 @@
|
|
+static unsigned short
|
|
+foo (unsigned char *x, int y)
|
|
+{
|
|
+ unsigned short r = 0;
|
|
+ int i;
|
|
+ for (i = 0; i < y; i++)
|
|
+ r += x[i];
|
|
+ return r;
|
|
+}
|
|
+
|
|
+int baz (int, unsigned short);
|
|
+
|
|
+void
|
|
+bar (unsigned char *x, unsigned char *y)
|
|
+{
|
|
+ int i;
|
|
+ unsigned short key = foo (x, 0x10000);
|
|
+ baz (0, 0);
|
|
+ for (i = 0; i < 0x80000; i++)
|
|
+ y[i] = x[baz (i, key)];
|
|
+}
|