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]

Re: Experiencing unreproducible internal compiler errors <<whinge>>


To explain this logically:

A program cannot execute differently if given exactly the same inputs in
exactly the same conditions. This is by definition.

A program may alter its inputs, without the user knowing, thus altering
it's behaviour in future runs. GCC does not do this (i.e., it doesn't
change configuration over runs).

Therefore, assuming all runs of GCC had exactly the same input files, the
same options and GCC had the same configuration, but behaved differently
in different cases, then the conditions must have altered (or altered
themselves).

The conditions being:

 - The hardware
 - The operating system (including drivers)
 - The parent processes of GCC

The hardware and operating system are continual conditions - that is, it
is virtually impossible that they will be in exactly the same state all
the time. Both are 'running', and thus change state. We can assume that
the parent processes of GCC (i.e., 'make', the shell, and so on) are in
the same state, and can safely eliminate them, I believe.

This only leaves the hardware and the OS - everything else is constant (or
as near to constant as makes no difference).

The conclusion is that something in the hardware or the operating system
MUST be changing state in such a way that causes GCC to operate
differently when given the same inputs - because GCC cannot and will not
do this itself.

To over-simplify, if you created a program that simply added two numbers
together, and 99% of the time it produced the same (correct) output, and
1% of the time it produced different output, you'd conclude (rightly) that
the program is not at fault - programs cannot be random. 

What you're trying to say is that 2+2 can sometimes be 4 and sometimes be
5, for no reason at all, other than a 'bug' in the calculation. We both
know that 2+2 /is/ 4, and if 2+2 suddenly becomes 5, then the
interpretation (i.e., the conditions - hardware and operating system) have
changed - which is an outside factor. The calculation hasn't changed, so
something outside of it must have caused the output to be different.

I hope that was at least understandable :)

-- 
Mo McKinlay                                T: +44 (0) 709 22 55 05  x1
Chief Software Architect                   F: +44 (0) 709 22 55 05  x3
inter/open                                 E: mmckinlay@labs.interopen.org
A division of Bekon Marketing Limited      W: http://www.interopen.org


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