public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alex Rocha Prado <alex.prado@nxp.com>
To: Stefan Ring <stefanrin@gmail.com>
Cc: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: RE: [EXT] Re: riscv32 : -mno-strict-align has no effect
Date: Mon, 20 Jan 2020 12:52:00 -0000	[thread overview]
Message-ID: <AM0PR04MB4387554691D5B118637737D385320@AM0PR04MB4387.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <CAAxjCEzMGtR+qQMY_dH2PoBfKQq5BJwwqOOFB0R6UKjQjaCdBg@mail.gmail.com>


Hi Stefan,

I am sorry, I did not understand why the example is not a good one. My intention is exactly making sure the compiler notice it is an unaligned access and by using -mno-strict-align it generate regular lw/st instructions (since the hardware can handle it nicely).

Regards,
Alex

-----Original Message-----
From: Stefan Ring <stefanrin@gmail.com> 
Sent: Monday, January 20, 2020 4:17 AM
To: Alex Rocha Prado <alex.prado@nxp.com>
Cc: gcc-help@gcc.gnu.org
Subject: [EXT] Re: riscv32 : -mno-strict-align has no effect

Caution: EXT Email

On Mon, Jan 20, 2020 at 2:39 AM Alex Rocha Prado <alex.prado@nxp.com> wrote:
>
>   Given the test source code below (example):
>
> void foo(void)
> {
>    *((int*) 0x1001) = *((int*) 0x2003); } [...] It happens that both 
> line generate the same code, so there is some kind of problem with gcc, correct ?

I don't think this is a good example, as the compiler can see from the constants that the addresses are not aligned.



  reply	other threads:[~2020-01-20 12:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-20  1:39 Alex Rocha Prado
2020-01-20  7:17 ` Stefan Ring
2020-01-20 12:52   ` Alex Rocha Prado [this message]
2020-01-20 22:24 ` Jim Wilson
2020-01-21  8:20   ` Henri Cloetens
2020-01-21 10:36     ` Henri Cloetens

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=AM0PR04MB4387554691D5B118637737D385320@AM0PR04MB4387.eurprd04.prod.outlook.com \
    --to=alex.prado@nxp.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=stefanrin@gmail.com \
    /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).