This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: (patch,rfc) s/gimple/gimple */
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>, Trevor Saunders <tbsaunde at tbsaunde dot org>, David Malcolm <dmalcolm at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Richard Sandiford <rdsandiford at googlemail dot com>
- Date: Tue, 22 Sep 2015 13:25:09 +0200
- Subject: Re: (patch,rfc) s/gimple/gimple */
- Authentication-results: sourceware.org; auth=none
- References: <20150916131510 dot GA21102 at tsaunders-iceball dot corp dot tor1 dot mozilla dot com> <1442430674 dot 32352 dot 109 dot camel at surprise> <20150918133200 dot GA22271 at tsaunders-iceball dot corp dot tor1 dot mozilla dot com> <CAFiYyc1PVOaB9bBYrxa2Ekq3hfpMzimDujUG4brivFAAxuWegw at mail dot gmail dot com> <877fnj6017 dot fsf at googlemail dot com> <CAFiYyc2vYR=BJcF1Oc2m7pB2PL5N7G6k1Q0nOwrnFB5GF-i4vg at mail dot gmail dot com>
On Tue, Sep 22, 2015 at 1:16 PM, Richard Biener
<richard.guenther@gmail.com> wrote:
> On Mon, Sep 21, 2015 at 9:32 PM, Richard Sandiford
> <rdsandiford@googlemail.com> wrote:
>> Richard Biener <richard.guenther@gmail.com> writes:
>>> On Fri, Sep 18, 2015 at 3:32 PM, Trevor Saunders <tbsaunde@tbsaunde.org> wrote:
>>>> On Wed, Sep 16, 2015 at 03:11:14PM -0400, David Malcolm wrote:
>>>>> On Wed, 2015-09-16 at 09:16 -0400, Trevor Saunders wrote:
>>>>> > Hi,
>>>>> >
>>>>> > I gave changing from gimple to gimple * a shot last week. It turned out
>>>>> > to be not too hard. As you might expect the patch is huge so its
>>>>> > attached compressed.
>>>>> >
>>>>> > patch was bootstrapped + regtested on x86_64-linux-gnu, and run through
>>>>> > config-list.mk. However I needed to update it some for changes made
>>>>> > while testing. Do people want to make this change now? If so I'll try
>>>>> > and commit the patch over the weekend when less is changing.
>>>>>
>>>>>
>>>>> FWIW there are some big changes in gcc/tree-vect-slp.c:vectorizable_load
>>>>> that looks like unrelated whitespace changes, e.g. the following (and
>>>>> there are some followup hunks). Did something change underneath, or was
>>>>> there a stray whitespace cleanup here? (I skimmed through the patch,
>>>>> and this was the only file I spotted where something looked wrong)
>>>>
>>>> yeah, it was a stray whitespace cleanup, but I reverted it.
>>>>
>>>> Given the few but only positive comments I've seen I'm planning to
>>>> commit this over the weekend.
>>>
>>> Thanks a lot!
>>>
>>> If you are still in a refactoring mood then I have sth else here. When
>>> streamlining the gimple accessors I noticed the glaring const-correctness
>>> issue in
>>>
>>> /* Return a pointer to the LHS of assignment statement GS. */
>>>
>>> static inline tree *
>>> gimple_assign_lhs_ptr (const gassign *gs)
>>> {
>>> return const_cast<tree *> (&gs->op[0]);
>>> }
>>>
>>> and was thinking to either "fix" it by removing the 'const' or by
>>> merging gimple_assign_lhs and gimple_assign_lhs_ptr into
>>>
>>> static inline const tree&
>>> gimple_assign_lhs (const gassign *);
>>>
>>> static inline tree&
>>> gimple_assign_lhs (gassign *);
>>
>> AIUI const_tree (like const_rtx) only protects the top-level tree.
>> This is something I always hoped to change for rtl one day, but fixing
>> all the fallout would be an incredibly dull task...
>>
>> I suppose protecting the top level is still better than nothing though.
>
> Note these functions return pointers to parts of that "top level" so they
> break const correctness. Not sure why they were made to take a
> const_gimple in the first place.
So for const gimple * they should return a const tree * which AFAIK
only protects the pointer, not the contents of the tree (as opposed to
const_tree *). Still AFAIK it's used to modify the pointer in some places.
Richard.
> Richard.
>
>> Thanks,
>> Richard
>>