aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-09-12 19:08:12 +0000
committerRichard Stallman <rms@gnu.org>1992-09-12 19:08:12 +0000
commita120b7889de5c2127f5dca2559ff0d9999611957 (patch)
tree904aaf42c8c648ca3d670e4af613c38349fd7f63 /gcc
parent9bd23d2c954318dfe201afc37c9dbca98856040b (diff)
downloadgcc-a120b7889de5c2127f5dca2559ff0d9999611957.zip
gcc-a120b7889de5c2127f5dca2559ff0d9999611957.tar.gz
gcc-a120b7889de5c2127f5dca2559ff0d9999611957.tar.bz2
(yylex): If integer value overflows so highword is negative,
it needs unsigned long long. From-SVN: r2111
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-lex.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index 1587ae6..629e93b 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -1558,6 +1558,8 @@ yylex ()
else if (! spec_long_long)
ansi_type = long_unsigned_type_node;
else if (! spec_unsigned
+ /* Verify value does not overflow into sign bit. */
+ && TREE_INT_CST_HIGH (yylval.ttype) >= 0
&& int_fits_type_p (yylval.ttype,
long_long_integer_type_node))
ansi_type = long_long_integer_type_node;