https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120616

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Jia-Xien Fang from comment #3)
> Is there any ways to perform the cast for the parameter without using
> -fno-strict-aliasing?

The issue is not the cast but what type the load and store are done as. 

`(long *)(long[]){0, 0}` works for an example.


it is not obvious how to fix the issue using memcpy or an union though.

You could change:
    if (*o < 1) {

to:
long ot;
memcpy(&ot, o, sizeof(long));
if (ot < 1) {

and that would work too.
But it is not obvious based on this reduced code what is the correct fix for
the code.

Reply via email to