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

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Klaus Leppkes from comment #7)
> 1.) According to Jacob, g++ gives warning: ("Whether this PR is valid or
> invalid is unclear, matching constraints for "m" are unsupported, we even
> warn on "=m" (...) : "0" (...) which is the reason why "+m" is lowered to
> "=m" (...) : "m" (...).").
> Which flags to I need to specify to see such warnings? I tried the usual
> suspects like -Wall -Wextra...

The warning is enabled by default, try:
void foo (int x) { asm ("" : "=m" (x) : "0" (x)); }
warning: matching constraint does not allow a register

> b) The behavior is correct, google benchmark needs to be fixed. For now I
> just overloaded DoNotOptimize for double and long double lvalues refs with
> "g" instead of "m" and it seems to work fine. But I wonder if this effects
> other cases, which then needs to be handled for gcc too.

There is no reason not to use "+g" for DoNotOptimize for all types, there is
nothing double/long double specific on it.

Reply via email to