[Bug target/114399] [14] RISC-V rv32i miscompile
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Mar 20 00:34:36 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114399
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |INVALID
Status|UNCONFIRMED |RESOLVED
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
32bit i686 long long has an alignment of 4 while most other targets have an
alignment of 8.
Which you could see via sizeof.
```
int tt = sizeof(struct b);
int tt1 = sizeof(struct d);
```
i?86:
```
tt:
.long 8
...
tt1:
.long 12
```
RISCV32:
```
tt:
.word 8
...
tt1:
.word 16
```
Basically in the i?86 case, i.h.f++ will modify byte 4 of the union while on
most other targets, it will modify byte 8.
More information about the Gcc-bugs
mailing list