This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/49933] New: float pointer postincrement during complex calculations increments twice
- From: "michael.pippig at mathematik dot tu-chemnitz.de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 1 Aug 2011 13:57:45 +0000
- Subject: [Bug c/49933] New: float pointer postincrement during complex calculations increments twice
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49933
Summary: float pointer postincrement during complex
calculations increments twice
Product: gcc
Version: 4.6.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: michael.pippig@mathematik.tu-chemnitz.de
Created attachment 24882
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24882
Multiply complex array with float array. Use pointer postincrement ++ to go
through the float array.
The postincrement operator of float pointers is evaluated twice, if it is used
during complex calculations, e.g., the simple multiplication of the complex
array c and the float array f in the way
# for(k=0;k<N;k++)
# c[k] *= (*f_ptr++);
results in
# for(k=0;k<N;k++)
# c[k] *= f_ptr[2*k];
instead of the expected result
# for(k=0;k<N;k++)
# c[k] *= f_ptr[k];
Ziel: x86_64-unknown-linux-gnu
Konfiguriert mit: ../gcc-4.6.1/configure
--prefix=/lustrefs/compiler/gcc-4.6/gcc-4.6.1
Thread-Modell: posix
gcc-Version 4.6.1 (GCC)