[Bug target/96304] Possible mis-compile of SQLite for ARM using gcc 8.3.0 and -O2

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jul 24 07:10:02 GMT 2020


--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #3)
> > But, are we violating aliasing rules here?  What am I missing?
> Likely you are, but I must admit it's sometimes quite difficult to find that.
> From quickly looking at the function, you may violate it here:
>   MemJournal *p = (MemJournal*)pJfd;
> maybe
> MemJournal *p = (MemJournal*)(char*)pJfd;
> can solve it.
> Unfortunately I can't reproduce it on my x86_64-linux box.

An intermediate cast does never solve any strict-aliasing issue.

More information about the Gcc-bugs mailing list