summaryrefslogtreecommitdiff
path: root/gcc/cppexp.c
diff options
context:
space:
mode:
authorbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>1996-01-22 23:40:12 +0000
committerbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>1996-01-22 23:40:12 +0000
commiteb74733676f3a4fd6cfcb420f2eda05c32fc1c59 (patch)
tree4c610bc58db5e76780f98f3717af42208fbd3b73 /gcc/cppexp.c
parent78623407677aa0ce421d1a6b203bd267b85abd76 (diff)
downloadgcc-eb74733676f3a4fd6cfcb420f2eda05c32fc1c59.tar.gz
* cppexp.c (cpp_parse_expr): Set HAVE_VALUE flag for unary
minus, even if skip_evaluation is true. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@11085 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cppexp.c')
-rw-r--r--gcc/cppexp.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/gcc/cppexp.c b/gcc/cppexp.c
index b830f9b71ac..043098a43df 100644
--- a/gcc/cppexp.c
+++ b/gcc/cppexp.c
@@ -279,7 +279,7 @@ static struct token tokentab2[] = {
struct operation
cpp_lex (pfile)
-cpp_reader *pfile;
+ cpp_reader *pfile;
{
register int c;
register int namelen;
@@ -793,11 +793,10 @@ cpp_parse_expr (pfile)
}
break;
case '-':
- if (skip_evaluation) ; /* do nothing */
- else if (!(top->flags & HAVE_VALUE))
+ if (!(top->flags & HAVE_VALUE))
{ /* Unary '-' */
top->value = - v2;
- if ((top->value & v2) < 0 && ! unsigned2)
+ if (!skip_evaluation && (top->value & v2) < 0 && !unsigned2)
integer_overflow (pfile);
top->unsignedp = unsigned2;
top->flags |= HAVE_VALUE;
@@ -806,7 +805,7 @@ cpp_parse_expr (pfile)
{ /* Binary '-' */
top->value = v1 - v2;
top->unsignedp = unsigned1 || unsigned2;
- if (! top->unsignedp
+ if (! top->unsignedp && ! skip_evaluation
&& ! possible_sum_sign (top->value, v2, v1))
integer_overflow (pfile);
}