From 8b77a5048a607be184335881520d88f9b34c450f Mon Sep 17 00:00:00 2001 From: gfunck Date: Sat, 13 Aug 2011 00:44:29 +0000 Subject: [PATCH] 2011-08-12 Gary Funck * config/i386/i386.h (MAX_FIXED_MODE_SIZE): Delete (revert to trunk). * upc/upc-pts-struct.c (upc_pts_struct_init_type): Set mode of UPC pointer-to-shared rep. to an integral mode of size at least as large as the size of the representation's struct type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gupc@177729 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog.upc | 9 +++++++++ gcc/config/i386/i386.h | 4 ---- gcc/upc/upc-pts-struct.c | 9 +++++++++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog.upc b/gcc/ChangeLog.upc index b60066e0fff..9e825b96daa 100644 --- a/gcc/ChangeLog.upc +++ b/gcc/ChangeLog.upc @@ -1,5 +1,14 @@ 2011-08-12 Gary Funck + * config/i386/i386.h (MAX_FIXED_MODE_SIZE): Delete + (revert to trunk). + * upc/upc-pts-struct.c (upc_pts_struct_init_type): + Set mode of UPC pointer-to-shared rep. to an + integral mode of size at least as large as the + size of the representation's struct type. + +2011-08-12 Gary Funck + Rework/simplify the UPC genericize pass. * c-family/stub-upc.c (upc_apply_layout_qualifier, upc_build_pointer_type): New. diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index a5d4a23f5cb..f43586d012b 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -1754,10 +1754,6 @@ do { \ #define BRANCH_COST(speed_p, predictable_p) \ (!(speed_p) ? 2 : (predictable_p) ? 0 : ix86_branch_cost) -/* An integer expression for the size in bits of the largest integer machine - mode that should actually be used. We allow pairs of registers. */ -#define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (TARGET_64BIT ? TImode : DImode) - /* Define this macro as a C expression which is nonzero if accessing less than a word of memory (i.e. a `char' or a `short') is no faster than accessing a word of memory, i.e., if such access diff --git a/gcc/upc/upc-pts-struct.c b/gcc/upc/upc-pts-struct.c index 0198bdbd737..b4d47594975 100644 --- a/gcc/upc/upc-pts-struct.c +++ b/gcc/upc/upc-pts-struct.c @@ -82,6 +82,7 @@ upc_pts_struct_init_type (void) tree name = NULL_TREE; tree ref; tree shared_void_type, shared_char_type; + enum machine_mode pts_mode; const location_t loc = UNKNOWN_LOCATION; struct c_struct_parse_info *null_struct_parse_info = NULL; int save_pedantic = pedantic; @@ -131,6 +132,14 @@ upc_pts_struct_init_type (void) upc_pts_rep_type_node = finish_struct (loc, ref, fields, NULL_TREE, null_struct_parse_info); pedantic = save_pedantic; + gcc_assert (TYPE_SIZE (upc_pts_rep_type_node)); + gcc_assert (host_integerp (TYPE_SIZE (upc_pts_rep_type_node), 1)); + gcc_assert ((unsigned HOST_WIDE_INT) + tree_low_cst (TYPE_SIZE (upc_pts_rep_type_node), 1) + == 2 * POINTER_SIZE); + pts_mode = mode_for_size_tree (TYPE_SIZE (upc_pts_rep_type_node), MODE_INT, 0); + gcc_assert (pts_mode != BLKmode); + SET_TYPE_MODE(upc_pts_rep_type_node, pts_mode); record_builtin_type (RID_SHARED, "upc_shared_ptr_t", upc_pts_rep_type_node); shared_void_type = build_variant_type_copy (void_type_node); -- 2.11.4.GIT