Commit 4d20d00a by Richard Biener Committed by Richard Biener

re PR middle-end/67285 (ICE with (rdiv (POW:s @0 REAL_CST@1) @0))

2015-08-21  Richard Biener  <rguenther@suse.de>

	PR middle-end/67285
	* gimple-fold.c (replace_stmt_with_simplification): Assert
	seq is empty when replacing a call with itself but different
	arguments.
	* gimple-match-head.c (maybe_push_res_to_seq): When pushing
	a call require that it is const.

From-SVN: r227053
parent 6b00e42d
2015-08-21 Richard Biener <rguenther@suse.de>
PR middle-end/67285
* gimple-fold.c (replace_stmt_with_simplification): Assert
seq is empty when replacing a call with itself but different
arguments.
* gimple-match-head.c (maybe_push_res_to_seq): When pushing
a call require that it is const.
2015-08-20 Trevor Saunders <tbsaunde+gcc@tbsaunde.org> 2015-08-20 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* defaults.h (CONSTANT_ALIGNMENT): New macro definition. * defaults.h (CONSTANT_ALIGNMENT): New macro definition.
......
...@@ -3308,6 +3308,7 @@ replace_stmt_with_simplification (gimple_stmt_iterator *gsi, ...@@ -3308,6 +3308,7 @@ replace_stmt_with_simplification (gimple_stmt_iterator *gsi,
} }
if (i < 3) if (i < 3)
gcc_assert (ops[i] == NULL_TREE); gcc_assert (ops[i] == NULL_TREE);
gcc_assert (gimple_seq_empty_p (*seq));
return true; return true;
} }
else if (!inplace) else if (!inplace)
......
...@@ -338,6 +338,9 @@ maybe_push_res_to_seq (code_helper rcode, tree type, tree *ops, ...@@ -338,6 +338,9 @@ maybe_push_res_to_seq (code_helper rcode, tree type, tree *ops,
tree decl = builtin_decl_implicit (rcode); tree decl = builtin_decl_implicit (rcode);
if (!decl) if (!decl)
return NULL_TREE; return NULL_TREE;
/* We can't and should not emit calls to non-const functions. */
if (!(flags_from_decl_or_type (decl) & ECF_CONST))
return NULL_TREE;
/* Play safe and do not allow abnormals to be mentioned in /* Play safe and do not allow abnormals to be mentioned in
newly created statements. */ newly created statements. */
unsigned nargs; unsigned nargs;
......
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