gcc-2.95.2 (Linux) internal error, egcs-2.91.66 wrong ass.-code

Daniel Lauer daniel@informatik.uni-bonn.de
Mon Jan 31 04:50:00 GMT 2000


Hello,

the compiler
	GNU C version 2.95.2 19991024 (release) (i586-pc-linux-gnu)
	compiled by GNU C version 2.95.2 19991024 (release).
stops with error message

	crepex2.c:13427: internal error--unrecognizable insn:
	(insn 16406 16404 28347 (parallel[ 
	            (set (reg:SI 2 %ecx)
	                (asm_operands ("addl %4,%0
	adcl $0,%1
	") ("=&r") 0[ 
	                        (reg:SI 2 %ecx)
	                        (reg:SI 0 %eax)
	                        (reg:SI 0 %eax)
	                    ] 
	                    [ 
	                        (asm_input:SI ("0"))
	                        (asm_input:SI ("1"))
	                        (asm_input:SI ("g"))
	                    ]  ("crepex2.c") 11591))
	            (set (reg:SI 0 %eax)
	                (asm_operands ("addl %4,%0
	adcl $0,%1
	") ("=&r") 1[ 
	                        (reg:SI 2 %ecx)
	                        (reg:SI 0 %eax)
	                        (reg:SI 0 %eax)
	                    ] 
	                    [ 
	                        (asm_input:SI ("0"))
	                        (asm_input:SI ("1"))
	                        (asm_input:SI ("g"))
	                    ]  ("crepex2.c") 11591))
	        ] ) -1 (insn_list 16400 (insn_list 16402 (nil)))
	    (nil))

when compiling the C-source "crepex2.i" (15172 lines, many asm-statements,
many goto's: automatic generated code) with command line
        gcc -v --save-temps -O1 -S -Wall crepex2.i

The compilers
	gcc version egcs-2.91.66 Debian GNU/Linux (egcs-1.1.2 release)
and	gcc version egcs-2.91.60
do not stop with error, but produce wrong assembler code

-- crepex2.s:16267 -----------------------------------------------------
	        movl %ecx,-172(%ebp)
	#APP
	        nop
	#NO_APP
     	        movl %eax,%ecx
-->>	        movl %ecx,%edx
	#APP
	        addl %edx,%ecx
	adcl $0,%edx
	
	#NO_APP

(both registers of "addl" will have the same contents, but the source
crepex2.i:13089 = crepex2.c:11591 shows that this is wrong in general.)
-----------------------------------------------------------------------

These errors / wrong assembler codes do not appear when compiling without
optimization.

The following compilers seem to be okay:
     -  gcc version 2.8.1
     -  gcc version 2.7.2.3
     -  gcc version 2.7.2.1

Andre Weilert, Daniel Lauer,
Bonn, Germany, 2000, Jan 31

Appendix:
 - output of gcc-2.95.2
 - 'uname -a' of our machine
 - debian package info
 - attachment: crepex2.i.bz2

--output of gcc-2.95.2----------------------------------------------------

Reading specs from /usr/local/gcc-2.95.2/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)
 /usr/local/gcc-2.95.2/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/cc1 crepex2.i -quiet -O1 -Wall -version -o crepex2.s
GNU C version 2.95.2 19991024 (release) (i586-pc-linux-gnu) compiled by GNU C version 2.95.2 19991024 (release).
crepex2.c: In function `dispatchi_1':
crepex2.c:849: warning: label `tracer' defined but not used
crepex2.c:740: warning: label `call_jpc' defined but not used
crepex2.c:644: warning: label `tape_wind_ma_disc' defined but not used
crepex2.c:635: warning: label `tape_wind_ma_plus' defined but not used
crepex2.c:626: warning: label `tape_wind_ma_minus' defined but not used
crepex2.c:578: warning: `twd' might be used uninitialized in this function
crepex2.c:579: warning: `twt' might be used uninitialized in this function
crepex2.c:580: warning: `twdir' might be used uninitialized in this function
crepex2.c:580: warning: `twdisc' might be used uninitialized in this function
crepex2.c: In function `dispatchi_2':
crepex2.c:6066: warning: label `call_jpc' defined but not used
crepex2.c:5970: warning: label `tape_wind_ma_disc' defined but not used
crepex2.c:5961: warning: label `tape_wind_ma_plus' defined but not used
crepex2.c:5952: warning: label `tape_wind_ma_minus' defined but not used
crepex2.c:5904: warning: `twd' might be used uninitialized in this function
crepex2.c:5905: warning: `twt' might be used uninitialized in this function
crepex2.c:5906: warning: `twdir' might be used uninitialized in this function
crepex2.c:5906: warning: `twdisc' might be used uninitialized in this function
crepex2.c:13427: internal error--unrecognizable insn:
(insn 16406 16404 28347 (parallel[ 
            (set (reg:SI 2 %ecx)
                (asm_operands ("addl %4,%0
adcl $0,%1
") ("=&r") 0[ 
                        (reg:SI 2 %ecx)
                        (reg:SI 0 %eax)
                        (reg:SI 0 %eax)
                    ] 
                    [ 
                        (asm_input:SI ("0"))
                        (asm_input:SI ("1"))
                        (asm_input:SI ("g"))
                    ]  ("crepex2.c") 11591))
            (set (reg:SI 0 %eax)
                (asm_operands ("addl %4,%0
adcl $0,%1
") ("=&r") 1[ 
                        (reg:SI 2 %ecx)
                        (reg:SI 0 %eax)
                        (reg:SI 0 %eax)
                    ] 
                    [ 
                        (asm_input:SI ("0"))
                        (asm_input:SI ("1"))
                        (asm_input:SI ("g"))
                    ]  ("crepex2.c") 11591))
        ] ) -1 (insn_list 16400 (insn_list 16402 (nil)))
    (nil))
-------------------------------------------------------------------------

--uname -a ---------------------------------------------------------------

Linux pi 2.0.36 #2 Sun Feb 21 15:55:27 EST 1999 i586 unknown

-------------------------------------------------------------------------

--debian package info ---------------------------------------------------

Package: egcc
Priority: extra
Section: devel
Installed-Size: 1709
Maintainer: Debian EGCS maintainers <egcs@packages.debian.org>
Architecture: i386
Source: egcs (1.1.2-0slink2)
Version: 2.91.66-0slink2
Replaces: egcc-ss (<< 2.91.67)
Provides: c-compiler
Depends: libc6, g++ (>= 2.91.66), g++ (<< 2.91.67)
Recommends: libc-dev
Suggests: egcs-docs (>= 2.91.66)
Conflicts: libc5-dev
Size: 819862
Description: The GNU (egcs) C compiler.
 This is the egcs version of the GNU C compiler, a fairly portable
 optimizing compiler which supports multiple languages.  This package
 includes support for C.  This package is _not_ the default c compiler
 on this architecture: for that, check out the gcc package.

-------------------------------------------------------------------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: crepex2.i.bz2
Type: application/x-bzip2
Size: 29002 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20000131/8272aaf7/attachment.bz2>


More information about the Gcc-bugs mailing list