Checking out PR4483 (constant overflow on PPC, problems compiling Linux kernel)
Corey Minyard
minyard@acm.org
Tue Nov 20 19:43:00 GMT 2001
I tried to compile the Linux kernel on PowerPC, and I ran into a problem
someone previously reports (PR4483,
http://gcc.gnu.org/ml/gcc-prs/2001-10/msg00105.html). I've played
around with it some, and it looks like a constant is overflowing in the
gcse stage. The PR has a testcase in it.
In the situation, an INSN references two other registers that are
constants (one is 0xffffffff80000000, the other is 42) and subtracts the
second from the first (MINUS code). In validate_replace_rtx_1
(recog.c), it replaces the registers with constants, then adds them.
This results in a constant 0xffffffff7fffffd6, which is obviously now
too negative to fit into an SI register. The original constant was
positive (0x80000000UL in the source). Since constants don't have
modes, the addition code doesn't handle this (and it doesn't look like
it cares, anyway).
I have attached a patch that adds a PowerPC production to truncate a
constant that is too large that goes into a register. However, I'm not
sure if this is the right way to handle this, but it at least works
around the problem. The main production that handles this won't work
because it checks for constant overflows.
I compiled the Linux kernel (after working around a few small problems
there) successfully. However, it crashed at startup :-(.
-Corey
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gcc-ppc-of-1.diff
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20011120/52de45be/attachment.ksh>
More information about the Gcc
mailing list