c/3685: gcc-2.96 fails with -O3 on perl-5.7.2

hv@crypt0.demon.co.uk hv@crypt0.demon.co.uk
Fri Jul 13 21:16:00 GMT 2001


>Number:         3685
>Category:       c
>Synopsis:       gcc-2.96 fails with -O3 on perl-5.7.2
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jul 13 21:16:02 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Hugo van der Sanden
>Release:        gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-81)
>Organization:
>Environment:

>Description:
Repeatable below is derived from an attempt to compile perl-5.7.2 on a (fundamentally) stock RedHat 7.1 system using:
  ./Configure -des -Dprefix=/opt/perl-5.7.2.64bit -Doptimize='-g -O3' -Dusedevel -Uversiononly -Duse64bitint && make test

Problem does not occur if -O3 is replaced with -O2. Error shown is:
zz.i: In function `PerlIORaw_pushed':
zz.i:38: Unrecognizable insn:
(insn/i 83 82 85 (set (reg:SI 64)
        (mem/s:SI (plus:SI (mult:SI (subreg:SI (reg:DI 55) 0)
                    (const_int 4 [0x4]))
                (reg:SI 62)) 8)) -1 (insn_list 82 (nil))
    (expr_list:REG_DEAD (reg:DI 55)
        (expr_list:REG_DEAD (reg:SI 62)
            (nil))))
zz.i:38: confused by earlier errors, bailing out

Since many users of gcc-2.96 will attempt to compile perl, it would be useful to have a workaround for this problem. When compiling perl-5.7.2 on a stock RedHat-7.1 using this invocation:
  ./Configure -des -Dprefix=/opt/perl-5.7.2.64bit -Doptimize='-g -O3' -Dusedevel -Uversiononly -Duse64bitint && make test
.. I see this:
  `sh  cflags libperl.a perlio.o`  perlio.c
          CCCMD =  cc -DPERL_CORE -c -Wall -DDEBUGGING -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O3 
perlio.c: In function `PerlIORaw_pushed':
perlio.c:905: Unrecognizable insn:
(insn/i 248 247 249 (set (reg:SI 85)
        (mem/s:SI (plus:SI (mult:SI (subreg:SI (reg:DI 78) 0)
                    (const_int 8 [0x8]))
                (reg:SI 84)) 0)) -1 (insn_list 247 (nil))
    (expr_list:REG_DEAD (reg:SI 84)
        (nil)))
perlio.c:905: confused by earlier errors, bailing out
make: *** [perlio.o] Error 1

Not yet tested with gcc 3.xx.
>How-To-Repeat:
Save the attachment as zz.i; invoke: gcc -o perlio.o -c -g -O3 zz.i
>Fix:
Unknown
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="zz.i"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="zz.i"

c3RydWN0IFBlcmxJT19wYWlyX3QgeyB2b2lkICpmdW5jczsgfTsKc3RydWN0IF9QZXJsSU87CnN0
cnVjdCBfUGVybElPIHsgc3RydWN0IF9QZXJsSU8gKiBuZXh0OyB9OwpzdHJ1Y3QgUGVybElPX2xp
c3RfdCB7IHN0cnVjdCBQZXJsSU9fcGFpcl90ICphcnJheTsgfTsKZXh0ZXJuIHZvaWQgUGVybElP
X3N0ZGlvOwpzdHJ1Y3QgUGVybElPX2xpc3RfdCAqIFBlcmxJT19kZWZhdWx0X2xheWVycyh2b2lk
KTsKCnZvaWQgKgpQZXJsSU9fbGF5ZXJfZmV0Y2goIHN0cnVjdCBQZXJsSU9fbGlzdF90ICphdixs
b25nIGxvbmcgbix2b2lkICpkZWYpCnsKICAgIGlmIChuID49IDAgJiYgbiA8ICoobG9uZyBsb25n
ICopMCkKCXJldHVybiBhdi0+YXJyYXlbbl0uZnVuY3M7CiAgICBpZiAoIWRlZikKCVBlcmxfY3Jv
YWsoInBhbmljOiBQZXJsSU8gbGF5ZXIgYXJyYXkgY29ycnVwdCIpOwogICAgcmV0dXJuIGRlZjsK
fQoKdm9pZCAqClBlcmxJT19kZWZhdWx0X2xheWVyKCBsb25nIG4pCnsKICAgIHN0cnVjdCBQZXJs
SU9fbGlzdF90ICphdiA9IFBlcmxJT19kZWZhdWx0X2xheWVycygpOwogICAgaWYgKG4gPCAwKQoJ
biArPSAqKGxvbmcgbG9uZyAqKTA7CiAgICByZXR1cm4gUGVybElPX2xheWVyX2ZldGNoKGF2LCBu
LCAmUGVybElPX3N0ZGlvKTsKfQoKbG9uZyBsb25nClBlcmxJT1Jhd19wdXNoZWQoc3RydWN0IF9Q
ZXJsSU8gKiAqZikgewogICAgd2hpbGUgKCEoKihsb25nIGxvbmcgKikwICYgMSkpIHsKCWlmICgq
KCYoKCooZikpLT5uZXh0KSkpCgkgICAgOwoJZWxzZSBpZiAoUGVybElPX3B1c2goZiwgUGVybElP
X2RlZmF1bHRfbGF5ZXIoMCkpKQoJICAgIDsKCWJyZWFrOwogICAgfQogICAgcmV0dXJuIDA7Cn0K



More information about the Gcc-bugs mailing list