This is the mail archive of the gcc@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: /internet



> There has been general agreement that gcc is not supposed to make
> optimizations that could change the value of an expression.
> Associative law optimizations of floating-point expressions certainly
> can change the value and they should continue to be disallowed.  Users
> should not have to fear that gcc is going to take arbitrary liberties
> and rewrite their programs for them without very explicit permission.

If I understand correctly, Jeff's proposal was to respect ordering when
the user provides parentheses, but to leave the compiler free to do
reordering when the user does not provide parentheses.

That is, for

	y = a * b * c * d;

the compiler could do the multiplications in any order, but for

	y = a * (b * (c * d));

the compiler is forced to follow the specified order.

I believe that this is consistent with what the relevant language standards
specify.




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