This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR53501
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: Richard Guenther <rguenther at suse dot de>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 31 Oct 2012 03:23:20 -0700
- Subject: Re: [PATCH] Fix PR53501
- References: <Pine.LNX.4.64.1205301241021.5860@jbgna.fhfr.qr> <201206011151.42899.ebotcazou@adacore.com> <Pine.LNX.4.64.1206011159340.5860@jbgna.fhfr.qr> <201206011229.16273.ebotcazou@adacore.com>
On Fri, Jun 1, 2012 at 3:29 AM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> Well, it would rather be
>>
>> TYPE_UNSIGNED (type) == TYPE_UNSIGNED (TREE_TYPE (arg0))
>> && TYPE_UNSIGNED (type) == TYPE_UNSIGNED (TREE_TYPE (arg1))
>>
>> but only in the !FLOAT_TYPE_P path.
>
> That works in all cases I think, see existing cases in the folder.
>
>> We could even compare
>> TYPE_OVERFLOW_UNDEFINED I think. Or even just make sure
>> that when TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (arg0)) also
>> TYPE_OVERFLOW_UNDEFINED (type), thus
>>
>> !TYPE_OVERFLOW_UNDEFINED (type)
>>
>> || ((TREE_CODE (arg0) != MULT_EXPR
>> ||
>> || TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (arg0)))
>>
>> && (TREE_CODE (arg1) != MULT_EXPR
>>
>> || TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (arg1))))
>>
>> That is, the newly created multiplication in type TYPE should
>> either not have undefined overflow or the inner multiplications
>> all should already have. Best done with a comment in
>> fold_plusminus_mult_expr.
>
> I'm a little lost here. :-) I don't really care about the mainline at this
> point, but the fix on the branches should be the minimal working one.
>
Your change caused:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55142
--
H.J.