On Wed, Dec 28, 2011 at 8:04 PM, Jakub Jelinek ja...@redhat.com wrote:
Hi!
For some calls (like memcpy and other builtins that are known to pass
through the first argument) we know the value of the lhs, but still
we shouldn't be replacing the call with just a mere assignment of that
known
Hi!
For some calls (like memcpy and other builtins that are known to pass
through the first argument) we know the value of the lhs, but still
we shouldn't be replacing the call with just a mere assignment of that
known value to the LHS SSA_NAME, because the call has other side-effects.
Fixed
- Original Message -
else if (is_gimple_call (def_stmt))
{
+ int flags = gimple_call_flags (def_stmt);
+
+ /* Don't optimize away calls that have side-effects. */
+ if ((flags (ECF_CONST|ECF_PURE)) == 0
+ || (flags ECF_LOOPING_CONST_OR_PURE))
This patch does this computation
On Wed, Dec 28, 2011 at 11:53:41AM -0800, Nathan Froyd wrote:
- Original Message -
else if (is_gimple_call (def_stmt))
{
+ int flags = gimple_call_flags (def_stmt);
+
+ /* Don't optimize away calls that have side-effects. */
+ if ((flags (ECF_CONST|ECF_PURE)) == 0
+ ||