Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 125094
b: refs/heads/master
c: d2fde28
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Jan 2, 2009
1 parent 2b0baf5 commit 7683dcd
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e65f0f8271b1b0452334e5da37fd35413a000de4
refs/heads/master: d2fde28ce793c09c1ea36d981cb6765174fd1eea
5 changes: 5 additions & 0 deletions trunk/include/linux/compiler-gcc.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,8 @@
#define noinline __attribute__((noinline))
#define __attribute_const__ __attribute__((__const__))
#define __maybe_unused __attribute__((unused))

#define __gcc_header(x) #x
#define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h)
#define gcc_header(x) _gcc_header(x)
#include gcc_header(__GNUC__)
3 changes: 0 additions & 3 deletions trunk/include/linux/compiler-gcc3.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
#error "Please don't include <linux/compiler-gcc3.h> directly, include <linux/compiler.h> instead."
#endif

/* These definitions are for GCC v3.x. */
#include <linux/compiler-gcc.h>

#if __GNUC_MINOR__ >= 3
# define __used __attribute__((__used__))
#else
Expand Down
8 changes: 5 additions & 3 deletions trunk/include/linux/compiler-gcc4.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
#error "Please don't include <linux/compiler-gcc4.h> directly, include <linux/compiler.h> instead."
#endif

/* These definitions are for GCC v4.x. */
#include <linux/compiler-gcc.h>
/* GCC 4.1.[01] miscompiles __weak */
#if __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ <= 1
# error Your version of gcc miscompiles the __weak directive
#endif

#define __used __attribute__((__used__))
#define __must_check __attribute__((warn_unused_result))
Expand All @@ -16,7 +18,7 @@
*/
#define uninitialized_var(x) x = x

#if !(__GNUC__ == 4 && __GNUC_MINOR__ < 3)
#if __GNUC_MINOR__ >= 3
/* Mark functions as cold. gcc will assume any path leading to a call
to them will be unlikely. This means a lot of manual unlikely()s
are unnecessary now for any paths leading to the usual suspects
Expand Down
8 changes: 2 additions & 6 deletions trunk/include/linux/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,8 @@ extern void __chk_io_ptr(const volatile void __iomem *);

#ifdef __KERNEL__

#if __GNUC__ >= 4
# include <linux/compiler-gcc4.h>
#elif __GNUC__ == 3 && __GNUC_MINOR__ >= 2
# include <linux/compiler-gcc3.h>
#else
# error Sorry, your compiler is too old/not recognized.
#ifdef __GNUC__
#include <linux/compiler-gcc.h>
#endif

#define notrace __attribute__((no_instrument_function))
Expand Down
9 changes: 0 additions & 9 deletions trunk/init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,6 @@
#include <asm/smp.h>
#endif

/*
* This is one of the first .c files built. Error out early if we have compiler
* trouble.
*/

#if __GNUC__ == 4 && __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ == 0
#warning gcc-4.1.0 is known to miscompile the kernel. A different compiler version is recommended.
#endif

static int kernel_init(void *);

extern void init_IRQ(void);
Expand Down

0 comments on commit 7683dcd

Please sign in to comment.