Commit 6aebac53 by Andrew Pinski Committed by Andrew Pinski

#define vector __attribute__((vector_size(16) )) struct struct1 { union { float a[3]...

#define vector __attribute__((vector_size(16) ))
struct struct1  {
  union { float a[3]; }    vmx;
  struct struct2   {
    struct2(const struct2& r) {}
  } w;
} __attribute__((aligned(16)));
struct struct3  {
  vector float vmx;
  operator const struct1& () const{
    return *reinterpret_cast<const struct1*>(this);
  }
};
struct3 func3( struct3 V1);
struct3 func2( void );
void func1( )  {
  struct1 vVec = func2() ;
  func3 ( (struct3&)vVec );
}

From-SVN: r139820
parent 617c394a
2008-08-30 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR middle-end/36444
* expmed.c (extract_bit_field_1): Check the mode size to make
sure the vector modes have the same size.
2008-08-29 Michael Meissner <gnu@the-meissners.org> 2008-08-29 Michael Meissner <gnu@the-meissners.org>
* dojump.c (top level): Include basic-block.h to declare * dojump.c (top level): Include basic-block.h to declare
......
...@@ -1204,7 +1204,7 @@ extract_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize, ...@@ -1204,7 +1204,7 @@ extract_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
for (; new_mode != VOIDmode ; new_mode = GET_MODE_WIDER_MODE (new_mode)) for (; new_mode != VOIDmode ; new_mode = GET_MODE_WIDER_MODE (new_mode))
if (GET_MODE_NUNITS (new_mode) == nunits if (GET_MODE_NUNITS (new_mode) == nunits
&& GET_MODE_INNER (new_mode) == tmode && GET_MODE_SIZE (new_mode) == GET_MODE_SIZE (GET_MODE (op0))
&& targetm.vector_mode_supported_p (new_mode)) && targetm.vector_mode_supported_p (new_mode))
break; break;
if (new_mode != VOIDmode) if (new_mode != VOIDmode)
......
2008-08-30 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR middle-end/36444
* g++.dg/torture/pr36444.C: New testcase.
* gcc.c-torture/compile/vector-4.c: New testcase.
2008-08-30 Jerry DeLisle <jvdelisle@gcc.gnu.org> 2008-08-30 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/36895 PR libfortran/36895
......
/* { dg-do compile } */
#define vector __attribute__((vector_size(16) ))
struct struct1 {
union {} vmx;
struct struct2 {
struct2(const struct2& r) {}
} w;
} __attribute__((aligned(16)));
struct struct3 {
vector float vmx;
operator const struct1& () const{
return *reinterpret_cast<const struct1*>(this);
}
};
struct3 func3( struct3 V1);
struct3 func2( void );
void func1( ) {
struct1 vVec = func2() ;
func3 ( (struct3&)vVec );
}
/* Make sure that vector of size 8 of signed char works. This used to crash with AVX on x86
as we would produce try to extract the chars inside the vector mode using the vector mode of V8SI
which was wrong. */
__attribute__ ((vector_size (8))) signed char v4, v5, v6;
void
two (void)
{
v4 = v5 + v6;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment