public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/20122] New: Wrong code with gcc 4.0 tree-vectorizer
@ 2005-02-21 21:49 micis at gmx dot de
  2005-02-21 23:11 ` [Bug tree-optimization/20122] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: micis at gmx dot de @ 2005-02-21 21:49 UTC (permalink / raw)
  To: gcc-bugs

This small test program generates a segfault if it is compiled with:
gcc40 -march=opteron -O2 -ftree-vectorize gccbug.cpp -o gccbug

Segfault does not occur when __attribute__((noinline)) is omitted.
It occurs with snapshot 20050213 and snapshot 20050220,
but not with snapshot 20050130


Michael Cieslinski


==========================
#include <emmintrin.h>

static struct KStructType
{union{
    short         Kernshort[8][24];
    __m128i     KernSSE[8][3];
};} KU          __attribute__(( aligned(16) ));

static void VecBug(short Kernel[8][24]) __attribute__((noinline));
static void VecBug(short Kernel[8][24])
{
    for (int k = 0; k<8; k++)
        for (int i = 0; i<24; i++)
            KU.Kernshort[k][i] = Kernel[k][i];
}

int main (int argc, char **argv)
{
    short Kernel[8][24];
    for (int k = 0; k<8; k++)
        for (int i = 0; i<24; i++)
            Kernel[k][i] = 0;

    VecBug(Kernel);

    return 0;
}

-- 
           Summary: Wrong code with gcc 4.0 tree-vectorizer
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: micis at gmx dot de
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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


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

end of thread, other threads:[~2005-05-02 12:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-21 21:49 [Bug tree-optimization/20122] New: Wrong code with gcc 4.0 tree-vectorizer micis at gmx dot de
2005-02-21 23:11 ` [Bug tree-optimization/20122] " pinskia at gcc dot gnu dot org
2005-02-24 16:15 ` irar at il dot ibm dot com
2005-03-02 10:28 ` micis at gmx dot de
2005-03-02 11:43 ` giovannibajo at libero dot it
2005-03-02 12:44 ` irar at il dot ibm dot com
2005-03-02 12:46 ` irar at il dot ibm dot com
2005-03-03 10:44 ` micis at gmx dot de
2005-05-02 11:58 ` micis at gmx dot de
2005-05-02 12:01 ` 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).