public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Hendrik Greving <hendrik.greving.intel@gmail.com>
To: Oleg Endo <oleg.endo@t-online.de>
Cc: gcc@gcc.gnu.org
Subject: Re: Pointer arithmetic
Date: Wed, 07 Aug 2013 22:43:00 -0000	[thread overview]
Message-ID: <CANc4vhp=SHpDpyJ0XAKh7eursCdtV+JFz6d9eujYVPOnKBftPw@mail.gmail.com> (raw)
In-Reply-To: <1375908001.3952.100.camel@yam-132-YW-E178-FTW>

Yes I guess otherwise you could never produce a complex address like
that. Actually I think I remember that day that I found that C
explicitly leaves it undefined and to the machine.
Thanks
Hendrik

On Wed, Aug 7, 2013 at 1:40 PM, Oleg Endo <oleg.endo@t-online.de> wrote:
> On Tue, 2013-07-09 at 09:37 -0700, Hendrik Greving wrote:
>> On a machine with ABI ILP32LL64:
>>
>> (insn 123 122 124 (nil) (set (reg:SI 392)
>>         (mem:SI (plus:SI (reg/v:SI 386)
>>                 (reg/v:SI 349)) [0 sec 0 space 0, cmsmode 0 S4 A32])) -1 (nil)
>>     (nil))
>>
>> If we support legitimate memory addresses like [r1+r2] (e.g. indexed
>> addresses), can the above RTL match such a load?
>
> On 32 bit address machines it should match.
>
>> I am asking because
>> of overflows, I am not sure how that part is defined, and where the
>> Spec is. What do I need to check in the backend for such a definition?
>> Is this POINTER_SIZE? E.g. what if the machine supports > 32 bits, who
>> is responsible to make sure that there is no overflow > 32 bits in
>> this case? Compiler? Assembler? Or even the user?
>
> AFAIK overflow is undefined and thus anything can happen.  Induction
> variable and loop optimizations may produce interesting things if
> addresses overflow.  For example, see
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55190
>
> Cheers,
> Oleg
>

      reply	other threads:[~2013-08-07 22:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-09 16:37 Hendrik Greving
2013-08-07 20:40 ` Oleg Endo
2013-08-07 22:43   ` Hendrik Greving [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='CANc4vhp=SHpDpyJ0XAKh7eursCdtV+JFz6d9eujYVPOnKBftPw@mail.gmail.com' \
    --to=hendrik.greving.intel@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=oleg.endo@t-online.de \
    /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).