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

--- Comment #14 from Julian Andres Klode <j...@jak-linux.org> ---
(In reply to Andrew Pinski from comment #11)
> >These may be related (do q31 and v31 overlap?)
> 
> Q31 and V31 are the same register just different views into it. That is q31
> is the full 128bit view while v31.4s is the 32bit x 4 element vector view of
> the register. That is just storing 0 into those 2 locations.

Indeed, I'm not sure that's the affected location, after all the user who
reported it tried it on other arm64 machines and those worked correctly; and I
tried running the code on Graviton and valgrind on Graviton and only the former
got 0, so it's likely not as simple as a simple initialization mishap.

We're calling OpenSSL which is probably doing a whole thing of optimized code
in the https calls, it's possible some register is not in the state we expect
it to be in after OpenSSL returns; but idk.

Lots of unknown.(In reply to Andrew Pinski from comment #12)
> A few things to test out first:
> Is it -fsanitize=address clean?

I can try some more stuff tomorrow!

> 
> Does -fno-lifetime-dse help? Does -fstack-reuse=none help? What about both
> together?

I localized it to the constructor as an attribute:

   RequestState(BaseHttpMethod * const Owner, ServerState * const Server)
__attribute__((optimize("no-lifetime-dse"))):

   RequestState(BaseHttpMethod * const Owner, ServerState * const Server)
__attribute__((optimize("stack-reuse=none"))):

and both of these fix the problem individually as well.

Reply via email to