aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMarkus F.X.J. Oberhumer <markus@oberhumer.com>2005-04-24 17:35:34 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2005-04-24 17:35:34 +0000
commit4484e9b6a8f4845884ceb40453280596b9ad6bf5 (patch)
treebb1fb372faf60da153d48910bcde48e7db0a990a /gcc
parent7da4bf7dd7624094cd3422246af9f10c8538eb51 (diff)
downloadgcc-4484e9b6a8f4845884ceb40453280596b9ad6bf5.zip
gcc-4484e9b6a8f4845884ceb40453280596b9ad6bf5.tar.gz
gcc-4484e9b6a8f4845884ceb40453280596b9ad6bf5.tar.bz2
mangle.c (write_builtin_type): Handle integer types which are not one of the shared integer type nodes and...
* mangle.c (write_builtin_type): Handle integer types which are not one of the shared integer type nodes and emit a "vendor extended builtin type" with an encoding in the form of "u5int96". From-SVN: r98665
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/mangle.c30
2 files changed, 31 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 0838f93..a0ebc89 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2005-04-12 Markus F.X.J. Oberhumer <markus@oberhumer.com>
+
+ * mangle.c (write_builtin_type): Handle integer types which are
+ not one of the shared integer type nodes and emit a "vendor
+ extended builtin type" with an encoding in the form of "u5int96".
+
2005-04-24 Ian Lance Taylor <ian@airs.com>
* cp-tree.def (USING_STMT): Change class to tcc_statement.
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index fc6c424..20be571 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -1757,15 +1757,35 @@ write_builtin_type (tree type)
{
tree t = c_common_type_for_mode (TYPE_MODE (type),
TYPE_UNSIGNED (type));
- if (type == t)
+ if (type != t)
{
- gcc_assert (TYPE_PRECISION (type) == 128);
- write_char (TYPE_UNSIGNED (type) ? 'o' : 'n');
+ type = t;
+ goto iagain;
}
+
+ if (TYPE_PRECISION (type) == 128)
+ write_char (TYPE_UNSIGNED (type) ? 'o' : 'n');
else
{
- type = t;
- goto iagain;
+ /* Allow for cases where TYPE is not one of the shared
+ integer type nodes and write a "vendor extended builtin
+ type" with a name the form intN or uintN, respectively.
+ Situations like this can happen if you have an
+ __attribute__((__mode__(__SI__))) type and use exotic
+ switches like '-mint64' on MIPS or '-mint8' on AVR.
+ Of course, this is undefined by the C++ ABI (and
+ '-mint8' is not even Standard C conforming), but when
+ using such special options you're pretty much in nowhere
+ land anyway. */
+ const char *prefix;
+ char prec[11]; /* up to ten digits for an unsigned */
+
+ prefix = TYPE_UNSIGNED (type) ? "uint" : "int";
+ sprintf (prec, "%u", (unsigned) TYPE_PRECISION (type));
+ write_char ('u'); /* "vendor extended builtin type" */
+ write_unsigned_number (strlen (prefix) + strlen (prec));
+ write_string (prefix);
+ write_string (prec);
}
}
}