re PR tree-optimization/58554 (Revision 202619 causes runtime failure in CPU2006 benchmark 445.gobmk)

2013-09-30  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/58554
	* tree-loop-distribution.c (classify_partition): Require unconditionally
	executed stores for memcpy and memset recognition.
	(tree_loop_distribution): Calculate dominance info.

	* gcc.dg/torture/pr58554.c: New testcase.

From-SVN: r203031
This commit is contained in:
Richard Biener 2013-09-30 12:22:00 +00:00 committed by Richard Biener
parent 92d649c492
commit ca406576e5
4 changed files with 39 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2013-09-30 Richard Biener <rguenther@suse.de>
PR tree-optimization/58554
* tree-loop-distribution.c (classify_partition): Require unconditionally
executed stores for memcpy and memset recognition.
(tree_loop_distribution): Calculate dominance info.
2013-09-30 Venkataramanan Kumar <venkataramanan.kumar@linaro.org>
* config/aarch64/aarch64.h (MCOUNT_NAME): Define.

View File

@ -1,3 +1,8 @@
2013-09-30 Richard Biener <rguenther@suse.de>
PR tree-optimization/58554
* gcc.dg/torture/pr58554.c: New testcase.
2013-09-30 Simon Cook <simon.cook@embecosm.com>
Joern Rennecke <joern.rennecke@embecosm.com>

View File

@ -0,0 +1,20 @@
/* { dg-do run } */
extern void abort (void);
void __attribute__((noinline,noclone))
clear_board(unsigned char *board, int board_size)
{
int k;
for (k = 0; k < 421; k++)
if (k < board_size )
board[k] = 3;
}
int main()
{
unsigned char board[421];
board[420] = 1;
clear_board (board, 420);
if (board[420] != 1)
abort ();
return 0;
}

View File

@ -1206,7 +1206,9 @@ classify_partition (loop_p loop, struct graph *rdg, partition_t partition)
&& !SSA_NAME_IS_DEFAULT_DEF (rhs)
&& flow_bb_inside_loop_p (loop, gimple_bb (SSA_NAME_DEF_STMT (rhs))))
return;
if (!adjacent_dr_p (single_store))
if (!adjacent_dr_p (single_store)
|| !dominated_by_p (CDI_DOMINATORS,
loop->latch, gimple_bb (stmt)))
return;
partition->kind = PKIND_MEMSET;
partition->main_dr = single_store;
@ -1222,7 +1224,9 @@ classify_partition (loop_p loop, struct graph *rdg, partition_t partition)
if (!adjacent_dr_p (single_store)
|| !adjacent_dr_p (single_load)
|| !operand_equal_p (DR_STEP (single_store),
DR_STEP (single_load), 0))
DR_STEP (single_load), 0)
|| !dominated_by_p (CDI_DOMINATORS,
loop->latch, gimple_bb (store)))
return;
/* Now check that if there is a dependence this dependence is
of a suitable form for memmove. */
@ -1719,6 +1723,7 @@ out:
{
if (!cd)
{
calculate_dominance_info (CDI_DOMINATORS);
calculate_dominance_info (CDI_POST_DOMINATORS);
cd = new control_dependences (create_edge_list ());
free_dominance_info (CDI_POST_DOMINATORS);