Commit ea02e3dde3509ffa7fda7f8de9c8a366e03f7bbd

Authored by David Howells
Committed by Linus Torvalds
1 parent 3abf7afd40

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: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 2 changed files with 2 additions and 2 deletions Side-by-side Diff

... ... @@ -88,7 +88,7 @@
88 88 # make sure the .S files get compiled with debug info
89 89 # and disable optimisations that are unhelpful whilst debugging
90 90 ifdef CONFIG_DEBUG_INFO
91   -CFLAGS += -O1
  91 +#CFLAGS += -O1
92 92 AFLAGS += -Wa,--gdwarf2
93 93 ASFLAGS += -Wa,--gdwarf2
94 94 endif
... ... @@ -1163,7 +1163,7 @@
1163 1163 struct kmem_cache *cachep;
1164 1164 struct kmem_list3 *l3 = NULL;
1165 1165 int node = cpu_to_node(cpu);
1166   - int memsize = sizeof(struct kmem_list3);
  1166 + const int memsize = sizeof(struct kmem_list3);
1167 1167  
1168 1168 switch (action) {
1169 1169 case CPU_LOCK_ACQUIRE: