public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/17934] New: gcc produces bad (misaligned?) sse2 code
@ 2004-10-11 16:11 terpstra at ito dot tu-darmstadt dot de
  2004-10-11 16:13 ` [Bug c/17934] " terpstra at ito dot tu-darmstadt dot de
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: terpstra at ito dot tu-darmstadt dot de @ 2004-10-11 16:11 UTC (permalink / raw)
  To: gcc-bugs

For whatever reason, the attached program, when compiled with the options
gcc-3.4 -msse2 -O0 test.c -o test
will crash. This is not the case if -O2 is specified or -march=i686.

However, I have a larger testcase (the program this came from) which will fail
regardless of optimization flags or -march. It seems that this problem only
happens when gcc is given complicated enough code.

A quick look at it with gdb shows:
Program received signal SIGSEGV, Segmentation fault.
0x080483b0 in _mm_srli_epi32 (__A={51539607552, 51539607564}, __B=31)
    at emmintrin.h:1261
1261    {
(gdb) up
#1  0x080483e3 in bar (x={4294967297, 4294967297}, y={4294967297, 4294967297})
    at test.c:8
8               return _mm_sub_epi32(x, _mm_srli_epi32(y, 31));
(gdb) print &x
$1 = (__v2di *) 0xbffffa00
(gdb) down
#0  0x080483b0 in _mm_srli_epi32 (__A={51539607552, 51539607564}, __B=31)
    at emmintrin.h:1261
1261    {
(gdb) print &__A
$2 = (__v2di *) 0xbffff9cc

This looks to me like the alignment has somehow gotten messed up.

-- 
           Summary: gcc produces bad (misaligned?) sse2 code
           Product: gcc
           Version: 3.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: terpstra at ito dot tu-darmstadt dot de
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i386-linux-gnu
  GCC host triplet: i386-linux-gnu
GCC target triplet: i386-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17934


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-10-11 17:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-11 16:11 [Bug c/17934] New: gcc produces bad (misaligned?) sse2 code terpstra at ito dot tu-darmstadt dot de
2004-10-11 16:13 ` [Bug c/17934] " terpstra at ito dot tu-darmstadt dot de
2004-10-11 16:17 ` terpstra at ito dot tu-darmstadt dot de
2004-10-11 17:09 ` pinskia at gcc dot gnu dot org
2004-10-11 17:22 ` terpstra at ito dot tu-darmstadt dot de
2004-10-11 17:26 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).