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]

[patch] PR18505 fix, PR18403 partial fix





When creating the new vector pointer arithmetic - 'vp = vp + update', the
size of the type of 'update' should be the same as the size of the type of
vp (Andrew, thanks for the diagnosis). The vectorizer however uses
integer_type_node as the type of 'update'. This patch fixes it to use:
  size = TYPE_SIZE (TREE_TYPE (vp));
  type = lang_hooks.types.type_for_size (TREE_INT_CST_LOW (size), 1);

(I wasn't sure whether to use the above, or the following:
 type = make_unsigned_type (TREE_INT_CST_LOW (size)); ?)

Tested on powerpc64-suse-linux, powerpc-apple-darwin and i686-pc-linux-gnu.

ok for mainline?

thanks,
dorit

       * tree-vectorizer.c (vect_create_data_ref_ptr): Use
       lang_hooks.types.type_for_size instead of integer_type_node for the
       type of ptr_update.


(See attached file: pr18505.fix)

Attachment: pr18505.fix
Description: Binary data


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