• Paul E. McKenney's avatar
    rcu: Silence compiler array out-of-bounds false positive · 4930521a
    Paul E. McKenney authored
    It turns out that gcc 4.8 warns on array indexes being out of bounds
    unless it can prove otherwise.  It gives this warning on some RCU
    initialization code.  Because this is far from any fastpath, add
    an explicit check for array bounds and panic if so.  This gives the
    compiler enough information to figure out that the array index is never
    out of bounds.
    
    However, if a similar false positive occurs on a fastpath, it will
    probably be necessary to tell the compiler to keep its array-index
    anxieties to itself.  ;-)
    
    Markus Trippelsdorf <markus@trippelsdorf.de>
    Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
    Reviewed-by: default avatarJosh Triplett <josh@joshtriplett.org>
    4930521a
rcutree.c 94.6 KB