This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] convert MIN_EXPR operands to the same type (PR 87059)
- From: Jeff Law <law at redhat dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: Martin Sebor <msebor at gmail dot com>, Aldy Hernandez <aldyh at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 27 Aug 2018 09:27:36 -0600
- Subject: Re: [PATCH] convert MIN_EXPR operands to the same type (PR 87059)
- References: <firstname.lastname@example.org> <email@example.com> <CAFiYyc1ma4PJo-Jt8kYfDh3t0R2ve0XEcB9iD=bXLNveyo-X1w@mail.gmail.com>
On 08/27/2018 02:32 AM, Richard Biener wrote:
> On Sat, Aug 25, 2018 at 9:14 PM Jeff Law <firstname.lastname@example.org> wrote:
>> On 08/24/2018 01:06 PM, Martin Sebor wrote:
>>> PR 87059 points out an ICE in the recently enhanced VRP code
>>> that was traced back to a MIN_EXPR built out of operands of
>>> types with different sign by expand_builtin_strncmp().
>>> The attached patch adjusts the function to make sure both
>>> operands have the same type, and to make these mismatches
>>> easier to detect, also adds an assertion to fold_binary_loc()
>>> for these expressions.
>>> Bootstrapped on x86_64-linux.
>>> PS Aldy, I have not tested this on powerpc64le.
>>> PR tree-optimization/87059 - internal compiler error: in set_value_range
>>> PR tree-optimization/87059
>>> * builtins.c (expand_builtin_strncmp): Convert MIN_EXPR operand
>>> to the same type as the other.
>>> * fold-const.c (fold_binary_loc): Assert expectation.
>> I bootstrapped (but did not regression test) this on ppc64le and also
>> built the linux kernel (which is where my tester tripped over this problem).
>> Approved and installed on the trunk.
> Please remove the assertion in fold_binary_loc again, we do not do this kind
> of assertions there.
I almost called out the assertion. We generally verify this kind of
stuff in the verify_gimple routines and haphazard asserts in the folder
would be just that -- haphazard.
The value in Martin's assertion is to catch the goof earlier. But I
won't lose sleep if we drop the assert.