Patchwork Cleanup last_location and update input_location in ipa_prop

login
register
mail settings
Submitter Dehao Chen
Date Nov. 26, 2012, 5:27 p.m.
Message ID <CAO2gOZVpKoZ3vZPAffWGBU4-d82TDLFLVMEaqgRY6hkDCUkqyg@mail.gmail.com>
Download mbox | patch
Permalink /patch/201997/
State New
Headers show

Comments

Dehao Chen - Nov. 26, 2012, 5:27 p.m.
On Mon, Nov 26, 2012 at 8:10 AM, Richard Biener
<richard.guenther@gmail.com> wrote:
> On Mon, Nov 26, 2012 at 4:54 PM, Dehao Chen <dehao@google.com> wrote:
>> On Mon, Nov 26, 2012 at 7:28 AM, Richard Biener
>> <richard.guenther@gmail.com> wrote:
>>> On Thu, Nov 8, 2012 at 6:39 PM, Dehao Chen <dehao@google.com> wrote:
>>>> ping...
>>>
>>> The emit-rtl.c hunk is ok.  I'm questioning the ipa-prop.c hunk though - what
>>> looks at input_location (nothing outside of the frontend should, really).
>>
>> ipa_modify_call_arguments invokes force_gimple_operand_gsi, which uses
>> frontend routines to gimplify expr and uses input_location.
>
> Can you be more specific?  That's the place that needs fixing - there are a lot
> more force_gimple_operand callers.

You are right, the patch is updated as follows:


Thanks,
Dehao

>
> Richard.
>
>> Thanks,
>> Dehao
>>
>>>
>>> Thanks,
>>> Richard.
>>>
>>>>
>>>> On Mon, Nov 5, 2012 at 5:20 PM, Dehao Chen <dehao@google.com> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> This is a patch to do some obvious cleanup and setting correct
>>>>> input_location in ipa_prop (because it invokes gimplification
>>>>> routines).
>>>>>
>>>>> Bootstrapped and passed gcc regression tests.
>>>>>
>>>>> Is it okay for trunk?
>>>>>
>>>>> Thanks,
>>>>> Dehao
>>>>>
>>>>> gcc/ChangeLog:
>>>>> 2010-11-05  Dehao Chen  <dehao@google.com>
>>>>>
>>>>>         * ipa-prop.c (ipa_modify_call_arguments): Set input_location so that
>>>>>         gimplification routines can have right location.
>>>>>         * emit-rtl.c (last_location): Remove unused variable.

Patch

Index: gcc/ipa-prop.c
===================================================================
--- gcc/ipa-prop.c (revision 193203)
+++ gcc/ipa-prop.c (working copy)
@@ -2870,7 +2870,8 @@  ipa_modify_call_arguments (struct cgraph_edge *cs,

   gcc_checking_assert (adj->offset % BITS_PER_UNIT == 0);
   base = gimple_call_arg (stmt, adj->base_index);
-  loc = EXPR_LOCATION (base);
+  loc = DECL_P (base) ? DECL_SOURCE_LOCATION (base) :
+ EXPR_LOCATION (base);

   if (TREE_CODE (base) != ADDR_EXPR
       && POINTER_TYPE_P (TREE_TYPE (base)))