Commit 6ca5a442 by Richard Sandiford Committed by Richard Sandiford

Handle internal functions in is_tm_pure_call

The upcoming changes to use internal functions for things like sqrt
caused a failure in gcc.dg/tm/20100610.c, because we were trying to get
call flags from the null gimple_call_fn of an IFN_SQRT call.  We've been
making fairly heavy use of internal functions for a while now so I think
this might be latent.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
	* trans-mem.c (is_tm_pure_call): Use gimple_call_flags for
	internal functions.

From-SVN: r229925
parent 0aad0198
2015-11-07 Richard Sandiford <richard.sandiford@arm.com> 2015-11-07 Richard Sandiford <richard.sandiford@arm.com>
* trans-mem.c (is_tm_pure_call): Use gimple_call_flags for
internal functions.
2015-11-07 Richard Sandiford <richard.sandiford@arm.com>
* builtins.def: #undef DEF_BUILTIN and DEF_BUILTIN_CHKP * builtins.def: #undef DEF_BUILTIN and DEF_BUILTIN_CHKP
* builtins.c, genmatch.c, tree-core.h: Don't undef them here. * builtins.c, genmatch.c, tree-core.h: Don't undef them here.
...@@ -266,6 +266,9 @@ is_tm_safe (const_tree x) ...@@ -266,6 +266,9 @@ is_tm_safe (const_tree x)
static bool static bool
is_tm_pure_call (gimple *call) is_tm_pure_call (gimple *call)
{ {
if (gimple_call_internal_p (call))
return (gimple_call_flags (call) & (ECF_CONST | ECF_TM_PURE)) != 0;
tree fn = gimple_call_fn (call); tree fn = gimple_call_fn (call);
if (TREE_CODE (fn) == ADDR_EXPR) if (TREE_CODE (fn) == ADDR_EXPR)
......
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