This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Tree generation bug or a feature?
- To: gcc at gcc dot gnu dot org
- Subject: Tree generation bug or a feature?
- From: Yuri Pudgorodsky <yur at asplinux dot ru>
- Date: Wed, 24 May 2000 16:48:47 +0400
- Organization: SW
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