Commit c93e9e16 by James A. Morrison

parse.y: Do comparisons as the type of the first expression.

2005-02-26  James A. Morrison  <phython@gcc.gnu.org>

        * parse.y: Do comparisons as the type of the first expression.
        * treetree.c (tree_code_get_integer_value): Build integer constants
        with the proper type.

From-SVN: r95578
parent 03e3ca0d
2005-02-26 James A. Morrison <phython@gcc.gnu.org> 2005-02-26 James A. Morrison <phython@gcc.gnu.org>
* parse.y: Do comparisons as the type of the first expression.
* treetree.c (tree_code_get_integer_value): Build integer constants
with the proper type.
2005-02-26 James A. Morrison <phython@gcc.gnu.org>
* Make-lang.in: Remove commented out code. * Make-lang.in: Remove commented out code.
* lang-specs.h: Always pass -dumpbase to tree1. * lang-specs.h: Always pass -dumpbase to tree1.
......
...@@ -591,8 +591,11 @@ INTEGER { ...@@ -591,8 +591,11 @@ INTEGER {
struct prod_token_parm_item *tok = $2; struct prod_token_parm_item *tok = $2;
struct prod_token_parm_item *op1 = $1; struct prod_token_parm_item *op1 = $1;
struct prod_token_parm_item *op2 = $3; struct prod_token_parm_item *op2 = $3;
int type_code = NUMERIC_TYPE (op1);
if (!type_code)
YYERROR;
$$ = make_plus_expression $$ = make_plus_expression
(tok, op1, op2, SIGNED_INT, EXP_EQUALS); (tok, op1, op2, type_code, EXP_EQUALS);
} }
|variable_ref ASSIGN expression { |variable_ref ASSIGN expression {
struct prod_token_parm_item *tok = $2; struct prod_token_parm_item *tok = $2;
......
...@@ -650,7 +650,8 @@ tree_code_get_integer_value (unsigned char* chars, unsigned int length) ...@@ -650,7 +650,8 @@ tree_code_get_integer_value (unsigned char* chars, unsigned int length)
for (ix = start; ix < length; ix++) for (ix = start; ix < length; ix++)
val = val * 10 + chars[ix] - (unsigned char)'0'; val = val * 10 + chars[ix] - (unsigned char)'0';
val = val*negative; val = val*negative;
return build_int_cst_wide (NULL_TREE, return build_int_cst_wide (start == 1 ?
integer_type_node : unsigned_type_node,
val & 0xffffffff, (val >> 32) & 0xffffffff); val & 0xffffffff, (val >> 32) & 0xffffffff);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment