This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
FollowUp: Strange bug in GCC-Optimization
- To: gcc-bugs at gcc dot gnu dot org
- Subject: FollowUp: Strange bug in GCC-Optimization
- From: Norbert Nemec <nobbi at gnu dot org>
- Date: Mon, 24 Jul 2000 08:27:23 +0200
- References: <20000724002724.A19412@cheerful.com>
- Reply-To: Norbert Nemec <nobbi at gnu dot org>
On Mon, Jul 24, 2000 at 12:27:24AM +0200, I myself wrote:
> it seems like I have found a bug, but a proper report would need quite a bit
> of work, so I want to ask first:
[...]
I thought about it some more in the meantime, and I found that it should not
be that difficult for you to reproduce the error if I explain exactly what
to do. May be some work, but since I assume you are interested in finding
the bug, I hope somebody who has the knowledge about gcc-internals will take
the time to go through it. Here are the steps to take:
1. Download ftp://ftp.gnu.org/gnu/sather/sather-1.2.1.tar.gz - unpack it
somewhere.
2. Add the -g flag to CFLAGS=... in Boot/sacomp.code/Makefile and
.../COMPILE_OPTIONS
3. Call make in the top directory. Wait...
First, after some configuration, you will see a long list of C files
being compile (The bootstrap Sather compiler)
Lateron, the created program Boot/sacomp will be called to compile the
original Sather code for the Sather compiler to ANSI-C.
This program should now segfault after a few lines of output. If it does
not, the bug has obviously already been fixed in your gcc. In that case,
you are done, and I would just like to know about it.
4. If it dies, you would probably best call the program in the gdb. Take
care to set the env-variable SATHER_HOME to the top directory of the
distribution (absolute path, no trailing / ) - the command line should be
copied from the one you find in the make output.
5. You will now find the offending routine in:
File: Boot/sacomp.code/configCONFIG_R422014871.c
Line: 802
Routine: CONFIG1467324007
Catch the second time, this routine is called during execution of the
program.
In line 852, this routine does start into a while(1) loop. This loop
should run through twice, but it does so only once. "L91_br" is initially
set to 2, "L21" is the loop counter that is incremented by one in each
loop. For some reason, though, the code generated by the gcc does
increment it by two!
6. In case you want to compile the C-code outside the make script, take care
to copy the file System/Platforms/linux/header.h to
System/Platforms/BOOT/header.h (usually done in the configuration part of
the Makefiles)
I hope this guide was clear enough to follow it. In case you have any more
questions, it would be good to write back ASAP, since I will be on vacations
for one month starting the day after tomorrow... :-(
Ciao,
Nobbi
PS: I have now also found a workaround for our project, but I guess it would
still be good to fix this bug. :-)
--
-- ______________________________________________________
-- JESUS CHRIST IS LORD!
-- To Him, even that machine here has to obey...
--
-- _________________________________Norbert "Nobbi" Nemec
-- Hindenburgstr. 44 ... D-91054 Erlangen ... Germany
-- eMail: <nobbi@cheerful.com> Tel: +49-(0)-9131-204180