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
f3964bb8
Commit
f3964bb8
authored
Jul 17, 1992
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(convert_to_integer): Don't add a NOP_EXPR in cases where we can
simply change the type of the entire tree. From-SVN: r1616
parent
0c2e838b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
17 deletions
+14
-17
gcc/c-convert.c
+14
-17
No files found.
gcc/c-convert.c
View file @
f3964bb8
...
@@ -137,7 +137,20 @@ convert_to_integer (type, expr)
...
@@ -137,7 +137,20 @@ convert_to_integer (type, expr)
register
unsigned
inprec
=
TYPE_PRECISION
(
intype
);
register
unsigned
inprec
=
TYPE_PRECISION
(
intype
);
register
enum
tree_code
ex_form
=
TREE_CODE
(
expr
);
register
enum
tree_code
ex_form
=
TREE_CODE
(
expr
);
if
(
outprec
>=
inprec
)
/* If we are widening the type, put in an explicit conversion.
Similarly if we are not changing the width. However, if this is
a logical operation that just returns 0 or 1, we can change the
type of the expression (see below). */
if
(
TREE_CODE_CLASS
(
ex_form
)
==
'<'
||
ex_form
==
TRUTH_AND_EXPR
||
ex_form
==
TRUTH_ANDIF_EXPR
||
ex_form
==
TRUTH_OR_EXPR
||
ex_form
==
TRUTH_ORIF_EXPR
||
ex_form
==
TRUTH_NOT_EXPR
)
{
TREE_TYPE
(
expr
)
=
type
;
return
expr
;
}
else
if
(
outprec
>=
inprec
)
return
build1
(
NOP_EXPR
,
type
,
expr
);
return
build1
(
NOP_EXPR
,
type
,
expr
);
/* Here detect when we can distribute the truncation down past some arithmetic.
/* Here detect when we can distribute the truncation down past some arithmetic.
...
@@ -250,22 +263,6 @@ convert_to_integer (type, expr)
...
@@ -250,22 +263,6 @@ convert_to_integer (type, expr)
}
}
break
;
break
;
case
EQ_EXPR
:
case
NE_EXPR
:
case
GT_EXPR
:
case
GE_EXPR
:
case
LT_EXPR
:
case
LE_EXPR
:
case
TRUTH_AND_EXPR
:
case
TRUTH_ANDIF_EXPR
:
case
TRUTH_OR_EXPR
:
case
TRUTH_ORIF_EXPR
:
case
TRUTH_NOT_EXPR
:
/* If we want result of comparison converted to a byte,
we can just regard it as a byte, since it is 0 or 1. */
TREE_TYPE
(
expr
)
=
type
;
return
expr
;
case
NEGATE_EXPR
:
case
NEGATE_EXPR
:
case
BIT_NOT_EXPR
:
case
BIT_NOT_EXPR
:
{
{
...
...
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