From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Schwab To: gcc@gcc.gnu.org Subject: Reload bug Date: Wed, 01 Sep 1999 08:40:00 -0000 Message-id: X-SW-Source: 1999-09/msg00007.html 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 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Schwab To: gcc@gcc.gnu.org Subject: Reload bug Date: Thu, 30 Sep 1999 18:02:00 -0000 Message-ID: X-SW-Source: 1999-09n/msg00007.html Message-ID: <19990930180200.TNKzCnxPnIB2kHoyxQ7y-8m6t61jOfkOWAUZG58Mtm0@z> 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 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