bash-3.2$ cat /tmp/x.i 
typedef long long __m256i __attribute__ ((__vector_size__ (32),
__may_alias__));
__m256i
bar (__m256i x)
{
  return x;
}
bash-3.2$ gcc -S /tmp/x.i 

This is due to type_natural_mode doesn't check 32byte types. If I
add

--- ./i386.c.warn       2009-02-11 06:58:52.000000000 -0800
+++ ./i386.c    2009-02-11 18:03:30.000000000 -0800
@@ -4729,7 +4729,7 @@ type_natural_mode (const_tree type)
   if (TREE_CODE (type) == VECTOR_TYPE && !VECTOR_MODE_P (mode))
     {
       HOST_WIDE_INT size = int_size_in_bytes (type);
-      if ((size == 8 || size == 16)
+      if ((size == 8 || size == 16 || size == 32)
          /* ??? Generic code allows us to create width 1 vectors.  Ignore.  */
          && TYPE_VECTOR_SUBPARTS (type) > 1)
        {

I got

bash-3.2$ ./xgcc -B./ -O2 /tmp/x.i -S

/tmp/x.i: In function ‘bar’:
/tmp/x.i:3: warning: AVX vector argument without AVX enabled changes the ABI
/tmp/x.i:6: internal compiler error: in emit_move_multi_word, at expr.c:3317
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

emit_move_multi_word isn't prepared to deal with it.


-- 
           Summary: Gcc doesn't warn __m256 when -mavx isn't used
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hjl dot tools at gmail dot com


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

Reply via email to