public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: kugan <kugan.vivekanandarajah@linaro.org>
To: Jakub Jelinek <jakub@redhat.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	Richard Biener <richard.guenther@gmail.com>
Subject: Re: [PR72835] Incorrect arithmetic optimization involving bitfield arguments
Date: Wed, 10 Aug 2016 01:46:00 -0000	[thread overview]
Message-ID: <c03695af-502d-e66e-3151-c0766e07aa38@linaro.org> (raw)
In-Reply-To: <0c53b0f3-4af6-387c-9350-95b1ae85850d@linaro.org>



On 10/08/16 08:51, kugan wrote:
> Hi Jakub,
>
> On 10/08/16 07:55, Jakub Jelinek wrote:
>> On Wed, Aug 10, 2016 at 07:51:08AM +1000, kugan wrote:
>>> On 10/08/16 07:46, Jakub Jelinek wrote:
>>>> On Wed, Aug 10, 2016 at 07:42:25AM +1000, kugan wrote:
>>>>> There was no new regression while testing. I also moved the testcase from
>>>>> gcc.dg/torture/pr72835.c to gcc.dg/tree-ssa/pr72835.c. Is this OK for trunk?
>>>>
>>>> This looks strange.  The tree-ssa-reassoc.c code has been trying to never
>>>> reuse SSA_NAMEs if they would hold a different value.
>>>> So there should be no resetting of flow sensitive info needed.
>>>
>>> We are not reusing but, if you see the example change in reassoc:
>>>
>>> -  _5 = -_4;
>>> -  _6 = _2 * _5;
>>> +  _5 = _4;
>>> +  _6 = _5 * _2;
>>>
>>> _5 and _6 will now have different value ranges because they compute
>>> different values. Therefore I think we should reset (?).
>>
>> No.  We should not have reused _5 and _6 for the different values.
>> It is not harmful just for the value ranges, but also for debug info.
>
> I see it now. The problem is we are just looking at (-1) being in the
> ops list for passing changed to rewrite_expr_tree in the case of
> multiplication by negate.  If we have combined (-1), as in the testcase,
> we will not have the (-1) and will pass changed=false to rewrite_expr_tree.
>
> We should set changed based on what happens in try_special_add_to_ops.
> Attached patch does this. Bootstrap and regression testing are ongoing.
> Is this OK for trunk if there is no regression.
>

This patch unfortunately does not handle all the cases. I am revising 
it. Sorry for the noise.

Thanks,
Kugan

  reply	other threads:[~2016-08-10  1:46 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-09 13:43 kugan
2016-08-09 21:43 ` kugan
2016-08-09 21:46   ` Jakub Jelinek
2016-08-09 21:51     ` kugan
2016-08-09 21:55       ` Jakub Jelinek
2016-08-09 22:51         ` kugan
2016-08-10  1:46           ` kugan [this message]
2016-08-10  8:57           ` Jakub Jelinek
2016-08-10  9:14             ` kugan
2016-08-10 10:28             ` Richard Biener
2016-08-10 23:09               ` kugan
2016-08-19  8:19                 ` Kugan Vivekanandarajah
2016-08-25 12:24                 ` Richard Biener
2016-09-02  8:09                   ` Kugan Vivekanandarajah
2016-09-14 11:38                     ` Richard Biener
2016-09-18 21:58                       ` kugan
2016-09-19 13:49                         ` Richard Biener
2016-09-20  3:27                           ` kugan
2016-09-20 12:01                             ` Richard Biener
2016-08-09 21:50   ` Andrew Pinski
2016-08-09 21:53     ` kugan
2016-09-14 14:31 ` Georg-Johann Lay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c03695af-502d-e66e-3151-c0766e07aa38@linaro.org \
    --to=kugan.vivekanandarajah@linaro.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=richard.guenther@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).