Re: Egcs 1.0.3 & Linux

Khimenko Victor (khim@sch57.msk.ru)
Sun, 17 May 1998 21:37:50 +0400 (MSD)


17-May-98 11:04 you wrote:
> Now... When you get in a situation like this... "Gee, I compiled
> it with foo 1 and it works. When I compile it with foo 2 it's busted. When
> I compile it with bar 1 it's busted". Is it the compilers or is it the
> source code. Well... It depends. I would argue this though - even if it
> is a bug in the source code, the fact that some compilers generated incorrect
> code from that source without flagging an error, it indicates some sort of
> bug in the compilers. They should either generate correct code or generate
> an error. They should not generate incorrected code. But I've been working
> with compilers since the 70's. They will be singing Jingle Bells in Hades
> before we get to that day.
>
Unfortunatelly "bug in source code" is VERY VERY week conception. Simple example:

#include <stdio.h>
int a=0;
int f(void) { a=1;return 1; }
void main(void) { printf("%d",f()+a); }

Of course this code contains nasty bug and two compilers could generate two
programs with different behaviour -- one will write 1 and other will write 2.
I am know no copilers who will write error for such program (especially if
a will be in one file while main() will be in second file). This is VERY simple
example. So ... You are wrong. Even if code will not generate error and will
work just fine while compiled with one compiler WITHOUT BUGS (in fact most
compilers contains bugs but this is other story) could still does not work
while compiled with other compiler WITHOUT BUGS! So you are wrong here: even
if code is compiled bu compiler without bugs and works just fine still does
not mean that code does not contains bugs! And looks like it's possible to
prove that you could not write program able to catch all such bugs (this is
not trivial task, unfortunatelly) ! Really this is exactly situation with egcs
and kernel -- there are few known (and god knows how many unknown :-) places
where egcs will generate wrong code since source code contans bugs like
bug above... Most of them is cleaned out in 2.1.102 but noone knows -- how
many still left there :-(( By the way I am using pgcc 1.0.2 for all compilations
(including kernel, of course). I am not using 2.0.x kernels through ...

> > GCC 2.8.x has been out for some time, so has Egcs, it's strange that no one
> > has fixed the problems that plague compilation of Linux kernel.. probably
> > one of the most recompiled things on the planet.
>
> Maybe most of us are using earlier gcc's. RedHat 5.0 ships with
> gcc 2.7.2.3. I'm not inclined to go through the painful process of upgrading
> a compiler without a REAL GOOD reason and the discussions over gcc 2.8 and
> egcs are certainly good reasons not to.
>
Really MOST OF 2.1.10x works just fine with pgcc 1.0.2/egcs 1.0.3 (pgcc still
does not upgraded to 1.0.3). But there are a lot of code in kernel and some
code used REALLY rare :-((

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu