This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[rfc] fix 17962


I do not replicate the PR implementing the test case with SSE
vector ops (we could, but not 100% directly).  I do see the
test case implemented with 3dnow vector ops with -march=athlon.

But that aside, if we don't assign a native vector mode to the
vector, we weren't assigning ANY alignment, not even the base
alignment of the individual vector elements.

I think the best solution is to always naturally align vectors,
so that we minimize ABI skew when native vector ops aren't
available.

Thoughts?


r~


Index: stor-layout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/stor-layout.c,v
retrieving revision 1.215
diff -c -p -d -r1.215 stor-layout.c
*** stor-layout.c	28 Sep 2004 02:56:03 -0000	1.215
--- stor-layout.c	15 Oct 2004 08:31:39 -0000
*************** layout_type (tree type)
*** 1576,1581 ****
--- 1576,1585 ----
  					         nunits_tree, 0);
  	TYPE_SIZE (type) = int_const_binop (MULT_EXPR, TYPE_SIZE (innertype),
  					    nunits_tree, 0);
+ 
+ 	/* Always natually align vectors.  This prevents ABI changes
+ 	   depending on whether or not native vector modes are supported.  */
+ 	TYPE_ALIGN (type) = tree_low_cst (TYPE_SIZE (type), 0);
          break;
        }
  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]