This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR79697: Delete calls to strdup, strndup, realloc if there is no lhs
- From: Prathamesh Kulkarni <prathamesh dot kulkarni at linaro dot org>
- To: Jeff Law <law at redhat dot com>
- Cc: gcc Patches <gcc-patches at gcc dot gnu dot org>, Richard Biener <rguenther at suse dot de>
- Date: Sat, 29 Apr 2017 19:03:26 +0530
- Subject: Re: PR79697: Delete calls to strdup, strndup, realloc if there is no lhs
- Authentication-results: sourceware.org; auth=none
- References: <CAAgBjM==xR+5sHG5appwJdwJBFzNcBN76HF4idWnOm8t8u8gRA@mail.gmail.com> <97d19817-3f8c-27be-08a8-1bb23ffdba49@redhat.com> <CAAgBjMn2Sah6nVZeC+=XntbZ_XdFQn2QEn0kDfvkn4adJCyhVQ@mail.gmail.com> <3662847e-1f65-2a75-1860-427bbe36bf48@redhat.com>
On 29 April 2017 at 01:37, Jeff Law <law@redhat.com> wrote:
> On 04/25/2017 12:06 AM, Prathamesh Kulkarni wrote:
>>
>> On 25 April 2017 at 02:41, Jeff Law <law@redhat.com> wrote:
>>>
>>> On 02/25/2017 01:40 AM, Prathamesh Kulkarni wrote:
>>>>
>>>>
>>>> Hi,
>>>> The attached patch deletes calls to strdup, strndup if it's
>>>> return-value is unused,
>>>> and same for realloc if the first arg is NULL.
>>>> Bootstrap+tested on x86_64-unknown-linux-gnu.
>>>> OK for GCC 8 ?
>>>>
>>>> Thanks,
>>>> Prathamesh
>>>>
>>>>
>>>> pr79697-1.txt
>>>>
>>>>
>>>> 2017-02-25 Prathamesh Kulkarni<prathamesh.kulkarni@linaro.org>
>>>>
>>>> PR tree-optimization/79697
>>>> * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Check if
>>>> callee
>>>> is BUILT_IN_STRDUP, BUILT_IN_STRNDUP, BUILT_IN_REALLOC.
>>>>
>>>> testsuite/
>>>> * gcc.dg/tree-ssa/pr79697.c: New test.
>>>
>>>
>>> OK for the trunk.
>>
>> Hi Jeff,
>> Did you intend to approve the original patch (pr79697-1.txt) or the
>> latest one (pr79697-3.txt that also folds realloc (0, n) to malloc
>> (n)) ?
>
> I was referring to the 3rd iteration. Sorry to have replied to the first
> patch in the series -- my patches queue is a bit of a mess as we're just
> getting started on gcc-8 stuff.
Committed as r247407, thanks!
>
>
> jeff
>