This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[lto][patch] Remove old unused patch
- From: Rafael Espindola <espindola at google dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Diego Novillo <dnovillo at google dot com>
- Date: Wed, 1 Apr 2009 15:28:42 +0100
- Subject: [lto][patch] Remove old unused patch
This patch reverts
http://gcc.gnu.org/ml/gcc-patches/2007-11/msg00918.html
It was needed when we used DWARF, but that is not the case anymore.
OK if bootstraps and tests are OK?
2009-04-01 Rafael Avila de Espindola <espindola@google.com>
Revert
2007-11-16 Nathan Froyd <froydnj@codesourcery.com>
* c-common.c (c_build_bitfield_integer_type): Rename this...
* stor-layout.c (make_bitfield_integer_type): ...to this.
* c-decl.c (finish_struct): Use new name.
* c-common.h (c_build_bitfield_integer_type): Move declaration...
* tree.h (make_bitfield_integer_type): ...here.
2007-11-16 Nathan Froyd <froydnj@codesourcery.com>
* class.c (layout_class_type): Use make_bitfield_integer_type.
2007-11-16 Nathan Froyd <froydnj@codesourcery.com>
* lto.c (lto_read_base_type_DIE): Use make_bitfield_integer_type to
construct the integer type for bitfields.
Cheers,
--
Rafael Avila de Espindola
Google | Gordon House | Barrow Street | Dublin 4 | Ireland
Registered in Dublin, Ireland | Registration Number: 368047
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 2a19f49..cd51b01 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -2754,6 +2754,31 @@ c_common_signed_or_unsigned_type (int unsignedp, tree type)
return build_nonstandard_integer_type (TYPE_PRECISION (type), unsignedp);
}
+/* Build a bit-field integer type for the given WIDTH and UNSIGNEDP. */
+
+tree
+c_build_bitfield_integer_type (unsigned HOST_WIDE_INT width, int unsignedp)
+{
+ /* Extended integer types of the same width as a standard type have
+ lesser rank, so those of the same width as int promote to int or
+ unsigned int and are valid for printf formats expecting int or
+ unsigned int. To avoid such special cases, avoid creating
+ extended integer types for bit-fields if a standard integer type
+ is available. */
+ if (width == TYPE_PRECISION (integer_type_node))
+ return unsignedp ? unsigned_type_node : integer_type_node;
+ if (width == TYPE_PRECISION (signed_char_type_node))
+ return unsignedp ? unsigned_char_type_node : signed_char_type_node;
+ if (width == TYPE_PRECISION (short_integer_type_node))
+ return unsignedp ? short_unsigned_type_node : short_integer_type_node;
+ if (width == TYPE_PRECISION (long_integer_type_node))
+ return unsignedp ? long_unsigned_type_node : long_integer_type_node;
+ if (width == TYPE_PRECISION (long_long_integer_type_node))
+ return (unsignedp ? long_long_unsigned_type_node
+ : long_long_integer_type_node);
+ return build_nonstandard_integer_type (width, unsignedp);
+}
+
/* The C version of the register_builtin_type langhook. */
void
diff --git a/gcc/c-common.h b/gcc/c-common.h
index 9301f26..73ee101 100644
--- a/gcc/c-common.h
+++ b/gcc/c-common.h
@@ -713,6 +713,7 @@ extern tree c_common_fixed_point_type_for_size (unsigned int, unsigned int,
extern tree c_common_unsigned_type (tree);
extern tree c_common_signed_type (tree);
extern tree c_common_signed_or_unsigned_type (int, tree);
+extern tree c_build_bitfield_integer_type (unsigned HOST_WIDE_INT, int);
extern bool decl_with_nonnull_addr_p (const_tree);
extern tree c_common_truthvalue_conversion (location_t, tree);
extern void c_apply_type_quals_to_decl (int, tree);
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index bad30b0..081e7c4 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -5643,7 +5643,7 @@ finish_struct (tree t, tree fieldlist, tree attributes)
if (width != TYPE_PRECISION (type))
{
TREE_TYPE (*fieldlistp)
- = make_bitfield_integer_type (width, TYPE_UNSIGNED (type));
+ = c_build_bitfield_integer_type (width, TYPE_UNSIGNED (type));
DECL_MODE (*fieldlistp) = TYPE_MODE (TREE_TYPE (*fieldlistp));
}
DECL_INITIAL (*fieldlistp) = 0;
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 620814b..cf10560 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -4981,8 +4981,8 @@ layout_class_type (tree t, tree *virtuals_p)
if (width != TYPE_PRECISION (ftype))
{
TREE_TYPE (field)
- = make_bitfield_integer_type (width,
- TYPE_UNSIGNED (ftype));
+ = c_build_bitfield_integer_type (width,
+ TYPE_UNSIGNED (ftype));
TREE_TYPE (field)
= cp_build_qualified_type (TREE_TYPE (field),
TYPE_QUALS (ftype));
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 48969ae..581cb89 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -1959,31 +1959,6 @@ make_unsigned_type (int precision)
fixup_unsigned_type (type);
return type;
}
-
-/* Build a bit-field integer type for the given WIDTH and UNSIGNEDP. */
-
-tree
-make_bitfield_integer_type (unsigned HOST_WIDE_INT width, int unsignedp)
-{
- /* Extended integer types of the same width as a standard type have
- lesser rank, so those of the same width as int promote to int or
- unsigned int and are valid for printf formats expecting int or
- unsigned int. To avoid such special cases, avoid creating
- extended integer types for bit-fields if a standard integer type
- is available. */
- if (width == TYPE_PRECISION (integer_type_node))
- return unsignedp ? unsigned_type_node : integer_type_node;
- if (width == TYPE_PRECISION (signed_char_type_node))
- return unsignedp ? unsigned_char_type_node : signed_char_type_node;
- if (width == TYPE_PRECISION (short_integer_type_node))
- return unsignedp ? short_unsigned_type_node : short_integer_type_node;
- if (width == TYPE_PRECISION (long_integer_type_node))
- return unsignedp ? long_unsigned_type_node : long_integer_type_node;
- if (width == TYPE_PRECISION (long_long_integer_type_node))
- return (unsignedp ? long_long_unsigned_type_node
- : long_long_integer_type_node);
- return build_nonstandard_integer_type (width, unsignedp);
-}
/* Create and return a type for fract of PRECISION bits, UNSIGNEDP,
and SATP. */
diff --git a/gcc/tree.h b/gcc/tree.h
index 8b8d8f2..6cac393 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -4020,7 +4020,6 @@ extern tree build_call_array (tree, tree, int, tree*);
extern tree make_signed_type (int);
extern tree make_unsigned_type (int);
-extern tree make_bitfield_integer_type (unsigned HOST_WIDE_INT, int);
extern tree signed_or_unsigned_type_for (int, tree);
extern tree signed_type_for (tree);
extern tree unsigned_type_for (tree);