This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [c++-delayed-folding] fold_simple
- From: Kai Tietz <ktietz70 at googlemail dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 1 Sep 2015 17:27:51 +0200
- Subject: Re: [c++-delayed-folding] fold_simple
- Authentication-results: sourceware.org; auth=none
- References: <55DE7C84 dot 8080206 at redhat dot com> <CAEwic4ZCg=XYskoUNLKcWfSkN-vb66V6-VptDjSkEbQuap+k9w at mail dot gmail dot com> <55E13905 dot 9040607 at redhat dot com> <CAEwic4bbxFWjucsH1Rt5tQ-jzUz7kM_omsyHE12mRBAFngGWaw at mail dot gmail dot com> <55E49448 dot 1040803 at redhat dot com> <CAEwic4Zz0OnrFxuxCFeV2Qych_zwJBzCoOEXFQExfMJfjVQ2yA at mail dot gmail dot com> <55E4AB07 dot 4060405 at redhat dot com> <CAEwic4a6FEnCDcJN+RcK6gJCrKbJ5gVHo4HnO0OvpK=H1GMjuA at mail dot gmail dot com> <55E5BA8F dot 7000002 at redhat dot com>
2015-09-01 16:47 GMT+02:00 Jason Merrill <jason@redhat.com>:
> On 08/31/2015 03:43 PM, Kai Tietz wrote:
>>
>> 2015-08-31 21:29 GMT+02:00 Jason Merrill <jason@redhat.com>:
>>>
>>> On 08/31/2015 03:08 PM, Kai Tietz wrote:
>>>>
>>>>
>>>> I will need to verify that this patch doesn't introduce regressions.
>>>> The wacky thing here is the encapsulation of overflowed-arguments in
>>>> maybe_constant_value function by nop-expr.
>>>
>>>
>>>
>>> Do we need to worry about that? If one of the operands is overflowed, we
>>> don't care whether the result is overflowed.
>>
>>
>> Well, we would introduce, if we don't see in condition that operand
>> already overflowed, double overflow-warning, which seems to be
>> something we avoided until now. So I would say, it matters.
>
>
> I would rather handle this by checking whether the folded operands are
> constant before even building the folded result.
I rewrote binary/unary overflow-check logic so, that we avoid double
checking-s. I think this address things as you intend, beside the
checking for constant value. We would need to check for *_CST
tree-codes. Is there a macro we could use, which is just checking for
those?
> Jason
>
Kai