Commit dbd59515 by Richard Biener Committed by Richard Biener

re PR middle-end/90607 (gcc.dg/pr53265.c FAILs)

2019-05-24  Richard Biener  <rguenther@suse.de>

	PR testsuite/90607
	* tree-loop-distribution.c (struct partition): Add location
	member.
	(partition_alloc): Initialize all fields.
	(generate_memset_builtin): Use the location recorded in the
	partition for the generated call.
	(generate_memcpy_builtin): Likewise.
	(classify_partition): Record the location of a single store
	as location for the partition.

	* gcc.dg/pr53265.c: Amend for new expected diagnostic.

From-SVN: r271601
parent 3258c2d6
2019-05-24 Richard Biener <rguenther@suse.de>
PR testsuite/90607
* tree-loop-distribution.c (struct partition): Add location
member.
(partition_alloc): Initialize all fields.
(generate_memset_builtin): Use the location recorded in the
partition for the generated call.
(generate_memcpy_builtin): Likewise.
(classify_partition): Record the location of a single store
as location for the partition.
2019-05-24 Andrew Stubbs <ams@codesourcery.com> 2019-05-24 Andrew Stubbs <ams@codesourcery.com>
* config/gcn/gcn.c (gcn_expand_prologue): Use gen_addsi3_scalar_carry * config/gcn/gcn.c (gcn_expand_prologue): Use gen_addsi3_scalar_carry
......
2019-05-24 Richard Biener <rguenther@suse.de>
PR testsuite/90607
* gcc.dg/pr53265.c: Amend for new expected diagnostic.
2019-05-24 Jakub Jelinek <jakub@redhat.com> 2019-05-24 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/90106 PR tree-optimization/90106
......
...@@ -38,7 +38,8 @@ fn3 (void) ...@@ -38,7 +38,8 @@ fn3 (void)
for (i = 0; i < (int) (sizeof (a) / sizeof (a[0])); i++) /* { dg-message "note: within this loop" } */ for (i = 0; i < (int) (sizeof (a) / sizeof (a[0])); i++) /* { dg-message "note: within this loop" } */
{ {
c[i + 8] = b[i]; /* { dg-warning "8 invokes undefined behavior" } */ c[i + 8] = b[i]; /* { dg-warning "8 invokes undefined behavior" } */
a[i + 8] = b[i + 8]; /* { dg-warning "out of the bounds" "" { target *-*-* } .-1 } */
a[i + 8] = b[i + 8]; /* { dg-warning "out of the bounds" } */
} }
bar (a); bar (a);
bar (c); bar (c);
......
...@@ -636,6 +636,7 @@ struct partition ...@@ -636,6 +636,7 @@ struct partition
bitmap stmts; bitmap stmts;
/* True if the partition defines variable which is used outside of loop. */ /* True if the partition defines variable which is used outside of loop. */
bool reduction_p; bool reduction_p;
location_t loc;
enum partition_kind kind; enum partition_kind kind;
enum partition_type type; enum partition_type type;
/* Data references in the partition. */ /* Data references in the partition. */
...@@ -653,7 +654,9 @@ partition_alloc (void) ...@@ -653,7 +654,9 @@ partition_alloc (void)
partition *partition = XCNEW (struct partition); partition *partition = XCNEW (struct partition);
partition->stmts = BITMAP_ALLOC (NULL); partition->stmts = BITMAP_ALLOC (NULL);
partition->reduction_p = false; partition->reduction_p = false;
partition->loc = UNKNOWN_LOCATION;
partition->kind = PKIND_NORMAL; partition->kind = PKIND_NORMAL;
partition->type = PTYPE_PARALLEL;
partition->datarefs = BITMAP_ALLOC (NULL); partition->datarefs = BITMAP_ALLOC (NULL);
return partition; return partition;
} }
...@@ -1028,6 +1031,7 @@ generate_memset_builtin (struct loop *loop, partition *partition) ...@@ -1028,6 +1031,7 @@ generate_memset_builtin (struct loop *loop, partition *partition)
fn = build_fold_addr_expr (builtin_decl_implicit (BUILT_IN_MEMSET)); fn = build_fold_addr_expr (builtin_decl_implicit (BUILT_IN_MEMSET));
fn_call = gimple_build_call (fn, 3, mem, val, nb_bytes); fn_call = gimple_build_call (fn, 3, mem, val, nb_bytes);
gimple_set_location (fn_call, partition->loc);
gsi_insert_after (&gsi, fn_call, GSI_CONTINUE_LINKING); gsi_insert_after (&gsi, fn_call, GSI_CONTINUE_LINKING);
fold_stmt (&gsi); fold_stmt (&gsi);
...@@ -1072,6 +1076,7 @@ generate_memcpy_builtin (struct loop *loop, partition *partition) ...@@ -1072,6 +1076,7 @@ generate_memcpy_builtin (struct loop *loop, partition *partition)
false, GSI_CONTINUE_LINKING); false, GSI_CONTINUE_LINKING);
fn = build_fold_addr_expr (builtin_decl_implicit (kind)); fn = build_fold_addr_expr (builtin_decl_implicit (kind));
fn_call = gimple_build_call (fn, 3, dest, src, nb_bytes); fn_call = gimple_build_call (fn, 3, dest, src, nb_bytes);
gimple_set_location (fn_call, partition->loc);
gsi_insert_after (&gsi, fn_call, GSI_CONTINUE_LINKING); gsi_insert_after (&gsi, fn_call, GSI_CONTINUE_LINKING);
fold_stmt (&gsi); fold_stmt (&gsi);
...@@ -1706,6 +1711,8 @@ classify_partition (loop_p loop, struct graph *rdg, partition *partition, ...@@ -1706,6 +1711,8 @@ classify_partition (loop_p loop, struct graph *rdg, partition *partition,
if (!find_single_drs (loop, rdg, partition, &single_st, &single_ld)) if (!find_single_drs (loop, rdg, partition, &single_st, &single_ld))
return; return;
partition->loc = gimple_location (DR_STMT (single_st));
/* Classify the builtin kind. */ /* Classify the builtin kind. */
if (single_ld == NULL) if (single_ld == NULL)
classify_builtin_st (loop, partition, single_st); classify_builtin_st (loop, partition, single_st);
......
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