summaryrefslogtreecommitdiff
path: root/gcc/treelang
diff options
context:
space:
mode:
authorphython <phython@138bc75d-0d04-0410-961f-82ee72b054a4>2005-02-26 14:01:03 +0000
committerphython <phython@138bc75d-0d04-0410-961f-82ee72b054a4>2005-02-26 14:01:03 +0000
commit04fcffc4ef2015eb6a89da9aeb130e86719027de (patch)
tree3ee2fa5b5b26dee05ba50d9f906279dd477341fc /gcc/treelang
parentbf05a4627abe195d5961783a165a2cfc759a682d (diff)
downloadgcc-04fcffc4ef2015eb6a89da9aeb130e86719027de.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95578 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/treelang')
-rw-r--r--gcc/treelang/ChangeLog6
-rw-r--r--gcc/treelang/parse.y5
-rw-r--r--gcc/treelang/treetree.c3
3 files changed, 12 insertions, 2 deletions
diff --git a/gcc/treelang/ChangeLog b/gcc/treelang/ChangeLog
index ec9c1c3006a..c1a2da61190 100644
--- a/gcc/treelang/ChangeLog
+++ b/gcc/treelang/ChangeLog
@@ -1,5 +1,11 @@
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.
* lang-specs.h: Always pass -dumpbase to tree1.
diff --git a/gcc/treelang/parse.y b/gcc/treelang/parse.y
index 7ee71ec5a9c..abf2bcbf795 100644
--- a/gcc/treelang/parse.y
+++ b/gcc/treelang/parse.y
@@ -591,8 +591,11 @@ INTEGER {
struct prod_token_parm_item *tok = $2;
struct prod_token_parm_item *op1 = $1;
struct prod_token_parm_item *op2 = $3;
+ int type_code = NUMERIC_TYPE (op1);
+ if (!type_code)
+ YYERROR;
$$ = make_plus_expression
- (tok, op1, op2, SIGNED_INT, EXP_EQUALS);
+ (tok, op1, op2, type_code, EXP_EQUALS);
}
|variable_ref ASSIGN expression {
struct prod_token_parm_item *tok = $2;
diff --git a/gcc/treelang/treetree.c b/gcc/treelang/treetree.c
index eef293bb2f7..dcb7cd351a0 100644
--- a/gcc/treelang/treetree.c
+++ b/gcc/treelang/treetree.c
@@ -650,7 +650,8 @@ tree_code_get_integer_value (unsigned char* chars, unsigned int length)
for (ix = start; ix < length; ix++)
val = val * 10 + chars[ix] - (unsigned char)'0';
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);
}