This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] More type_for_size call removals
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 12 Mar 2012 15:12:29 +0100 (CET)
- Subject: [PATCH] More type_for_size call removals
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied as
obvious.
Richard.
2012-03-12 Richard Guenther <rguenther@suse.de>
lto/
* lto-lang.c (builtin_type_for_size): Use lto_type_for_size.
fortran/
* f95-lang.c (builtin_type_for_size): Use gfc_type_for_size.
c-common/
* c-common.c (c_common_get_narrower): Use c_common_type_for_size.
(builtin_type_for_size): Likewise.
* config/alpha/alpha.c (alpha_gimplify_va_arg): Use
build_nonstandard_integer_type.
Index: gcc/lto/lto-lang.c
===================================================================
*** gcc/lto/lto-lang.c (revision 185226)
--- gcc/lto/lto-lang.c (working copy)
*************** along with GCC; see the file COPYING3.
*** 36,41 ****
--- 36,43 ----
#include "toplev.h"
#include "lto-streamer.h"
+ static tree lto_type_for_size (unsigned, int);
+
static tree handle_noreturn_attribute (tree *, tree, tree, int, bool *);
static tree handle_leaf_attribute (tree *, tree, tree, int, bool *);
static tree handle_const_attribute (tree *, tree, tree, int, bool *);
*************** def_fn_type (builtin_type def, builtin_t
*** 523,529 ****
static tree
builtin_type_for_size (int size, bool unsignedp)
{
! tree type = lang_hooks.types.type_for_size (size, unsignedp);
return type ? type : error_mark_node;
}
--- 525,531 ----
static tree
builtin_type_for_size (int size, bool unsignedp)
{
! tree type = lto_type_for_size (size, unsignedp);
return type ? type : error_mark_node;
}
Index: gcc/fortran/f95-lang.c
===================================================================
*** gcc/fortran/f95-lang.c (revision 185226)
--- gcc/fortran/f95-lang.c (working copy)
*************** build_builtin_fntypes (tree *fntype, tre
*** 605,611 ****
static tree
builtin_type_for_size (int size, bool unsignedp)
{
! tree type = lang_hooks.types.type_for_size (size, unsignedp);
return type ? type : error_mark_node;
}
--- 605,611 ----
static tree
builtin_type_for_size (int size, bool unsignedp)
{
! tree type = gfc_type_for_size (size, unsignedp);
return type ? type : error_mark_node;
}
Index: gcc/c-family/c-common.c
===================================================================
*** gcc/c-family/c-common.c (revision 185226)
--- gcc/c-family/c-common.c (working copy)
*************** c_common_get_narrower (tree op, int *uns
*** 1849,1857 ****
/* C++0x scoped enumerations don't implicitly convert to integral
type; if we stripped an explicit conversion to a larger type we
need to replace it so common_type will still work. */
! tree type = (lang_hooks.types.type_for_size
! (TYPE_PRECISION (TREE_TYPE (op)),
! TYPE_UNSIGNED (TREE_TYPE (op))));
op = fold_convert (type, op);
}
return op;
--- 1849,1856 ----
/* C++0x scoped enumerations don't implicitly convert to integral
type; if we stripped an explicit conversion to a larger type we
need to replace it so common_type will still work. */
! tree type = c_common_type_for_size (TYPE_PRECISION (TREE_TYPE (op)),
! TYPE_UNSIGNED (TREE_TYPE (op)));
op = fold_convert (type, op);
}
return op;
*************** c_common_mark_addressable_vec (tree t)
*** 9259,9265 ****
tree
builtin_type_for_size (int size, bool unsignedp)
{
! tree type = lang_hooks.types.type_for_size (size, unsignedp);
return type ? type : error_mark_node;
}
--- 9258,9264 ----
tree
builtin_type_for_size (int size, bool unsignedp)
{
! tree type = c_common_type_for_size (size, unsignedp);
return type ? type : error_mark_node;
}
Index: gcc/config/alpha/alpha.c
===================================================================
*** gcc/config/alpha/alpha.c (revision 185226)
--- gcc/config/alpha/alpha.c (working copy)
*************** alpha_gimplify_va_arg (tree valist, tree
*** 6228,6234 ****
offset field so that it's the proper width for pointer arithmetic. */
base = get_formal_tmp_var (base_field, pre_p);
! t = fold_convert (lang_hooks.types.type_for_size (64, 0), offset_field);
offset = get_initialized_tmp_var (t, pre_p, NULL);
indirect = pass_by_reference (NULL, TYPE_MODE (type), type, false);
--- 6228,6234 ----
offset field so that it's the proper width for pointer arithmetic. */
base = get_formal_tmp_var (base_field, pre_p);
! t = fold_convert (build_nonstandard_integer_type (64, 0), offset_field);
offset = get_initialized_tmp_var (t, pre_p, NULL);
indirect = pass_by_reference (NULL, TYPE_MODE (type), type, false);