Commit fa385ff4 by Richard Biener Committed by Richard Biener

re PR c/86046 (ICE in execute_todo, at passes.c:2043)

2018-06-05  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/86046
	* tree-ssa.c (maybe_optimize_var): Clear DECL_GIMPLE_REG_P
	if required after clearing TREE_ADDRESSABLE.

	* gcc.dg/pr86046.c: New testcase.

From-SVN: r261193
parent d12fd774
2018-06-05 Richard Biener <rguenther@suse.de>
PR tree-optimization/86046
* tree-ssa.c (maybe_optimize_var): Clear DECL_GIMPLE_REG_P
if required after clearing TREE_ADDRESSABLE.
2018-06-05 Richard Biener <rguenther@suse.de>
PR tree-optimization/86047
* tree-ssa-loop.c (for_each_index): Glob handling of all
decls and constants and really handle all of them.
......
2018-06-05 Richard Biener <rguenther@suse.de>
PR tree-optimization/86046
* gcc.dg/pr86046.c: New testcase.
2018-06-05 Richard Biener <rguenther@suse.de>
PR tree-optimization/86047
* gcc.dg/pr86047.c: New testcase.
......
/* { dg-do compile } */
/* { dg-options "-O2" } */
typedef int V __attribute__ ((vector_size(4)));
void fn1 ()
{
(V){(1,0)}[1] = 0; // out-of-bound access
}
......@@ -1565,6 +1565,12 @@ maybe_optimize_var (tree var, bitmap addresses_taken, bitmap not_reg_needs,
|| !bitmap_bit_p (not_reg_needs, DECL_UID (var))))
{
TREE_ADDRESSABLE (var) = 0;
/* If we cleared TREE_ADDRESSABLE make sure DECL_GIMPLE_REG_P
is unset if we cannot rewrite the var into SSA. */
if ((TREE_CODE (TREE_TYPE (var)) == VECTOR_TYPE
|| TREE_CODE (TREE_TYPE (var)) == COMPLEX_TYPE)
&& bitmap_bit_p (not_reg_needs, DECL_UID (var)))
DECL_GIMPLE_REG_P (var) = 0;
if (is_gimple_reg (var))
bitmap_set_bit (suitable_for_renaming, DECL_UID (var));
if (dump_file)
......
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