Commit ea02e3dd authored by David Howells's avatar David Howells Committed by Linus Torvalds

FRV: work around a possible compiler bug

Work around a possible bug in the FRV compiler.

What appears to be happening is that gcc resolves the
__builtin_constant_p() in kmalloc() to true, but then fails to reduce the
therefore constant conditions in the if-statements it guards to constant
results.

When compiling with -O2 or -Os, one single spurious error crops up in
cpuup_callback() in mm/slab.c.  This can be avoided by making the memsize
variable const.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3abf7afd
...@@ -88,7 +88,7 @@ ASFLAGS += -mno-fdpic ...@@ -88,7 +88,7 @@ ASFLAGS += -mno-fdpic
# make sure the .S files get compiled with debug info # make sure the .S files get compiled with debug info
# and disable optimisations that are unhelpful whilst debugging # and disable optimisations that are unhelpful whilst debugging
ifdef CONFIG_DEBUG_INFO ifdef CONFIG_DEBUG_INFO
CFLAGS += -O1 #CFLAGS += -O1
AFLAGS += -Wa,--gdwarf2 AFLAGS += -Wa,--gdwarf2
ASFLAGS += -Wa,--gdwarf2 ASFLAGS += -Wa,--gdwarf2
endif endif
......
...@@ -1163,7 +1163,7 @@ static int __cpuinit cpuup_callback(struct notifier_block *nfb, ...@@ -1163,7 +1163,7 @@ static int __cpuinit cpuup_callback(struct notifier_block *nfb,
struct kmem_cache *cachep; struct kmem_cache *cachep;
struct kmem_list3 *l3 = NULL; struct kmem_list3 *l3 = NULL;
int node = cpu_to_node(cpu); int node = cpu_to_node(cpu);
int memsize = sizeof(struct kmem_list3); const int memsize = sizeof(struct kmem_list3);
switch (action) { switch (action) {
case CPU_LOCK_ACQUIRE: case CPU_LOCK_ACQUIRE:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment