Supporting 'MAC' instruction on gcc v4.1.1

Andrew Haley aph-gcc@littlepinkcloud.COM
Fri May 11 15:32:00 GMT 2007


Geert Bosch writes:
 > 
 > On May 11, 2007, at 08:26, Rahul wrote:
 > > But for the following example
 > >  int a = 1;
 > >  int b = 2;
 > >  int c = 3;
 > >  c = c + a * b;
 > > the MAC pattern is not getting recognized, instead it is still using
 > > PLUS and MULT patterns.
 > 
 > In general, this transformation is not valid, as it has
 > different rounding behavior from the expression with the
 > + and * operations.

It shouldn't have.  All args are ints, and if we are assuming (as the
C standard says) that int overflow is undefined, the transformation is
valid.

Andrew.



More information about the Gcc mailing list