This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix part of pr25505
Daniel Berlin wrote:
>> + {
>> + FOR_EACH_SSA_DEF_OPERAND (def_p, stmt, op_iter,
>> SSA_OP_ALL_DEFS)
>> + {
>> + tree def = DEF_FROM_PTR (def_
>> + if (TREE_CODE (def) == SSA_NAME)
>> + def = SSA_NAME_VAR (def);
>> + if (is_call_clobbered (def))
>> + goto unsafe;
>> + }
>> }
>>
>
> 1. How can DEF be anything but an SSA_NAME? This iterator only
> iterates over the SSA_NAMES.
> 2. You really want if (MTAG_P (def) && is_call_clobbered (def)).
>
> It's not possible for an SSA variable to be clobbered, even if the
> underlying var on which it was originally based is.
> However, it is possible for the SSA memory tag to be clobbered.
> The above will incorrectly look at the underlying variable in the case
> of non-memory tags, and will come up with an answer of "clobbered"
> when it should come up with an answer of "not-clobbered".
This code was all there before -- I just added code above it to detect
and handle the "simple decl" case. It shows up in the diff because of
extra indentation.
- Josh