This is the mail archive of the
mailing list for the GCC project.
Re: numerical instability and estimate-probability
> On Nov 15, 2001, Richard Henderson <firstname.lastname@example.org> wrote:
> > On Thu, Nov 15, 2001 at 11:31:52AM -0800, mike stump wrote:
> >> It is advantageous to have gcc emit the same code, on different hosts
> >> for the same source code. This currently works.
> > No, it doesn't. We have code that is affected by the undefined
> > order of evaluation of function arguments. E.g.
> > foo (gen_reg_rtx (...), gen_reg_rtx (...))
> Err... I seem to remember having read somewhere, perhaps in the GCC
> manual, that it would evaluate arguments in the same order, despite
> the freedom granted by the standards, even though no sequence point
> would be introduced between the evaluation of the arguments. This,
> plus the fact that cross compilers are only supported when the
> bootstrap compiler is GCC, means the case above would always generate
> the same code. Is my recollection wrong, or no longer true?
SUrely for i386 comilation gcc evaulates arguments in "natural" order
w/o optimizing and reverse order with optimizing.
It is dificult to avoid this w/o loosing code quality as for instance
arguments passed in registers should be evaulated last.