This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/49644] [4.5/4.6 Regression] post-increment of promoted operand is incorrect.
- From: "orion at cora dot nwra.com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 5 Jul 2011 20:02:18 +0000
- Subject: [Bug c/49644] [4.5/4.6 Regression] post-increment of promoted operand is incorrect.
- Auto-submitted: auto-generated
- References: <bug-49644-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49644
--- Comment #4 from Orion Poplawski <orion at cora dot nwra.com> 2011-07-05 20:01:27 UTC ---
Yeah, I screwed that up. But it doesn't make any difference to the problem.
This should be correct though.
#include <stdio.h>
#include <complex.h>
int main(int argc, char *argv[]) {
double data[6] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0},*d;
double complex ddata[6], *c, s = 3.0;
int i;
d=data;
c=ddata;
for (i = 0; i<6; i++) {
printf("c(%p), d(%p)=%f\n",c,d,*d);
*c++ = *d++ * s;
}
return 0;
}