This is the mail archive of the cygwin-patches mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 4/5] Cygwin: fix GCC 8.3 'asm volatile' errors (fwd)

Apparently I ran afoul of some overzealous spam filter:

SMTP error from remote server for TEXT command, host:
( reason: 552 spam score exceeded threshold

---------- Forwarded message ----------
Date: Thu, 18 Jul 2019 11:01:33 +0200 (CEST)
From: Johannes Schindelin <>
To: "" <>
Cc: Ken Brown <>
Subject: Re: [PATCH 4/5] Cygwin: fix GCC 8.3 'asm volatile' errors


On Wed, 17 Jul 2019, Corinna Vinschen wrote:

> Hi Ken,
> On Jul 16 17:34, Ken Brown wrote:
> > Remove 'volatile'.
> What happened to asm volatile?   Can you add a short description (single
> sentence) to the commit msg explaining why this is a problem now?

As it so happens, we discussed this very patch in the MSYS2 Gitter channel the other day, and this is what I found:

	winsup/cygwin/ error:sm qualifier 'volatile' ignored outside of function body [-Werror]
	748 | asm volatile (" \n\

According to,
it seems that the GCC team meant to demote this to a mere warning.

But of course -Werror will upgrade that to an error.

The patches suggest that the volatile qualifier here is unnecessary and
has no effect. My understanding is that the `asm volatile` construct
prevents assembler code from being optimized away, but only in inline
assembler instructions. Top-level functions, such as that `memset()`
family of functions, should not be subject to optimization anyway, so I
kind of understand why the `volatile` attribute is ignored.

In short: it seems that the `volatile` attribute of a top-level `asm`
block has no effect, and has not had any effect for some time.

Note: I am no longer really good at machine code, so I might be reading
this all wrong. Hopefully it gives you some inspiration for a good
commit message, though?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]