Commit 1cabb204 by Tom de Vries Committed by Tom de Vries

Always call free_stmt_vec_info_vec in gather_scalar_reductions

2015-11-23  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/68460
	* tree-parloops.c (gather_scalar_reductions): Also call
	free_stmt_vec_info_vec if simple_loop_info == NULL.

	* gcc.dg/autopar/pr68460.c: New test.

From-SVN: r230742
parent b59e2a49
2015-11-23 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/68460
* tree-parloops.c (gather_scalar_reductions): Also call
free_stmt_vec_info_vec if simple_loop_info == NULL.
2015-11-23 Maxim Ostapenko <m.ostapenko@partner.samsung.com> 2015-11-23 Maxim Ostapenko <m.ostapenko@partner.samsung.com>
* opts.c (finish_options): Allow -fsanitize-recover=address for * opts.c (finish_options): Allow -fsanitize-recover=address for
2015-11-23 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/68460
* gcc.dg/autopar/pr68460.c: New test.
2015-11-23 Maxim Ostapenko <m.ostapenko@partner.samsung.com> 2015-11-23 Maxim Ostapenko <m.ostapenko@partner.samsung.com>
* c-c++-common/asan/halt_on_error-1.c: New test. * c-c++-common/asan/halt_on_error-1.c: New test.
......
/* { dg-do "compile" } */
/* { dg-options "-O -ftree-parallelize-loops=2 -ftree-vectorize -fno-tree-ch -fno-tree-dominator-opts" } */
void abort (void);
int d[1024], e[1024];
int
foo (void)
{
int s = 0;
int i;
for (i = 0; i < 1024; i++)
s += d[i] - e[i];
return s;
}
int
main ()
{
int i;
for (i = 0; i < 1024; i++)
{
d[i] = i * 2;
e[i] = i;
}
if (foo () != 1023 * 1024 / 2)
abort ();
return 0;
}
...@@ -2433,7 +2433,7 @@ gather_scalar_reductions (loop_p loop, reduction_info_table_type *reduction_list ...@@ -2433,7 +2433,7 @@ gather_scalar_reductions (loop_p loop, reduction_info_table_type *reduction_list
simple_loop_info = vect_analyze_loop_form (loop); simple_loop_info = vect_analyze_loop_form (loop);
if (simple_loop_info == NULL) if (simple_loop_info == NULL)
return; goto gather_done;
for (gsi = gsi_start_phis (loop->header); !gsi_end_p (gsi); gsi_next (&gsi)) for (gsi = gsi_start_phis (loop->header); !gsi_end_p (gsi); gsi_next (&gsi))
{ {
...@@ -2492,9 +2492,13 @@ gather_scalar_reductions (loop_p loop, reduction_info_table_type *reduction_list ...@@ -2492,9 +2492,13 @@ gather_scalar_reductions (loop_p loop, reduction_info_table_type *reduction_list
destroy_loop_vec_info (simple_loop_info, true); destroy_loop_vec_info (simple_loop_info, true);
destroy_loop_vec_info (simple_inner_loop_info, true); destroy_loop_vec_info (simple_inner_loop_info, true);
gather_done:
/* Release the claim on gimple_uid. */ /* Release the claim on gimple_uid. */
free_stmt_vec_info_vec (); free_stmt_vec_info_vec ();
if (reduction_list->elements () == 0)
return;
/* As gimple_uid is used by the vectorizer in between vect_analyze_loop_form /* As gimple_uid is used by the vectorizer in between vect_analyze_loop_form
and free_stmt_vec_info_vec, we can set gimple_uid of reduc_phi stmts only and free_stmt_vec_info_vec, we can set gimple_uid of reduc_phi stmts only
now. */ now. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment