[Bug c/91362] program compiled with O3 optimization give different output than without optimization

2019-08-06 Thread matic at nimp dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91362

--- Comment #3 from matic at nimp dot co.uk ---
Sorry I was not aware of "aliasing". Thanks for the pointers to solutions.

[Bug c/91362] program compiled with O3 optimization give different output than without optimization

2019-08-05 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91362

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #2 from Andrew Pinski  ---
This is an alias violation for sure.
You write ctx->c as uint64_t and then read it as uint32_t in a few places.
Even inside gascon_rotr64_interleaved2 too.

Either use an union of (array of uint32_t) and an uint64_t or use memcpy to
read as uint32_t.

[Bug c/91362] program compiled with O3 optimization give different output than without optimization

2019-08-05 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91362

--- Comment #1 from Jonathan Wakely  ---
Looks like an aliasing violation.