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/51994] [4.6/4.7 Regression] git-1.7.8.3 miscompiled due to negative bitpos from get_inner_reference
Date: Wed, 25 Jan 2012 13:06:00 -0000	[thread overview]
Message-ID: <bug-51994-4-SDgjSGre3w@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-51994-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-01-25 12:42:14 UTC ---
(In reply to comment #2)
> > Negative bitpos is fine - Ada uses that quite extensively and with MEM_REFs
> > this just got more prominent.  get_inner_reference is declared to return
> > a _signed_ HOST_WIDE_INT bitpos for a reason.
> 
> Extensively is a bit of an overstatement, but Ada does use negative offsets.
> The recent story about them in build_ref_for_model shows that they can be
> problematic though.
> 
> > What should happen instead is that store_field needs to adjust the address
> > to properly point before the bitfield for calling store_bit_field.  Or the
> > latter needs to take signed arguments for bitpos and do the adjustment
> > itself.
> > 
> > Does simply changing the store_bit_field[_1] prototype work for you?
> 
> It might also be interesting to find out why we have a negative bitpos here.

It's as easy as doing

int foo(int *p)
{
  return p[-1];
}

these days.


  parent reply	other threads:[~2012-01-25 12:42 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-25 10:30 [Bug tree-optimization/51994] New: " ubizjak at gmail dot com
2012-01-25 10:30 ` [Bug tree-optimization/51994] " ubizjak at gmail dot com
2012-01-25 11:10 ` [Bug middle-end/51994] " rguenth at gcc dot gnu.org
2012-01-25 11:22 ` ebotcazou at gcc dot gnu.org
2012-01-25 11:57 ` ubizjak at gmail dot com
2012-01-25 12:02 ` ubizjak at gmail dot com
2012-01-25 13:00 ` rguenth at gcc dot gnu.org
2012-01-25 13:06 ` rguenth at gcc dot gnu.org [this message]
2012-01-25 13:30 ` ubizjak at gmail dot com
2012-01-25 14:10 ` ubizjak at gmail dot com
2012-01-25 14:44 ` ubizjak at gmail dot com
2012-01-25 15:00 ` ubizjak at gmail dot com
2012-01-25 15:14 ` jakub at gcc dot gnu.org
2012-01-25 19:07 ` ubizjak at gmail dot com
2012-01-25 19:21 ` ubizjak at gmail dot com
2012-01-25 20:25 ` ubizjak at gmail dot com
2012-01-25 20:29 ` jakub at gcc dot gnu.org
2012-01-26  9:31 ` ubizjak at gmail dot com
2012-01-26  9:32 ` jakub at gcc dot gnu.org
2012-01-26  9:36 ` ubizjak at gmail dot com
2012-01-26 10:29 ` rguenth at gcc dot gnu.org
2012-01-26 12:36 ` ebotcazou at gcc dot gnu.org
2012-01-26 19:43 ` ubizjak at gmail dot com
2012-01-26 20:40 ` ubizjak at gmail dot com
2012-01-26 21:02 ` ubizjak at gmail dot com
2012-01-26 22:28 ` ebotcazou at gcc dot gnu.org
2012-02-01 15:34 ` ebotcazou at gcc dot gnu.org
2012-02-01 15:36 ` ebotcazou at gcc dot gnu.org
2012-02-01 15:46 ` rguenth at gcc dot gnu.org
2012-02-01 15:47 ` rguenth at gcc dot gnu.org
2012-02-01 15:51 ` ebotcazou at gcc dot gnu.org
2012-02-01 15:54 ` ebotcazou at gcc dot gnu.org
2012-02-01 16:02 ` rguenther at suse dot de
2012-02-01 16:36 ` ebotcazou at gcc dot gnu.org
2012-02-01 18:42 ` ubizjak at gmail dot com
2012-02-02  8:57 ` rguenther at suse dot de
2012-02-06 12:29 ` ebotcazou at gcc dot gnu.org
2012-02-07 15:43 ` rguenth at gcc dot gnu.org
2012-02-07 17:22 ` ebotcazou at gcc dot gnu.org
2012-02-07 17:25 ` ebotcazou at gcc dot gnu.org
2012-02-07 17:28 ` ebotcazou 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-51994-4-SDgjSGre3w@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).