public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/36438]  New: gcc ICE compiling code with mmx builtin
@ 2008-06-05  6:37 davidxl at gcc dot gnu dot org
  2008-06-05  6:42 ` [Bug rtl-optimization/36438] " davidxl at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: davidxl at gcc dot gnu dot org @ 2008-06-05  6:37 UTC (permalink / raw)
  To: gcc-bugs

Compiling the following code with latest compiler, got ice:

f.i: In function 'void foo(int __vector__*, int)':
f.i:33: internal compiler error: in trunc_int_for_mode, at explow.c:55
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


// f.i:
typedef unsigned short int16;
typedef int __m64 __attribute__ ((__vector_size__ (8), __may_alias__));
typedef long long __v1di __attribute__ ((__vector_size__ (8)));

extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__,
__artificial__))
_mm_slli_si64 (__m64 __m, int __count)
{
  return (__m64) __builtin_ia32_psllqi ((__v1di)__m, __count);
}

extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__,
__artificial__))
_mm_set_pi16 (short __w3, short __w2, short __w1, short __w0)
{
  return (__m64) __builtin_ia32_vec_init_v4hi (__w0, __w1, __w2, __w3);
}

inline __m64 __attribute__((__always_inline__)) SetS16(int16 a, int16 b, int16
c, int16 d) {
  return _mm_set_pi16(d, c, b, a);
}

void foo(__m64* dest, int n) {

  __m64 mask = SetS16(0x00FF, 0xFF00, 0x0000, 0x00FF);
  for ( int i = 0 ; i < n; ++i ) {

    mask = _mm_slli_si64(mask, 8);
    mask = _mm_slli_si64(mask, 8);

    *dest = mask;
    ++dest;
  }
  __builtin_ia32_emms ();
}


-- 
           Summary: gcc ICE compiling code with mmx builtin
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: davidxl at gcc dot gnu dot org


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


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

end of thread, other threads:[~2008-11-14  8:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-05  6:37 [Bug rtl-optimization/36438] New: gcc ICE compiling code with mmx builtin davidxl at gcc dot gnu dot org
2008-06-05  6:42 ` [Bug rtl-optimization/36438] " davidxl at gcc dot gnu dot org
2008-06-05 11:22 ` ubizjak at gmail dot com
2008-06-05 11:54 ` ubizjak at gmail dot com
2008-06-05 12:51 ` ubizjak at gmail dot com
2008-06-05 17:06 ` ubizjak at gmail dot com
2008-06-05 17:38 ` davidxl at gcc dot gnu dot org
2008-06-06 15:07 ` uros at gcc dot gnu dot org
2008-06-06 15:09 ` ubizjak at gmail dot com
2008-11-13 22:43 ` uros at gcc dot gnu dot org
2008-11-14  8:02 ` uros 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).