This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
optimization/5878: gcc 3.1 breaks on C code generated by the Mercury compiler
- From: Fergus Henderson <fjh at cs dot mu dot oz dot au>
- To: gcc-gnats at gcc dot gnu dot org
- Cc: mercury-bugs at cs dot mu dot oz dot au
- Date: 8 Mar 2002 03:26:10 -0000
- Subject: optimization/5878: gcc 3.1 breaks on C code generated by the Mercury compiler
- Reply-to: Fergus Henderson <fjh at cs dot mu dot oz dot au>
>Number: 5878
>Category: optimization
>Synopsis: gcc 3.1 breaks on C code generated by the Mercury compiler
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: unassigned
>State: open
>Class: ice-on-legal-code
>Submitter-Id: net
>Arrival-Date: Thu Mar 07 19:36:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Fergus Henderson <fjh@cs.mu.oz.au>
>Release: 3.1 20020304 (prerelease)
>Organization:
>Environment:
Reading specs from /tmp/fjh/install/lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
Configured with: configure --prefix=/tmp/fjh/install
Thread model: single
gcc version 3.1 20020304 (prerelease)
>Description:
gcc 3.1 gets an internal error when compiling the attached
file with optimization enabled.
This is a regression from gcc 2.95.3.
The output is:
bash$ gcc -O mercury-gcc3.1.c
mercury-gcc3.1.c: In function `f':
mercury-gcc3.1.c:22: Internal compiler error in verify_local_live_at_start, at flow.c:606
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
>How-To-Repeat:
Compile the attached file with `gcc -c -O',
e.g. `gcc -c -O bug.c'.
void *dummy (void *);
register void *reg __asm__ ("ebx");
void
f (void)
{
goto *dummy (&&foo);
for (;;)
{
foo:
(reg) = (void *) 1;
if (!reg)
goto baz;
reg = (&&bar);
}
bar:
baz:
reg = 0;
}
>Fix:
A work-around is to compile without `-O'.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="mercury-gcc3.1.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="mercury-gcc3.1.c"
dm9pZCAqZHVtbXkgKHZvaWQgKik7CnJlZ2lzdGVyIHZvaWQgKnJlZyBfX2FzbV9fICgiZWJ4Iik7
Cgp2b2lkCmYgKHZvaWQpCnsKICBnb3RvICpkdW1teSAoJiZmb28pOwogIGZvciAoOzspCiAgICB7
CiAgICBmb286CiAgICAgIChyZWcpID0gKHZvaWQgKikgMTsKCiAgICAgIGlmICghcmVnKQoJZ290
byBiYXo7CgogICAgICByZWcgPSAoJiZiYXIpOwogICAgfQoKYmFyOgpiYXo6CiAgcmVnID0gMDsK
fQo=