public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/48377] [4.6/4.7 regression] miscompilation at -O3
Date: Thu, 07 Apr 2011 13:35:00 -0000	[thread overview]
Message-ID: <bug-48377-4-uUfX7FqWit@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-48377-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #31 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-04-07 13:35:04 UTC ---
(In reply to comment #30)
> This is certainly a valid testcase:
> 
> struct S { long long x; int a; double b[10000]; int c; } s;
> double *p = &s.b[0];
> int
> foo (double *q)
> {
>   int i, j = 0;
>   for (i = 0; i < 10000; i++)
>     j += *q++;
>   return j;
> }
> int
> main (void)
> {
>   return foo (p);
> }
> 
> and without the target hook, vectorizer would think it can peel the loop and
> get it naturally aligned (assuming it isn't inlined at least etc. to see that q
> points to &s.b[0] initially).
> 
> I think the bug is in the ABIs that do that kind of thing, but it is too late
> to fix the ABIs up.

The question is what we should do in the middle-end.  If the above would
happen for strict-alignment targets then *p would simply trap.  The
only consistent way for the middle-end would be to simply assume all
pointer-to-doubles are only aligned to 4 bytes, thus use the minimal
alignment that can happen (without using GCC extensions).


  parent reply	other threads:[~2011-04-07 13:35 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-30 23:31 [Bug middle-end/48377] New: [4.6 " matt at use dot net
2011-03-31 10:01 ` [Bug middle-end/48377] " rguenth at gcc dot gnu.org
2011-03-31 10:02 ` jakub at gcc dot gnu.org
2011-04-01  1:38 ` matt at use dot net
2011-04-01  1:40 ` matt at use dot net
2011-04-01  9:51 ` jakub at gcc dot gnu.org
2011-04-05  3:53 ` matt at use dot net
2011-04-05 20:39 ` matt at use dot net
2011-04-05 20:39 ` matt at use dot net
2011-04-06  5:25 ` d.g.gorbachev at gmail dot com
2011-04-06  7:03 ` jakub at gcc dot gnu.org
2011-04-06 22:22 ` matt at use dot net
2011-04-06 23:30 ` d.g.gorbachev at gmail dot com
2011-04-07  7:44 ` [Bug middle-end/48377] [4.6/4.7 " jakub at gcc dot gnu.org
2011-04-07  8:00 ` irar at il dot ibm.com
2011-04-07  8:20 ` jakub at gcc dot gnu.org
2011-04-07  9:00 ` irar at il dot ibm.com
2011-04-07  9:34 ` jakub at gcc dot gnu.org
2011-04-07  9:35 ` rguenth at gcc dot gnu.org
2011-04-07  9:39 ` rguenth at gcc dot gnu.org
2011-04-07  9:56 ` irar at il dot ibm.com
2011-04-07 10:24 ` rguenther at suse dot de
2011-04-07 11:37 ` irar at il dot ibm.com
2011-04-07 11:46 ` jakub at gcc dot gnu.org
2011-04-07 12:02 ` irar at il dot ibm.com
2011-04-07 12:43 ` rguenth at gcc dot gnu.org
2011-04-07 12:45 ` rguenth at gcc dot gnu.org
2011-04-07 12:48 ` jakub at gcc dot gnu.org
2011-04-07 12:56 ` rguenth at gcc dot gnu.org
2011-04-07 13:16 ` jakub at gcc dot gnu.org
2011-04-07 13:21 ` rguenther at suse dot de
2011-04-07 13:29 ` jakub at gcc dot gnu.org
2011-04-07 13:35 ` rguenth at gcc dot gnu.org [this message]
2011-04-07 13:44 ` jakub at gcc dot gnu.org
2011-04-07 13:57 ` rguenther at suse dot de
2011-04-07 16:36 ` jakub at gcc dot gnu.org
2011-04-08  8:31 ` rguenther at suse dot de
2011-04-08 11:38 ` [Bug tree-optimization/48377] " jakub at gcc dot gnu.org
2011-04-08 11:45 ` jakub at gcc dot gnu.org
2011-04-08 11:52 ` jakub at gcc dot gnu.org
2011-06-03 10:01 ` ebotcazou at gcc dot gnu.org
2011-06-03 10:07 ` jakub at gcc dot gnu.org
2011-06-03 10:43 ` ebotcazou at gcc dot gnu.org
2011-06-03 10:56 ` jakub at gcc dot gnu.org
2011-06-03 11:11 ` ebotcazou at gcc dot gnu.org
2011-06-03 11:25 ` jakub at gcc dot gnu.org
2011-06-03 12:57 ` rguenth at gcc dot gnu.org
2011-06-26  8:02 ` jakub at gcc dot gnu.org
2011-06-27 17:56 ` jakub at gcc dot gnu.org

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=bug-48377-4-uUfX7FqWit@http.gcc.gnu.org/bugzilla/ \
    --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).