aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1994-01-17 00:23:49 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1994-01-17 00:23:49 +0000
commita39f77396e4a9ccc31b7935e541658d4df06c820 (patch)
treed14d221ce24c1b5c1aa8c4ae1bdca4646e6e894e
parent24033f1e6b1e29b21fa9cabf7677f0b59c2366f5 (diff)
downloadfsf-binutils-gdb-a39f77396e4a9ccc31b7935e541658d4df06c820.zip
fsf-binutils-gdb-a39f77396e4a9ccc31b7935e541658d4df06c820.tar.gz
fsf-binutils-gdb-a39f77396e4a9ccc31b7935e541658d4df06c820.tar.bz2
* c-exp.y (parse_number): Assign to temporary between the right
shifts, to work around a bug in the SCO compiler.
-rw-r--r--gdb/ChangeLog3
-rw-r--r--gdb/c-exp.y6
2 files changed, 7 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e930dbb..47d306f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,8 @@
Sun Jan 16 12:46:01 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+ * c-exp.y (parse_number): Assign to temporary between the right
+ shifts, to work around a bug in the SCO compiler.
+
* Makefile.in (ALLCONFIG, ALLPARAM, ALLDEPFILES, HFILES_NO_SRCDIR):
Add various files which were added to GDB recently.
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 08f7548..7263979 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -903,6 +903,7 @@ parse_number (p, len, parsed_float, putithere)
here, and we do kind of silly things like cast to unsigned. */
register LONGEST n = 0;
register LONGEST prevn = 0;
+ unsigned LONGEST un;
register int i = 0;
register int c;
@@ -1023,8 +1024,9 @@ parse_number (p, len, parsed_float, putithere)
the case where it is we just always shift the value more than
once, with fewer bits each time. */
+ un = (unsigned LONGEST)n >> 2;
if (long_p == 0
- && (((unsigned LONGEST)n >> 2) >> (TARGET_INT_BIT - 2)) == 0)
+ && (un >> (TARGET_INT_BIT - 2)) == 0)
{
high_bit = ((unsigned LONGEST)1) << (TARGET_INT_BIT-1);
@@ -1038,7 +1040,7 @@ parse_number (p, len, parsed_float, putithere)
signed_type = builtin_type_int;
}
else if (long_p <= 1
- && (((unsigned LONGEST)n >> 2) >> (TARGET_LONG_BIT - 2)) == 0)
+ && (un >> (TARGET_LONG_BIT - 2)) == 0)
{
high_bit = ((unsigned LONGEST)1) << (TARGET_LONG_BIT-1);
unsigned_type = builtin_type_unsigned_long;