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]

Tree generation bug or a feature?


Hi!


With the following two statements, I supposed to get identical result:

x = 2;  y = ++x * ++x;
x = 2;  y = (x+=1) * (x+=1);

However, under gcc  ++x  variant  gives me 16 instead if 12,
as well as x++ * x++ incorrectly (I suppose) gives 4.


Digital C compiler from DU 4.0 show correct values:

++x * ++x = 12
(x+=1) * (x+=1) = 12

as well as gdb builtin C expression parser.


Sounds like a tree generation bug, isn't it?


Regards,
Yuri Pudgorodsky



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