public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c/4065: Field out of range. (Big switch causes compilation failure)
@ 2001-08-20 10:26 bruno
  0 siblings, 0 replies; only message in thread
From: bruno @ 2001-08-20 10:26 UTC (permalink / raw)
  To: gcc-gnats; +Cc: djob

>Number:         4065
>Category:       c
>Synopsis:       Field out of range. (Big switch causes compilation failure)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 20 10:26:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     bruno@fc.hp.com
>Release:        gcc 2.95.2, gcc 3.0
>Organization:
>Environment:
HP-UX 10.20
>Description:
We get an assembler error of the form
Error: Field out of range [-262144..262143] (640184)
>From the gas sources this is due to a branch offset
being too large.
It looks like the compiler tries to generate too big a
branch offset in a big switch (or large function ?)
>How-To-Repeat:
Compile and run the attached program. This generates a
C source code with a switch that has n cases, n being the
argument you gave to the attached program.
Redirect the output to a file (say t.c) and compile t.c
Both gcc and g++ fail.
n=10000 causes the error message.
n=7000 causes a different error.

We found the bug on a Bison generated file.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="doit.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="doit.c"

I2luY2x1ZGUgPHN0ZGxpYi5oPgojaW5jbHVkZSA8c3RkaW8uaD4KCm1haW4oaW50IGFyZ2MsIGNo
YXIgKmFyZ3ZbXSkKewogICAgaW50IGk7CiAgICAKICAgIGlmKGFyZ2MgPCAyKQogICAgewoJZnBy
aW50ZihzdGRlcnIsICJ1c2FnZTogJXMgbnVtXG4iLCBhcmd2WzBdKTsKCWV4aXQoMSk7CiAgICB9
CgogICAgcHJpbnRmKCIjaW5jbHVkZSA8c3RkaW8uaD5cbiIpOwogICAgcHJpbnRmKCJtYWluKGlu
dCBhcmdjLCBjaGFyICphcmd2W10pXG4iKTsKICAgIHByaW50ZigieyIpOwogICAgcHJpbnRmKCIg
ICBpbnQgaTtcbiIpOwogICAgcHJpbnRmKCJzd2l0Y2goaSlcbntcbiIpOwoKICAgIGZvcihpID0g
MDsgaSA8IGF0b2koYXJndlsxXSk7IGkrKykKICAgIHsKCXByaW50ZigiY2FzZSAlZDoge1xuIiwg
aSk7CglwcmludGYoImlmKCVkICUgMikgcHJpbnRmKFwiaSBpcyBvZGRcXG5cIik7IiwgaSk7Cglw
cmludGYoIlxuZWxzZSBwcmludGYoXCJpIGlzIGV2ZW5cXG5cIik7Iik7CglwcmludGYoImJyZWFr
O1xufVxuIik7CiAgICB9CiAgICBwcmludGYoIn1cbn1cbiIpOwp9Cg==


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-08-20 10:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-20 10:26 c/4065: Field out of range. (Big switch causes compilation failure) bruno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).