Skip to contentSkip to conversation

ilog2() problems with gcc-3.4.5

DISCUSSION Andrew Morton 2 participants 3 messages Jan 15, 2009

lore
Share & tools
lore
#0 lore raw

My sparc64 gcc-3.4.5 cross-compiler has decided to start emitting calls to ____ilog2_NaN, due to

        eq_context->log_eq_size   = ilog2(eq->nent);

in drivers/net/mlx4/eq.c. There's another reference coming out of drivers/net/mlx4/srq.s.

I guess this is a gcc bug - it's gone and decided that __builtin_constant_p(eq->nent) is true :(

We've had this __builtin_constant_p() bogon occur before now - it happened with one or two kmalloc() callsites on x86 for some gcc versions, but we seemed to make it go away by some means.

I guess I can ignore the link errors for now, but it's sad to have to rub out yet another gcc version.

#1 lore raw
Quoted 9 lines · Andrew Morton

My sparc64 gcc-3.4.5 cross-compiler has decided to start emitting calls to ____ilog2_NaN, due to

        eq_context->log_eq_size   = ilog2(eq->nent);

in drivers/net/mlx4/eq.c. There's another reference coming out of drivers/net/mlx4/srq.s.

Quoted 6 lines

I guess this is a gcc bug - it's gone and decided that __builtin_constant_p(eq->nent) is true :(

We've had this __builtin_constant_p() bogon occur before now - it happened with one or two kmalloc() callsites on x86 for some gcc versions, but we seemed to make it go away by some means.

Googled a bit.
Seems to be influenced by use of -Os versus -O2.

Sam

#2 lore raw
In reply to Andrew Morton
Quoted 13 lines · On Thu, 15 Jan 2009 22:54:44 +0100 Sam Ravnborg <[email protected]> wrote:
Quoted 12 lines · Andrew Morton

My sparc64 gcc-3.4.5 cross-compiler has decided to start emitting calls to ____ilog2_NaN, due to

        eq_context->log_eq_size   = ilog2(eq->nent);

in drivers/net/mlx4/eq.c. There's another reference coming out of drivers/net/mlx4/srq.s.

I guess this is a gcc bug - it's gone and decided that __builtin_constant_p(eq->nent) is true :(

Quoted 7 lines
Quoted 3 lines

We've had this __builtin_constant_p() bogon occur before now - it happened with one or two kmalloc() callsites on x86 for some gcc versions, but we seemed to make it go away by some means.

Googled a bit.
Seems to be influenced by use of -Os versus -O2.

Thanks.

<checks>

It's happening with both -Os and -O2.