Commit fb039b24 by Maxim Kuvyrkov Committed by Maxim Kuvyrkov

re PR rtl-optimization/45107 (ICE: in insert_expr_in_table, at gcse.c:1213 with…

re PR rtl-optimization/45107 (ICE: in insert_expr_in_table, at gcse.c:1213 with -Os -gcse-las (another one))

	PR rtl-optimization/45107
	* gcse.c (hash_scan_set): Use max_distance for gcse-las.

	PR rtl-optimization/45107
	* gcc.dg/pr45107.c: New test.

From-SVN: r162645
parent 7a95d078
2010-07-28 Maxim Kuvyrkov <maxim@codesourcery.com>
PR rtl-optimization/45107
* gcse.c (hash_scan_set): Use max_distance for gcse-las.
2010-07-28 Richard Guenther <rguenther@suse.de> 2010-07-28 Richard Guenther <rguenther@suse.de>
* tree-ssa-ccp.c: Remove comment regarding STORE-CCP. * tree-ssa-ccp.c: Remove comment regarding STORE-CCP.
......
...@@ -1471,6 +1471,7 @@ hash_scan_set (rtx pat, rtx insn, struct hash_table_d *table) ...@@ -1471,6 +1471,7 @@ hash_scan_set (rtx pat, rtx insn, struct hash_table_d *table)
else if (flag_gcse_las && REG_P (src) && MEM_P (dest)) else if (flag_gcse_las && REG_P (src) && MEM_P (dest))
{ {
unsigned int regno = REGNO (src); unsigned int regno = REGNO (src);
int max_distance = 0;
/* Do not do this for constant/copy propagation. */ /* Do not do this for constant/copy propagation. */
if (! table->set_p if (! table->set_p
...@@ -1482,7 +1483,7 @@ hash_scan_set (rtx pat, rtx insn, struct hash_table_d *table) ...@@ -1482,7 +1483,7 @@ hash_scan_set (rtx pat, rtx insn, struct hash_table_d *table)
do that easily for EH edges so disable GCSE on these for now. */ do that easily for EH edges so disable GCSE on these for now. */
&& !can_throw_internal (insn) && !can_throw_internal (insn)
/* Is SET_DEST something we want to gcse? */ /* Is SET_DEST something we want to gcse? */
&& want_to_gcse_p (dest, NULL) && want_to_gcse_p (dest, &max_distance)
/* Don't CSE a nop. */ /* Don't CSE a nop. */
&& ! set_noop_p (pat) && ! set_noop_p (pat)
/* Don't GCSE if it has attached REG_EQUIV note. /* Don't GCSE if it has attached REG_EQUIV note.
...@@ -1504,7 +1505,7 @@ hash_scan_set (rtx pat, rtx insn, struct hash_table_d *table) ...@@ -1504,7 +1505,7 @@ hash_scan_set (rtx pat, rtx insn, struct hash_table_d *table)
/* Record the memory expression (DEST) in the hash table. */ /* Record the memory expression (DEST) in the hash table. */
insert_expr_in_table (dest, GET_MODE (dest), insn, insert_expr_in_table (dest, GET_MODE (dest), insn,
antic_p, avail_p, 0, table); antic_p, avail_p, max_distance, table);
} }
} }
} }
......
2010-07-28 Maxim Kuvyrkov <maxim@codesourcery.com> 2010-07-28 Maxim Kuvyrkov <maxim@codesourcery.com>
PR rtl-optimization/45107
* gcc.dg/pr45107.c: New test.
2010-07-28 Maxim Kuvyrkov <maxim@codesourcery.com>
PR rtl-optimization/45101 PR rtl-optimization/45101
* gcc.dg/pr45101.c: New test. * gcc.dg/pr45101.c: New test.
......
/* PR rtl-optimization/45107 */
/* { dg-do compile } */
/* { dg-options "-Os -fgcse-las" } */
extern void bar(int *);
int foo (int *p)
{
int i = *p;
if (i != 1)
bar(&i);
*p = i;
}
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