linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] __builtin_unreachable
@ 2009-09-10  1:59 Roland McGrath
  2009-09-10  2:00 ` [PATCH 1/2] UNREACHABLE() macro Roland McGrath
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Roland McGrath @ 2009-09-10  1:59 UTC (permalink / raw)
  To: Andrew Morton, Linus Torvalds
  Cc: Jakub Jelinek, linux-kernel, linux-arch, x86

The latest GCC has a better way than "for (;;)" to indicate that a code
path cannot be reached due to reasons the compiler doesn't understand (such
as code in an asm).  These patches provide UNREACHABLE() as a macro to hide
the details of this, and then use it for the BUG() macro on x86, saving
some dead code otherwise generated.

Other arch's BUG() may want to this too instead of "for (;;)" or __builtin_trap.

There are numerous matches from "git grep -n 'for *(;;) *;'" but it takes
someone who knows each bit of code to know where that means UNREACHABLE()
and where it really wants an infinite loop.


The following changes since commit 74fca6a42863ffacaf7ba6f1936a9f228950f657:
  Linus Torvalds (1):
        Linux 2.6.31

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/frob/linux-2.6-roland.git topic/builtin_unreachable

Roland McGrath (2):
      UNREACHABLE() macro
      x86: BUG(): use UNREACHABLE()

 arch/x86/include/asm/bug.h    |    4 ++--
 include/linux/compiler-gcc4.h |   13 +++++++++++++
 include/linux/compiler.h      |    9 +++++++++
 3 files changed, 24 insertions(+), 2 deletions(-)


Thanks,
Roland

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

end of thread, other threads:[~2009-09-13 20:16 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-10  1:59 [PATCH 0/2] __builtin_unreachable Roland McGrath
2009-09-10  2:00 ` [PATCH 1/2] UNREACHABLE() macro Roland McGrath
2009-09-11 20:45   ` Andrew Morton
2009-09-11 20:59     ` Kyle McMartin
2009-09-11 20:59       ` Kyle McMartin
2009-09-11 21:55     ` Roland McGrath
2009-09-12  3:49       ` Arjan van de Ven
2009-09-12  4:43         ` H. Peter Anvin
2009-09-12  5:30           ` Arjan van de Ven
2009-09-12  5:30             ` Arjan van de Ven
2009-09-12  5:52           ` Andrew Morton
2009-09-12  6:38             ` Jakub Jelinek
2009-09-12  6:38               ` Jakub Jelinek
2009-09-13 20:10               ` H. Peter Anvin
2009-09-10  2:01 ` [PATCH 2/2] x86: BUG(): use UNREACHABLE() Roland McGrath
2009-09-10  2:01   ` Roland McGrath
2009-09-10  4:42 ` [PATCH 0/2] __builtin_unreachable Américo Wang
2009-09-10  6:42   ` H. Peter Anvin
2009-09-10  6:13 ` Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).