RE: [EXT] Re: riscv32 : -mno-strict-align has no effect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> 
Sent: Monday, January 20, 2020 4:17 AM
To: Alex Rocha Prado <alex.prado@xxxxxxx>
Cc: gcc-help@xxxxxxxxxxx
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@xxxxxxx> 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.






[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux