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]

Strange bug in GCC-Optimization


Hi there,

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:

On compiling the GNU Sather compiler, which consists of 13M computer
generated ANSI-C code, the GCC-compiler seems to generate plainly wrong
output if optimization is switched on in one tiny little routine. The
routine does not do anything special at all.

I would love to send you the offending code, but it is, as I said, machine
generated, and therefore extremely ugly, and I do not know, how I should
separate out the offending piece. It is something like:

-----------

b = a + 1;
call_routine(b);
a = a + 1;

-----------

Where for some reason a is incremented by 2 as soon as I switch on
optimization.

replacing the code by:

----------

call_routine(a + 1);
a = a + 1;

----------

solves the problem.

There is no tricks with references or anything like it at all.

Unfortunately, there is no simple workaround, since that would mean to
change something within the Sather compiler. Strangly enough, though, it
occurs only in one spot in the whole 13M of code! (Most of it looking very
similar.)

Do you have any ideas what to do?

I am using GCC 2.95.2 20000313 (from debian potato) but other newer gccs
are reported to cause the same problem.

Help would be appreciated very much.

Ciao,
Nobbi


-- 
-- ______________________________________________________
-- 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

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