Subject: port-arm32/7157: egcs's "-O2" optimization broken on "arm32"
To: None <gnats-bugs@gnats.netbsd.org>
From: Matthias Scheler <tron@lyssa.owl.de>
List: netbsd-bugs
Date: 03/14/1999 17:59:21
>Number:         7157
>Category:       port-arm32
>Synopsis:       egcs's "-O2" optimization broken on "arm32"
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-arm32-maintainer (NetBSD/arm32 Portmaster)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 14 09:05:00 1999
>Last-Modified:
>Originator:     Matthias Scheler
>Organization:
Matthias Scheler                                http://home.owl.de/~tron/
>Release:        1999-03-13
>Environment:
NetBSD xena.owl.de 1.3K NetBSD 1.3K (XENA) #1: Sun Mar 14 11:38:29 MET 1999     tron@xena.owl.de:/src/sys/compile/XENA arm32

>Description:
While trying to build the "ImageMagick" package "egcs" died with an
internal compiler error:

===>  Building for ImageMagick-4.2.1
[...]
making all in ./magick...
rm -f encode.o unshared/encode.o
gcc -c  -I../magick  -DHasLZW -DHasShape -DHasSharedMemory   -DRGBColorDatabase=\"/usr/X11R6/lib/X11/rgb.txt\"  -DHasBZLIB -I../bzlib            -DHasJPEG   -I/usr/pkg/include -DHasPNG -I/usr/pkg/include -DHasTIFF   -I/usr/pkg/include   -DHasZLIB     -DDelegatePath=\"/usr/X11R6/share/ImageMagick/\"  -I/usr/X11R6/include   -DCSRG_BASED   -DFUNCPROTO=15 -DNARROWPROTO   -O2  encode.c -o unshared/encode.o
encode.c: In function `WriteTIFFImage':
encode.c:12117: internal error--unrecognizable insn:
(insn 4743 4741 4745 (set (mem:QI (plus:SI (plus:SI (reg:SI 5 r5)
                    (reg:SI 3 r3))
                (const_int 1)))
        (subreg:QI (reg:SI 9 r9) 0)) -1 (insn_list 4741 (insn_list 4737 (insn_list 4538 (nil))))
    (nil))
/src/NetBSD-current/src/gnu/usr.bin/egcs/common/../../../dist/gcc/toplev.c:1360: Internal compiler error in function fatal_insn
*** Error code 1

With optimization level reduced to "-O" the source can be compiled.
However, because "-O2" is the default for "arm32" in "sys.mk" this bug
should really be fixed.

>How-To-Repeat:
cd /usr/pkgsrc/graphics/ImageMagick
make

>Fix:
Sorry, I don't now.

>Audit-Trail:
>Unformatted: