]> rtime.felk.cvut.cz Git - linux-imx.git/commit
powerpc/ptrace: Fix build with gcc 4.6
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 26 Sep 2011 19:37:57 +0000 (19:37 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 29 Sep 2011 07:02:04 +0000 (17:02 +1000)
commite69b742a6793dc5bf16f6eedca534d4bc10d68b2
tree63765003b6dcffd410d82e3ea2ecd10153596570
parent66857b3a9e88ac6f6e279eaa06b84367e662c0dd
powerpc/ptrace: Fix build with gcc 4.6

gcc (rightfully) complains that we are accessing beyond the
end of the fpr array (we do, to access the fpscr).

The only sane thing to do (whether anything in that code can be
called remotely sane is debatable) is to special case fpscr and
handle it as a separate statement.

I initially tried to do it it by making the array access conditional
to index < PT_FPSCR and using a 3rd else leg but for some reason gcc
was unable to understand it and still spewed the warning.

So I ended up with something a tad more intricated but it seems to
build on 32-bit and on 64-bit with and without VSX.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/ptrace.c