This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Reload bug
- To: gcc at gcc dot gnu dot org
- Subject: Reload bug
- From: Andreas Schwab <schwab at suse dot de>
- Date: 01 Sep 1999 17:39:51 +0200
The following function generates a compiler crash in final:
$ cat random.c
unsigned int GetRandom (void);
long long
Default_RandInt (long long Max)
{
long long f, m, r, a, b;
long long s;
do
{
m = Max;
s = 0;
f = 1;
while (m > 1)
{
if (m >= 4294967296)
r = GetRandom ();
else
{
a = 4294967296 - 4294967296 % m;
do
b = GetRandom ();
while (!(b < a));
r = b % m;
}
s += r * f;
f = f * 4294967296;
m = (m - 1) / 4294967296 + 1;
}
}
while (!(s < Max || Max == 0));
return s;
}
$ b=/cvs/test/i686-linux/egcs/gcc; $b/xgcc -B$b/ -O2 -fpic -S random.c -da
random.c: In function `Default_RandInt':
random.c:34: Internal compiler error in `change_address', at emit-rtl.c:1516
Please submit a full bug report.
See <URL:http://www.gnu.org/software/gcc/faq.html#bugreport> for instructions.
The problem is in the following two insns:
(insn 256 254 10 (set (reg:DI 31)
(mem/u:DI (plus:SI (reg:SI 3 %ebx)
(const (unspec[
(symbol_ref/u:SI ("*.LC0"))
] 7))) 0)) 79 {movdi+1} (nil)
(expr_list:REG_EQUIV (const_double (mem/u:DI (symbol_ref/u:SI ("*.LC0")) 0) 0 [0x0] 1 [0x1] 0 [0x0])
(nil)))
(insn 83 77 85 (parallel[
(set (reg/v:DI 26)
(minus:DI (reg:DI 31)
(reg:DI 38)))
(clobber (scratch:SI))
] ) 215 {subdi3} (insn_list 77 (nil))
(expr_list:REG_DEAD (reg:DI 38)
(expr_list:REG_UNUSED (scratch:SI)
(nil))))
During global alloc register 31 is replaced by (mem:DI (symbol_ref)), but
a symbol_ref is not a valid memory operand due to PIC. In other words,
register 31 is _not_ equivalent to what insn 256 claims.
--
Andreas Schwab "And now for something
schwab@suse.de completely different."
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg