All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] compiler/gcc5: Remove quirk for asm_volatile_goto()
@ 2015-04-14  9:25 Martin Liška
  2015-04-14 17:58 ` Linus Torvalds
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Liška @ 2015-04-14  9:25 UTC (permalink / raw)
  To: linux-sparse; +Cc: sparse

Remove comments related to GCC 4.x branch and workaround for
asm_volatile_goto which is fixed in GCC 5 release.

Signed-off-by: Martin Liska  <mliska@suse.cz>
---
  include/linux/compiler-gcc5.h | 16 ++--------------
  1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/include/linux/compiler-gcc5.h b/include/linux/compiler-gcc5.h
index efee493..1ded0a0 100644
--- a/include/linux/compiler-gcc5.h
+++ b/include/linux/compiler-gcc5.h
@@ -12,10 +12,6 @@
     like BUG(), printk(), panic() etc. [but let's keep them for now for
     older compilers]
  
-   Early snapshots of gcc 4.3 don't support this and we can't detect this
-   in the preprocessor, but we can live with this because they're unreleased.
-   Maketime probing would be overkill here.
-
     gcc also has a __attribute__((__hot__)) to move hot functions into
     a special section, but I don't see any sense in this right now in
     the kernel context */
@@ -32,10 +28,6 @@
   * Mark a position in code as unreachable.  This can be used to
   * suppress control flow warnings after asm blocks that transfer
   * control elsewhere.
- *
- * Early snapshots of gcc 4.5 don't support this and we can't detect
- * this in the preprocessor, but we can live with this because they're
- * unreleased.  Really, we need to have autoconf for the kernel.
   */
  #define unreachable() __builtin_unreachable()
  
@@ -48,15 +40,11 @@
  #define __visible __attribute__((externally_visible))
  
  /*
- * GCC 'asm goto' miscompiles certain code sequences:
+ * 'asm goto' miscompilation is fixed in GCC 5.x version:
   *
   *   http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
- *
- * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
- *
- * (asm goto is automatically volatile - the naming reflects this.)
   */
-#define asm_volatile_goto(x...)	do { asm goto(x); asm (""); } while (0)
+#define asm_volatile_goto(x...)	do { asm goto(x); } while (0)
  
  #ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
  #define __HAVE_BUILTIN_BSWAP32__
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] compiler/gcc5: Remove quirk for asm_volatile_goto()
  2015-04-14  9:25 [PATCH 1/2] compiler/gcc5: Remove quirk for asm_volatile_goto() Martin Liška
@ 2015-04-14 17:58 ` Linus Torvalds
  2015-04-15  9:08   ` Martin Liška
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Torvalds @ 2015-04-14 17:58 UTC (permalink / raw)
  To: Martin Liška; +Cc: Sparse Mailing-list, Chris Li

On Tue, Apr 14, 2015 at 2:25 AM, Martin Liška <mliska@suse.cz> wrote:
> Remove comments related to GCC 4.x branch and workaround for
> asm_volatile_goto which is fixed in GCC 5 release.

How sure are you that it is *really* fixed? Because it wasn't, last we saw.

It was originally claimed to be fixed in 4.8.2, but that turned out to
be wrong. See commit 5631b8fba640 ("compiler/gcc4+: Remove inaccurate
comment about 'asm goto' miscompiles"), and

    https://lkml.org/lkml/2014/2/12/817

which shows that the bugzilla you reference is at the very least
unreliable. Apparently the gcc test-case didn't catch all the
problems.

IOW, just leave the workaround. It has no actual cost, and the gcc bug
wasn't obviously fully fixed. There are apparently very few users of
"asm goto" (probably partly because of the limitations of it,
particularly the "no outputs").

                           Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] compiler/gcc5: Remove quirk for asm_volatile_goto()
  2015-04-14 17:58 ` Linus Torvalds
@ 2015-04-15  9:08   ` Martin Liška
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Liška @ 2015-04-15  9:08 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Sparse Mailing-list, Chris Li

[-- Attachment #1: Type: text/plain, Size: 1213 bytes --]

On 04/14/2015 07:58 PM, Linus Torvalds wrote:
> On Tue, Apr 14, 2015 at 2:25 AM, Martin Liška <mliska@suse.cz> wrote:
>> Remove comments related to GCC 4.x branch and workaround for
>> asm_volatile_goto which is fixed in GCC 5 release.
>
> How sure are you that it is *really* fixed? Because it wasn't, last we saw.
>
> It was originally claimed to be fixed in 4.8.2, but that turned out to
> be wrong. See commit 5631b8fba640 ("compiler/gcc4+: Remove inaccurate
> comment about 'asm goto' miscompiles"), and
>
>      https://lkml.org/lkml/2014/2/12/817
>
> which shows that the bugzilla you reference is at the very least
> unreliable. Apparently the gcc test-case didn't catch all the
> problems.
>
> IOW, just leave the workaround. It has no actual cost, and the gcc bug
> wasn't obviously fully fixed. There are apparently very few users of
> "asm goto" (probably partly because of the limitations of it,
> particularly the "no outputs").
>
>                             Linus
>

Hello Linus.

Agree with you that a bit more defensive approach is reasonable, mainly because
of the actual cost.

Thus, I send updated version of the patch which just removes unrelated GCC 4.x branch
comments.

Thanks,
Martin


[-- Attachment #2: 0001-compiler-gcc5-Remove-comments-related-to-GCC-4.x-bra.patch --]
[-- Type: text/x-patch, Size: 835 bytes --]

From 9db00c78af98a26685d3e0034d26962167441070 Mon Sep 17 00:00:00 2001
From: mliska <mliska@suse.cz>
Date: Wed, 15 Apr 2015 10:55:14 +0200
Subject: [PATCH 1/2] compiler/gcc5: Remove comments related to GCC 4.x branch.

Signed-off-by: Martin Liska  <mliska@suse.cz>
---
 include/linux/compiler-gcc5.h | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/include/linux/compiler-gcc5.h b/include/linux/compiler-gcc5.h
index efee493..abb03b8 100644
--- a/include/linux/compiler-gcc5.h
+++ b/include/linux/compiler-gcc5.h
@@ -12,10 +12,6 @@
    like BUG(), printk(), panic() etc. [but let's keep them for now for
    older compilers]
 
-   Early snapshots of gcc 4.3 don't support this and we can't detect this
-   in the preprocessor, but we can live with this because they're unreleased.
-   Maketime probing would be overkill here.

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-15  9:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-14  9:25 [PATCH 1/2] compiler/gcc5: Remove quirk for asm_volatile_goto() Martin Liška
2015-04-14 17:58 ` Linus Torvalds
2015-04-15  9:08   ` Martin Liška

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.