summaryrefslogtreecommitdiff
path: root/gcc/dbxout.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1993-10-12 19:37:18 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1993-10-12 19:37:18 +0000
commitbdbb0781dd5b2464fc9cbb88d5cf7e760276b351 (patch)
treeaf69e12051c14f97bb7fc8e9fb6f074408fc14d3 /gcc/dbxout.c
parentf0ea338b47b277612cbdbe1e5e09686267ba18c7 (diff)
downloadgcc-bdbb0781dd5b2464fc9cbb88d5cf7e760276b351.tar.gz
(dbxout_type, case INTEGER_TYPE): Output bounds in octal if type wider
than HOST_WIDE_INT. (print_int_cst_octal): Trim bound by precision of its type. Avoid warning on what may be shift into sign bit. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@5751 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dbxout.c')
-rw-r--r--gcc/dbxout.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/gcc/dbxout.c b/gcc/dbxout.c
index 69227990bae..67435268999 100644
--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -1012,7 +1012,8 @@ dbxout_type (type, full, show_arg_types)
take care to make sure that `char' was type number 2. */
fprintf (asmfile, "r%d;0;127;", TYPE_SYMTAB_ADDRESS (type));
else if (use_gnu_debug_info_extensions
- && TYPE_PRECISION (type) > TYPE_PRECISION (integer_type_node))
+ && (TYPE_PRECISION (type) > TYPE_PRECISION (integer_type_node)
+ || TYPE_PRECISION (type) > HOST_BITS_PER_WIDE_INT))
{
/* This used to say `r1' and we used to take care
to make sure that `int' was type number 1. */
@@ -1376,6 +1377,20 @@ print_int_cst_octal (c)
unsigned HOST_WIDE_INT high = TREE_INT_CST_HIGH (c);
unsigned HOST_WIDE_INT low = TREE_INT_CST_LOW (c);
int excess = (3 - (HOST_BITS_PER_WIDE_INT % 3));
+ int width = TYPE_PRECISION (TREE_TYPE (c));
+
+ /* GDB wants constants with no extra leading "1" bits, so
+ we need to remove any sign-extension that might be
+ present. */
+ if (width == HOST_BITS_PER_WIDE_INT * 2)
+ ;
+ else if (width > HOST_BITS_PER_WIDE_INT)
+ high &= (((HOST_WIDE_INT) 1 << (width - HOST_BITS_PER_WIDE_INT)) - 1);
+ else
+ {
+ high = 0;
+ low &= (((HOST_WIDE_INT) 1 << width) - 1);
+ }
fprintf (asmfile, "0");
@@ -1391,7 +1406,10 @@ print_int_cst_octal (c)
= ((high & (((HOST_WIDE_INT) 1 << excess) - 1)) << (3 - excess)
| (low >> (HOST_BITS_PER_WIDE_INT / 3 * 3)));
unsigned HOST_WIDE_INT end
- = low & (((HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT / 3 * 3)) - 1);
+ = low & (((unsigned HOST_WIDE_INT) 1
+ << (HOST_BITS_PER_WIDE_INT / 3 * 3))
+ - 1);
+
fprintf (asmfile, "%o%01o", beg, middle);
print_octal (end, HOST_BITS_PER_WIDE_INT / 3);
}