public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenther at suse dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/36013] [4.1/4.3/4.4 Regression] Wrong code involving restricted pointers to non-restricted pointers
Date: Wed, 07 May 2008 08:22:00 -0000	[thread overview]
Message-ID: <20080507082146.16812.qmail@sourceware.org> (raw)
In-Reply-To: <bug-36013-9404@http.gcc.gnu.org/bugzilla/>



------- Comment #11 from rguenther at suse dot de  2008-05-07 08:21 -------
Subject: Re:  [4.1/4.3/4.4 Regression] Wrong code
 involving restricted pointers to non-restricted pointers

On Tue, 6 May 2008, jakub at gcc dot gnu dot org wrote:

> ------- Comment #6 from jakub at gcc dot gnu dot org  2008-05-06 22:56 -------
> Created an attachment (id=15588)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15588&action=view)
>  --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15588&action=view)
> gcc44-pr36013.patch
> 
> Patch I've bootstrapped/regtested on x86_64-linux.  Will you check this in, or
> should I mail it to gcc-patches?
> 
> I've played with testcases like:
> 
> int
> foo (int *__restrict p, int *__restrict q)
> {
>   int *r, *s, t;
>   *p = 1;
>   *q = 2;
>   p[6] = 3;
>   q[6] = 4;
>   for (r = p, s = q, t = 0; r < p + 64; r++, s++)
>     {
>       *r = 7;
>       *s = 88;
>       t += *r;
>     }
>   return t;
> }
> 
> and here neither tree nor RTL aliasing is ATM able to optimize the subsequent
> read from *r out - while the accesses before the loop use different alias sets
> (3 resp. 4), in the loop everything uses alias set 2, but that isn't a
> regression introduced with this patch, so probably DECL_BASED_ON_RESTRICT_P
> stuff needs more work, but that is unrelated to this bug.

The patch/rfc I posted two days ago optimizes the above case on the tree
level.  I will make sure something like that goes into 4.4.

Richard.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36013


      parent reply	other threads:[~2008-05-07  8:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-22 15:54 [Bug middle-end/36013] New: " rainy6144 at gmail dot com
2008-04-22 22:18 ` [Bug middle-end/36013] [4.1/4.3 Regression] " rguenth at gcc dot gnu dot org
2008-04-25  9:21 ` [Bug middle-end/36013] [4.1/4.3/4.4 " jakub at gcc dot gnu dot org
2008-04-25 10:07 ` jakub at gcc dot gnu dot org
2008-04-25 11:37 ` jakub at gcc dot gnu dot org
2008-04-28  4:39 ` mmitchel at gcc dot gnu dot org
2008-05-06 14:23 ` ian at airs dot com
2008-05-06 22:56 ` jakub at gcc dot gnu dot org
2008-05-07  4:39 ` ian at airs dot com
2008-05-07  7:46 ` jakub at gcc dot gnu dot org
2008-05-07  8:02 ` jakub at gcc dot gnu dot org
2008-05-07  8:08 ` jakub at gcc dot gnu dot org
2008-05-07  8:22 ` rguenther at suse dot de [this message]

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=20080507082146.16812.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).