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
c9529354
Commit
c9529354
authored
Mar 13, 1994
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(convert_to_integer): When changing type of truthvalue operation,
change types of inputs too. From-SVN: r6771
parent
2e15b172
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
6 deletions
+20
-6
gcc/convert.c
+20
-6
No files found.
gcc/convert.c
View file @
c9529354
/* Utility routines for data type conversion for GNU C.
Copyright (C) 1987, 1988, 1991, 1992 Free Software Foundation, Inc.
Copyright (C) 1987, 1988, 1991, 1992
, 1994
Free Software Foundation, Inc.
This file is part of GNU C.
...
...
@@ -143,16 +143,30 @@ convert_to_integer (type, expr)
/* 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). */
type of the expression. For logical operations, we must
also change the types of the operands to maintain type
correctness. */
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_XOR_EXPR
||
ex_form
==
TRUTH_NOT_EXPR
)
if
(
TREE_CODE_CLASS
(
ex_form
)
==
'<'
)
{
TREE_TYPE
(
expr
)
=
type
;
return
expr
;
}
else
if
(
ex_form
==
TRUTH_AND_EXPR
||
ex_form
==
TRUTH_ANDIF_EXPR
||
ex_form
==
TRUTH_OR_EXPR
||
ex_form
==
TRUTH_ORIF_EXPR
||
ex_form
==
TRUTH_XOR_EXPR
)
{
TREE_OPERAND
(
expr
,
0
)
=
convert
(
type
,
TREE_OPERAND
(
expr
,
0
));
TREE_OPERAND
(
expr
,
1
)
=
convert
(
type
,
TREE_OPERAND
(
expr
,
1
));
TREE_TYPE
(
expr
)
=
type
;
return
expr
;
}
else
if
(
ex_form
==
TRUTH_NOT_EXPR
)
{
TREE_OPERAND
(
expr
,
0
)
=
convert
(
type
,
TREE_OPERAND
(
expr
,
0
));
TREE_TYPE
(
expr
)
=
type
;
return
expr
;
}
else
if
(
outprec
>=
inprec
)
return
build1
(
NOP_EXPR
,
type
,
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