This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Let tree_single_nonzero_warnv_p use VRP


On April 24, 2017 2:49:04 PM GMT+02:00, Marc Glisse <marc.glisse@inria.fr> wrote:
>On Mon, 24 Apr 2017, Jakub Jelinek wrote:
>
>> On Mon, Apr 24, 2017 at 09:41:01AM +0200, Richard Biener wrote:
>>> On Sun, Apr 23, 2017 at 11:38 PM, Marc Glisse <marc.glisse@inria.fr>
>wrote:
>>>> Hello,
>>>>
>>>> this patches teaches tree_expr_nonzero_warnv_p to handle SSA_NAME
>using
>>>> range information and known (non-)zero bits, by delegating to
>>>> expr_not_equal_to which already knows how to handle all that.
>>>>
>>>> This makes one strict overflow warning disappear. It isn't
>particularly
>>>> surprising, since the new code makes tree_expr_nonzero_warnv_p
>return true
>>>> without warning (we do not remember if the range information was
>obtained
>>>> using strict overflow). In my opinion, improving code generation is
>more
>>>> important than this specific warning.
>>>>
>>>> Bootstrap+regtest on powerpc64le-unknown-linux-gnu.
>>>
>>> Hmm, I think you need to guard this with a INTEGRAL_TYPE_P check
>>> given the comment on tree_single_nonzero_warnv_p also talks about
>>> FP.
>
>The SSA_NAME case in expr_not_equal_to starts with
>
>       if (!INTEGRAL_TYPE_P (TREE_TYPE (t)))
>         return false;
>
>Do you still want the extra check in tree_single_nonzero_warnv_p before
>
>calling expr_not_equal_to?

Yes because you create a wide int with TYPE_PRECISION.

Richard.

>> I vaguely remember there were issues with that, because VRP uses
>> the *_nonzero_warnv* functions to compute the ranges and now those
>> functions would use range info.  But it has been some time ago and
>maybe this
>> patch is different enough from what I've been trying back then.
>
>I hope it is safe, but we'll see.
>
>> So just please watch carefully for any fallout.
>
>Ok.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]