aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2009-03-06 09:10:46 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2009-03-06 09:10:46 +0000
commit2dc6d6660ad8b5d3f881ff4a13c3ee65215fcea7 (patch)
tree6413f929ee7d705cbadc88abe114c1e1a026488b /gcc/cp
parent47ed69db7ee9361910c539b35256315ee04e1186 (diff)
downloadgcc-2dc6d6660ad8b5d3f881ff4a13c3ee65215fcea7.zip
gcc-2dc6d6660ad8b5d3f881ff4a13c3ee65215fcea7.tar.gz
gcc-2dc6d6660ad8b5d3f881ff4a13c3ee65215fcea7.tar.bz2
decl.c (record_builtin_java_type): Use canonicalized integer types.
* decl.c (record_builtin_java_type): Use canonicalized integer types. From-SVN: r144664
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl.c14
2 files changed, 16 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 31a626b..7206639 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2009-03-06 Alexandre Oliva <aoliva@redhat.com>
+
+ * decl.c (record_builtin_java_type): Use canonicalized integer
+ types.
+
2009-03-04 Jason Merrill <jason@redhat.com>
PR c++/38908
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index ddd133a..4ed3425 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -3168,10 +3168,18 @@ record_builtin_java_type (const char* name, int size)
{
tree type, decl;
if (size > 0)
- type = make_signed_type (size);
+ type = build_nonstandard_integer_type (size, 0);
else if (size > -32)
- { /* "__java_char" or ""__java_boolean". */
- type = make_unsigned_type (-size);
+ {
+ tree stype;
+ /* "__java_char" or ""__java_boolean". */
+ type = build_nonstandard_integer_type (-size, 1);
+ /* Get the signed type cached and attached to the unsigned type,
+ so it doesn't get garbage-collected at "random" times,
+ causing potential codegen differences out of different UIDs
+ and different alias set numbers. */
+ stype = build_nonstandard_integer_type (-size, 0);
+ TREE_CHAIN (type) = stype;
/*if (size == -1) TREE_SET_CODE (type, BOOLEAN_TYPE);*/
}
else