This is the mail archive of the gcc-bugs@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/7339: ICE on simple code with GCC 3.1


>Number:         7339
>Category:       optimization
>Synopsis:       ICE on simple code with GCC 3.1
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          ice-on-illegal-code
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 17 07:36:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Jack Lloyd
>Release:        GCC 3.1
>Organization:
>Environment:
RedHat Linux 7.3 on an Athlon.

$ g++ -v
Reading specs from /usr/local/gcc-3.1/lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
Configured with: ../gcc-3.1/configure --prefix=/usr/local/gcc-3.1 --enable-threads
Thread model: posix
gcc version 3.1
>Description:
ICE on illegal code (it shifts 16 bit values >> 32). It only occurs with optimization. I haven't checked with 3.1.1 snapshots or HEAD.

The attached code will compile with GCC 3.0.4 (with and without optimization).

I'm compiling with g++ but I don't think there is anything C++-centric about the ICE.
>How-To-Repeat:
Compile the attached file with -O (or higher) with GCC 3.1

Here is what I get:

$ g++ -O x.cpp
x.cpp: In function `bool bigint_divcore(short unsigned int, short unsigned int, 
   short unsigned int, short unsigned int, short unsigned int, short unsigned 
   int)':
x.cpp:26: warning: right shift count >= width of type
x.cpp:28: warning: right shift count >= width of type
x.cpp:37: Internal compiler error in simplify_subreg, at simplify-rtx.c:2452
Please submit a full bug report [...]
>Fix:
None known (except the obvious of compiling without optimization, or fixing the code).
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="x.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="x.cpp"

LyoKICBXaXRoIEdDQyAzLjEgYW5kIC1PLCB0aGlzIGNvZGUgd2lsbCBkaWUgd2l0aCBhbiBpb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IE1QX1dPUkRfTUFYKTsK
ICAgd29yZCBsYXN0ID0gKHByb2R1Y3QgPj4gU0hJRlQpICYgTVBfV09SRF9NQVg7CgogICBpZihs
YXN0ID4geDEpIHJldHVybiB0cnVlOwogICBpZihsYXN0IDwgeDEpIHJldHVybiBmYWxzZTsKICAg
aWYoeV8xID4geDIpIHJldHVybiB0cnVlOwogICBpZih5XzEgPCB4MikgcmV0dXJuIGZhbHNlOwog
ICBpZih5XzIgPiB4MykgcmV0dXJuIHRydWU7CiAgIGlmKHlfMiA8IHgzKSByZXR1cm4gZmFsc2U7
CiAgIHJldHVybiBmYWxzZTsKICAgfQo=


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