Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
54ba9323
Commit
54ba9323
authored
Feb 19, 2011
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't crash on constant right shift.
From-SVN: r170307
parent
8b021004
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
gcc/go/gofrontend/expressions.cc
+17
-8
No files found.
gcc/go/gofrontend/expressions.cc
View file @
54ba9323
...
@@ -5859,13 +5859,21 @@ Binary_expression::do_get_tree(Translate_context* context)
...
@@ -5859,13 +5859,21 @@ Binary_expression::do_get_tree(Translate_context* context)
tree
eval_saved
=
NULL_TREE
;
tree
eval_saved
=
NULL_TREE
;
if
(
is_shift_op
)
if
(
is_shift_op
)
{
{
if
(
!
DECL_P
(
left
))
left
=
save_expr
(
left
);
if
(
!
DECL_P
(
right
))
right
=
save_expr
(
right
);
// Make sure the values are evaluated.
// Make sure the values are evaluated.
eval_saved
=
fold_build2_loc
(
this
->
location
(),
COMPOUND_EXPR
,
if
(
!
DECL_P
(
left
)
&&
TREE_SIDE_EFFECTS
(
left
))
void_type_node
,
left
,
right
);
{
left
=
save_expr
(
left
);
eval_saved
=
left
;
}
if
(
!
DECL_P
(
right
)
&&
TREE_SIDE_EFFECTS
(
right
))
{
right
=
save_expr
(
right
);
if
(
eval_saved
==
NULL_TREE
)
eval_saved
=
right
;
else
eval_saved
=
fold_build2_loc
(
this
->
location
(),
COMPOUND_EXPR
,
void_type_node
,
eval_saved
,
right
);
}
}
}
tree
ret
=
fold_build2_loc
(
this
->
location
(),
tree
ret
=
fold_build2_loc
(
this
->
location
(),
...
@@ -5914,8 +5922,9 @@ Binary_expression::do_get_tree(Translate_context* context)
...
@@ -5914,8 +5922,9 @@ Binary_expression::do_get_tree(Translate_context* context)
ret
=
fold_build3_loc
(
this
->
location
(),
COND_EXPR
,
TREE_TYPE
(
left
),
ret
=
fold_build3_loc
(
this
->
location
(),
COND_EXPR
,
TREE_TYPE
(
left
),
compare
,
ret
,
overflow_result
);
compare
,
ret
,
overflow_result
);
ret
=
fold_build2_loc
(
this
->
location
(),
COMPOUND_EXPR
,
if
(
eval_saved
!=
NULL_TREE
)
TREE_TYPE
(
ret
),
eval_saved
,
ret
);
ret
=
fold_build2_loc
(
this
->
location
(),
COMPOUND_EXPR
,
TREE_TYPE
(
ret
),
eval_saved
,
ret
);
}
}
return
ret
;
return
ret
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment