------- Comment #1 from dominiq at lps dot ens dot fr 2007-09-15 19:47 ------- I have reduced the test to:
C* PCAPOP SUBROUTINE PCAPOP() DIMENSION NVA(6) C ! P1=FLOAT(NB)/FLOAT(M1) 10 IP1=P1 IF(IP1.GE.NVA(K)) GOTO 7 IF(IP2.EQ.0) GOTO 3 7 IF(K.EQ.6) GOTO 11 GOTO 10 11 IP1=0 3 CONTINUE END It gives slightly different failures at -O1: 19990826-3_red.f: In function 'pcapop': 19990826-3_red.f:12: error: invalid rtl sharing found in the insn (insn 42 41 43 2 19990826-3_red.f:7 (set (reg:SI 136) (mem/c/i:SI (plus:SI (reg/f:SI 113 sfp) (const_int 60 [0x3c])) [0 S4 A32])) 328 {*movsi_internal1} (expr_list:REG_EQUAL (fix:SI (reg:DF 134)) (nil))) 19990826-3_red.f:12: error: shared rtx (mem/c/i:SI (plus:SI (reg/f:SI 113 sfp) (const_int 60 [0x3c])) [0 S4 A32]) 19990826-3_red.f:12: internal compiler error: internal consistency failure Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. -O2: 19990826-3_red.f: In function 'pcapop': 19990826-3_red.f:12: error: invalid rtl sharing found in the insn (insn 44 43 45 2 (set (reg:SI 136) (mem/c/i:SI (plus:SI (reg/f:SI 113 sfp) (const_int 60 [0x3c])) [3 S4 A32])) 328 {*movsi_internal1} (expr_list:REG_EQUAL (fix:SI (reg:DF 134)) (nil))) 19990826-3_red.f:12: error: shared rtx (mem/c/i:SI (plus:SI (reg/f:SI 113 sfp) (const_int 60 [0x3c])) [3 S4 A32]) 19990826-3_red.f:12: internal compiler error: internal consistency failure Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. and -Os: 19990826-3_red.f: In function 'pcapop': 19990826-3_red.f:12: error: invalid rtl sharing found in the insn (insn 43 42 44 2 19990826-3_red.f:7 (set (reg:SI 136) (mem/c/i:SI (plus:SI (reg/f:SI 113 sfp) (const_int 60 [0x3c])) [3 S4 A32])) 328 {*movsi_internal1} (expr_list:REG_EQUAL (fix:SI (reg:DF 134)) (nil))) 19990826-3_red.f:12: error: shared rtx (mem/c/i:SI (plus:SI (reg/f:SI 113 sfp) (const_int 60 [0x3c])) [3 S4 A32]) 19990826-3_red.f:12: internal compiler error: internal consistency failure Please submit a full bug report, with preprocessed source if appropriate. but compiles at -O0 and -O3. Now the strange thing is that if I uncomment the line: ! P1=FLOAT(NB)/FLOAT(M1) it fails only at -O1 and -Os: [karma] f90/bug% gfc -c -O0 19990826-3_red.f [karma] f90/bug% gfc -c -Os 19990826-3_red.f 19990826-3_red.f: In function 'pcapop': 19990826-3_red.f:12: error: invalid rtl sharing found in the insn (insn 60 59 61 2 19990826-3_red.f:7 (set (reg:SI 156) (mem/c/i:SI (plus:SI (reg/f:SI 113 sfp) (const_int 76 [0x4c])) [3 S4 A32])) 328 {*movsi_internal1} (expr_list:REG_EQUAL (fix:SI (reg:DF 154)) (nil))) 19990826-3_red.f:12: error: shared rtx (mem/c/i:SI (plus:SI (reg/f:SI 113 sfp) (const_int 76 [0x4c])) [3 S4 A32]) 19990826-3_red.f:12: internal compiler error: internal consistency failure Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. [karma] f90/bug% gfc -c -O3 19990826-3_red.f [karma] f90/bug% gfc -c -O2 19990826-3_red.f [karma] f90/bug% gfc -c -O1 19990826-3_red.f 19990826-3_red.f: In function 'pcapop': 19990826-3_red.f:12: error: invalid rtl sharing found in the insn (insn 59 58 60 2 19990826-3_red.f:7 (set (reg:SI 156) (mem/c/i:SI (plus:SI (reg/f:SI 113 sfp) (const_int 76 [0x4c])) [0 S4 A32])) 328 {*movsi_internal1} (expr_list:REG_EQUAL (fix:SI (reg:DF 154)) (nil))) 19990826-3_red.f:12: error: shared rtx (mem/c/i:SI (plus:SI (reg/f:SI 113 sfp) (const_int 76 [0x4c])) [0 S4 A32]) 19990826-3_red.f:12: internal compiler error: internal consistency failure Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. I did not succeeded to further simplify the spaghetti code while keeping the failure(s). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33348