public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <iant@google.com>
To: Aurelien Buhrig <aurelien.buhrig.gcc@gmail.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: Forcing memory mode to some addresses
Date: Wed, 16 Nov 2011 18:29:00 -0000	[thread overview]
Message-ID: <mcrzkfww1bz.fsf@dhcp-172-18-216-180.mtv.corp.google.com> (raw)
In-Reply-To: <CAJ-J9_XzXQZjp4RyHZpOoEAXyooRfOfytR1JmJO8bZc=Q4a8Zg@mail.gmail.com>	(Aurelien Buhrig's message of "Wed, 16 Nov 2011 12:10:30 +0100")

Aurelien Buhrig <aurelien.buhrig.gcc@gmail.com> writes:

> I would like to force accesses to some memory variables in a specific mode.
> For example, I would like GCC to access a 16-bit wide hardware
> register always in HImode when using a 16bit wide bitfield struct...
> Currently, GCC can accesses part of this memory structure using
> QImode, which is not always permitted.
> Is there a way to do it using an attribute ? Or perhaps another way ?
>
> If a target specific attribute must be defined, what should it
> control, and how to recognized it in my backend ?

You should always use a volatile qualified pointer when accessing a
hardware register.  When you do that, gcc should always use the
appropriate mode.

Ian

  reply	other threads:[~2011-11-16 15:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-16 15:06 Aurelien Buhrig
2011-11-16 18:29 ` Ian Lance Taylor [this message]
2011-11-16 19:50   ` Aurelien Buhrig

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=mcrzkfww1bz.fsf@dhcp-172-18-216-180.mtv.corp.google.com \
    --to=iant@google.com \
    --cc=aurelien.buhrig.gcc@gmail.com \
    --cc=gcc-help@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).