PR 41952 -- simple folding rule

Xinliang David Li davidxl@google.com
Tue Apr 20 05:20:00 GMT 2010


How about the attached patch?

Rebuild and tested on x86-64/linux

Thanks,

David

On Wed, Apr 14, 2010 at 2:17 AM, Richard Guenther
<richard.guenther@gmail.com> wrote:
> On Wed, Apr 14, 2010 at 12:17 AM, Xinliang David Li <davidxl@google.com> wrote:
>> Retested on x86_64/linux using trunk.
>>
>> Ok for mainline?
>
> Please move this into the
>
>  /* For comparisons of pointers we can decompose it to a compile time
>     comparison of the base objects and the offsets into the object.
>     This requires at least one operand being an ADDR_EXPR or a
>     POINTER_PLUS_EXPR to do more than the operand_equal_p test below.  */
>  if (POINTER_TYPE_P (TREE_TYPE (arg0))
>      && (TREE_CODE (arg0) == ADDR_EXPR
>          || TREE_CODE (arg1) == ADDR_EXPR
>          || TREE_CODE (arg0) == POINTER_PLUS_EXPR
>          || TREE_CODE (arg1) == POINTER_PLUS_EXPR))
>
> handling to also get &local_var.a.b != parameter_default [ + x].
>
> and re-post.
>
> Thanks,
> Richard.
>
>> David
>>
>> On Fri, Nov 6, 2009 at 11:58 AM, Xinliang David Li <davidxl@google.com> wrote:
>>> Hi, the patch is to used to delete redundant comparisons and branches
>>> resulting from inlining. While it does not address any particular bug
>>> in 4.5, it is safe to be considered.
>>>
>>> Tested: bootstrap and regression tested: x86_64/linux (with 4.5).
>>>
>>> Ok to get in?
>>>
>>> Thanks,
>>>
>>> David
>>>
>>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fold2.p
Type: text/x-pascal
Size: 2491 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100420/c31b8959/attachment.bin>


More information about the Gcc-patches mailing list