On Tue, Jul 10, 2012 at 1:57 PM, Xinliang David Li <davi...@google.com> wrote:
> Is this related to the problem described in
> http://gcc.gnu.org/ml/gcc-patches/2012-04/msg01511.html ?

This does not sounds related to me. This patch only fix the block info
for phi_arg_t.

The following patch is related to function split, but only for debug info.

http://gcc.gnu.org/ml/gcc-patches/2012-06/msg01579.html

Thanks,
Dehao

>
> David
>
> On Mon, Jun 25, 2012 at 4:43 AM, Dehao Chen <de...@google.com> wrote:
>> During function inlining, a lexical block is added for each cloned
>> callee, and source info is attached to this block for addr2line to
>> derive the inline stack. However, some callsites do not have source
>> information attached to it. Adding a lexical block would be misleading
>> in this case. E.g. If a function is split, when the split callsite is
>> inlined back, the cloned callee should stay in the same lexical block
>> with its caller. This patch ensures that lexical blocks are only added
>> when the callsite has source location info in it.
>>
>> Bootstrapped and passed gcc regression tests.
>>
>> Is it ok for trunk?
>>
>> Thanks,
>> Dehao
>>
>> gcc/ChangeLog:
>> 2012-06-25  Dehao Chen  <de...@google.com>
>>
>>         * tree-profile.c: (expand_call_inline): Make a new lexical block only
>>         when the call stmt has source location.
>>
>> Index: gcc/tree-inline.c
>> ===================================================================
>> --- gcc/tree-inline.c   (revision 188926)
>> +++ gcc/tree-inline.c   (working copy)
>> @@ -3950,10 +3950,17 @@
>>       actual inline expansion of the body, and a label for the return
>>       statements within the function to jump to.  The type of the
>>       statement expression is the return type of the function call.  */
>> -  id->block = make_node (BLOCK);
>> -  BLOCK_ABSTRACT_ORIGIN (id->block) = fn;
>> -  BLOCK_SOURCE_LOCATION (id->block) = input_location;
>> -  prepend_lexical_block (gimple_block (stmt), id->block);
>> +  if (gimple_has_location (stmt))
>> +    {
>> +      id->block = make_node (BLOCK);
>> +      BLOCK_ABSTRACT_ORIGIN (id->block) = fn;
>> +      BLOCK_SOURCE_LOCATION (id->block) = input_location;
>> +      prepend_lexical_block (gimple_block (stmt), id->block);
>> +    }
>> +  else
>> +    {
>> +      id->block = gimple_block (stmt);
>> +    }
>>
>>    /* Local declarations will be replaced by their equivalents in this
>>       map.  */

Reply via email to