This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15795] Strange bug / incorrect code generation with SSE
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Jun 2004 17:33:45 -0000
- Subject: [Bug c++/15795] Strange bug / incorrect code generation with SSE
- References: <20040603143635.15795.ma1flfs@bath.ac.uk>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2004-06-03 17:33 -------
Andrew, though you may be right, gcc's behavior doesn't make much sense.
The compiler knows the alignment requirements of such objects, and if it
does not satisfy them in any way, then we can't say we support them since
there is no way (except for using stack variables) in which one can write
code that actually works.
There must be some way, at least with using operator new, to allocate
this space with the alignment requirements of such types.
I'd like either Jan or one of the people with knowledge of the interface
between C++ and libstdc++'s implementation of operator new to comment
on this.
In short, for latecomers: this program segfaults:
----------------
#include <xmmintrin.h>
int main() {
__m128 * foo = new __m128;
*foo = _mm_setzero_ps();
}
----------------
Andrew claims that it is because of the pointer returned by malloc doesn't
satisfy the alignment criteria for this data type.
W.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |bkoz at gcc dot gnu dot org,
| |jason at gcc dot gnu dot
| |org, nathan at gcc dot gnu
| |dot org, hubicka at gcc dot
| |gnu dot org
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15795