This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Make basic asm implicitly clobber memory, pr24414
- From: Bernd Edlinger <bernd dot edlinger at hotmail dot de>
- To: Bernd Schmidt <bschmidt at redhat dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: Richard Biener <rguenther at suse dot de>, Jeff Law <law at redhat dot com>
- Date: Wed, 9 Dec 2015 16:32:30 +0000
- Subject: Re: [PATCH] Make basic asm implicitly clobber memory, pr24414
- Authentication-results: sourceware.org; auth=none
- Authentication-results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=hotmail.de;
- References: <VI1PR07MB09116C40BE502A341AE0CB9EE4E80 at VI1PR07MB0911 dot eurprd07 dot prod dot outlook dot com> <56680B27 dot 5090405 at redhat dot com> <VI1PR07MB0911C236A0B2C0ED1C2477C4E4E80 at VI1PR07MB0911 dot eurprd07 dot prod dot outlook dot com> <56684D4B dot 9020308 at redhat dot com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:23
Hi,
On 09.12.2015 16:48 Bernd Schmidt wrote:
> On 12/09/2015 04:09 PM, Bernd Edlinger wrote:
>
>> So would you agree on the general direction of the patch,
>> if I drop the hunk in sched-deps.c ?
>
> I'm not sure there was any consensus in that other thread, but I think
> assuming that basic asms clobber memory and CC, can be justified. That
> certainly seems like a safer default. Ideally though I think it would
> be best if we could deprecate basic asms in functions, or at least
> warn about them in -Wall.
>
>
Well no, we did not get to a consensus on the warning issue.
My personal gut feeling on that warning is a bit mixed...
If we have a -Wall-enabled warning on asm("..."), people who know next
to nothing
about assembler will be encouraged to "fix" this warning in a part of
the code which
they probably do not understand at all. This frightens me a bit.
Because I know they will soon find out, that adding a few colons fixes
the warning, but
asm("...":::) is not any better IMHO.
For me, it is just very very unlikely that any piece of assembler really
clobbers nothing
and has no inputs and no outputs at the same time, even it it looks so
at first sight...
It is much more likely that someone forgot to fill in the clobber section.
So for me it would also be good to warn on asm("...":::) and require
that, if they want
to fix this warning, they must at least write something in the clobber
section, like asm ("...":::"nothing"); that would be a new clobber name
which can only
stand alone and, which can get stripped after the warning processing
took place in the FE.
So I think a warning should warn on something that is so unusual that it
is likely a bug.
Bernd.