This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

optimization/7810: "gcc-3.2 -Wall -funroll-loops -mcpu=k6 -O1 -c bug.c" causes ICE in extract_insn


>Number:         7810
>Category:       optimization
>Synopsis:       "gcc-3.2 -Wall -funroll-loops -mcpu=k6  -O1 -c bug.c" causes ICE in extract_insn
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 02 08:56:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     bunk@fs.tum.de
>Release:        3.2
>Organization:
>Environment:
Debian unstable on Linux/i386
>Description:
$ gcc -Wall -funroll-loops  -mcpu=k6  -O1   -c bug.c
bug.c: In function `seq_write':
bug.c:196: unrecognizable insn:
(insn 698 720 702 (set (reg:SI 210)
        (neg:SI (reg/v:SI 61))) -1 (nil)
    (nil))
bug.c:196: Internal compiler error in extract_insn, at recog.c:2148
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
$ 


It compiles as soon as I remove _one_ of the following options:
  -funroll-loops
  -mcpu=k6
  -O1

The file bug.c is a stripped down version (some things removed and some definitions copied from header files) 
of the file import/seqinfo.c in (the GPL'ed) transcode-0.6.0 
(http://www.theorie.physik.uni-goettingen.de/~ostreich/transcode).

The bug is reproducible with the following compilers:

Debian unstable:

Reading specs from /usr/lib/gcc-lib/i386-linux/3.2.1/specs
Configured with: /mnt/data/gcc-3.1/gcc-3.2-3.2.1ds0/src/configure -v --enable-languages=c,c++,java,f77,proto,objc,ada --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-java-gc=boehm --enable-objc-gc i386-linux
Thread model: posix
gcc version 3.2.1 20020830 (Debian prerelease)


self-compiled:

Reading specs from ./gcc-3.2/bin/../lib/gcc-lib/i586-pc-linux-gnu/3.2/specs
Configured with: ../configure --enable-languages=c --prefix=/tmp/gcc-3.2
Thread model: posix
gcc version 3.2
>How-To-Repeat:
gcc -Wall -funroll-loops  -mcpu=k6  -O1   -c bug.c
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-csrc; name="bug.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="bug.c"

CiNpbmNsdWRlIDxzdGRpby5oPgoKc3RhdGljIGludCB2ZXJib3NlOwoKc3RhdGljIGRvdWJsZSBm
cHM7CnN0YXRpYyBpbnQgdmVyYm9zZTsKc3RhdGljIGludCBkcm9wX2N0cj0wOwoKCnN0YXRpYyBs
b25nIGZyYW1lX2N0cj0wOwpzdGF0aWMgbG9uZyBjaGVja19jdHI9MDsKCnR5cGVkZWYgc3RydWN0
IHN5bmNfaW5mb19zIHsKCiAgbG9uZyBpbnQgZW5jX2ZyYW1lOwogIGxvbmcgaW50IGFkal9mcmFt
ZTsKICAKICBsb25nIGludCBzZXF1ZW5jZTsKCiAgZG91YmxlIGRlY19mcHM7CiAgZG91YmxlIGVu
Y19mcHM7CgogIGRvdWJsZSBwdHM7CgogIGludCBwdWxsZG93bjsKICBpbnQgZHJvcF9zZXE7CiAg
Cn0gc3luY19pbmZvX3Q7Cgp0eXBlZGVmIHN0cnVjdCBzZXFfbGlzdF9zIHsKCiAgaW50IGlkOyAg
ICAgICAgICAvL3NlcXVlbmNlIGlkCiAgaW50IHRhZzsgIAoKICBpbnQgc3RhdHVzOwoKICBsb25n
IHB0czsgICAgICAgIC8vc2VxdWVuY2UgcHRzCiAgbG9uZyBkdHM7ICAgICAgICAvL3NlcXVlbmNl
IGR0cwoKICBpbnQgZW5jX3BpY3M7ICAgIC8vZW5jb2RlZCBmcmFtZXMgIAogIGludCBzZ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cHJpbnRmKHN0ZGVyciwiKCVzKSBzeW5jIGRhdGEgZm9y
IHNlcXVlbmNlICVkIGZsdXNoZWQgWyVsZF1cbiIsIF9fRklMRV9fLCBwdHItPmlkLCBzeW5jX2lu
Zm8uZW5jX2ZyYW1lKTsKICB9CgogIGlmKHZlcmJvc2UgJiAyNTYpIHsKICAgICAgZnByaW50Zihz
dGRlcnIsICJmcmFtZXM9JTZsZCBzZXE9JTRsZCBhZGo9JTRkIEFWPSU4LjRmIFtmcHNdIHJhdGlv
PSAlLjRmIFBUUz0gJS4yZlxuIiwgc3luY19pbmZvLmVuY19mcmFtZSwgc3luY19pbmZvLnNlcXVl
bmNlLCBkcm9wX2N0ciwgc3luY19pbmZvLmRlY19mcHMtZnBzLCBzeW5jX2luZm8uZW5jX2Zwcy9m
cHMsIHN5bmNfaW5mby5wdHMpOwogIH0KICAKICByZXR1cm47Cgp9CgoK


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]