From 73333a8791299c17951b58c25ba4857059432059 Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Mon, 18 Jan 1999 06:29:26 +0000 Subject: [PATCH] parse.y (patch_binop): Do a type conversion from signed to unsigned and then back to signed when... 1999-01-18 Andrew Haley * parse.y (patch_binop): Do a type conversion from signed to unsigned and then back to signed when a ">>>" is found. From-SVN: r24741 --- gcc/java/ChangeLog | 5 +++++ gcc/java/parse.c | 13 +++++++++---- gcc/java/parse.y | 7 ++++++- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 1b85e3f7ab0..35bc1b3cd8c 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,8 @@ +1999-01-18 Andrew Haley + + * parse.y (patch_binop): Do a type conversion from signed to + unsigned and then back to signed when a ">>>" is found. + Sun Jan 17 21:55:42 1999 Jeffrey A Law (law@cygnus.com) * Makefile.in (zextract.o): Add dependencies. diff --git a/gcc/java/parse.c b/gcc/java/parse.c index 8d7da905bef..161c2eeada1 100644 --- a/gcc/java/parse.c +++ b/gcc/java/parse.c @@ -2250,7 +2250,7 @@ static const short yycheck[] = { 3, #define YYPURE 1 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "/usr/local/share/bison.simple" +#line 3 "/local/aph/tx39/share/bison.simple" /* Skeleton output parser for bison, Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. @@ -2443,7 +2443,7 @@ __yy_memcpy (char *to, char *from, int count) #endif #endif -#line 196 "/usr/local/share/bison.simple" +#line 196 "/local/aph/tx39/share/bison.simple" /* The user can define YYPARSE_PARAM as the name of an argument to be passed into yyparse. The argument should have type void *. @@ -4701,7 +4701,7 @@ case 492: break;} } /* the action file gets copied in in place of this dollarsign */ -#line 498 "/usr/local/share/bison.simple" +#line 498 "/local/aph/tx39/share/bison.simple" yyvsp -= yylen; yyssp -= yylen; @@ -11599,8 +11599,13 @@ patch_binop (node, wfl_op1, wfl_op2) /* The >>> operator is a >> operating on unsigned quantities */ if (code == URSHIFT_EXPR && ! flag_emit_class_files) { - op1 = convert (unsigned_type (prom_type), op1); + tree utype = unsigned_type (prom_type); + op1 = convert (utype, op1); TREE_SET_CODE (node, RSHIFT_EXPR); + TREE_OPERAND (node, 0) = op1; + TREE_OPERAND (node, 1) = op2; + TREE_TYPE (node) = utype; + return convert (prom_type, node); } break; diff --git a/gcc/java/parse.y b/gcc/java/parse.y index c6805c29628..70b81b1903c 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -8961,8 +8961,13 @@ patch_binop (node, wfl_op1, wfl_op2) /* The >>> operator is a >> operating on unsigned quantities */ if (code == URSHIFT_EXPR && ! flag_emit_class_files) { - op1 = convert (unsigned_type (prom_type), op1); + tree utype = unsigned_type (prom_type); + op1 = convert (utype, op1); TREE_SET_CODE (node, RSHIFT_EXPR); + TREE_OPERAND (node, 0) = op1; + TREE_OPERAND (node, 1) = op2; + TREE_TYPE (node) = utype; + return convert (prom_type, node); } break;