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
2df46b06
Commit
2df46b06
authored
Aug 19, 1993
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(fold): Handle EQ_EXPR and NE_EXPR where both args are comparisons or
BIT_AND_EXPR with constant 1. From-SVN: r5186
parent
0dc92bf6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
gcc/fold-const.c
+15
-4
No files found.
gcc/fold-const.c
View file @
2df46b06
...
...
@@ -3167,9 +3167,11 @@ fold (expr)
one of the operands is a comparison and the other is either a comparison
or a BIT_AND_EXPR with the constant 1. In that case, the code below
would make the expression more complex. Change it to a
TRUTH_{AND,OR}_EXPR. */
TRUTH_{AND,OR}_EXPR. Likewise, convert a similar NE_EXPR to
TRUTH_XOR_EXPR and an EQ_EXPR to the inversion of a TRUTH_XOR_EXPR. */
if
((
code
==
BIT_AND_EXPR
||
code
==
BIT_IOR_EXPR
)
if
((
code
==
BIT_AND_EXPR
||
code
==
BIT_IOR_EXPR
||
code
==
EQ_EXPR
||
code
==
NE_EXPR
)
&&
((
TREE_CODE_CLASS
(
TREE_CODE
(
arg0
))
==
'<'
&&
(
TREE_CODE_CLASS
(
TREE_CODE
(
arg1
))
==
'<'
||
(
TREE_CODE
(
arg1
)
==
BIT_AND_EXPR
...
...
@@ -3178,8 +3180,17 @@ fold (expr)
&&
(
TREE_CODE_CLASS
(
TREE_CODE
(
arg0
))
==
'<'
||
(
TREE_CODE
(
arg0
)
==
BIT_AND_EXPR
&&
integer_onep
(
TREE_OPERAND
(
arg0
,
1
)))))))
return
fold
(
build
(
code
==
BIT_AND_EXPR
?
TRUTH_AND_EXPR
:
TRUTH_OR_EXPR
,
type
,
arg0
,
arg1
));
{
t
=
fold
(
build
(
code
==
BIT_AND_EXPR
?
TRUTH_AND_EXPR
:
code
==
BIT_IOR_EXPR
?
TRUTH_OR_EXPR
:
TRUTH_XOR_EXPR
,
type
,
arg0
,
arg1
));
if
(
code
==
EQ_EXPR
)
t
=
invert_truthvalue
(
t
);
return
t
;
}
if
(
TREE_CODE_CLASS
(
code
)
==
'1'
)
{
...
...
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