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
af5bdf6a
Commit
af5bdf6a
authored
Apr 02, 2004
by
Waldek Hebisch
Committed by
Richard Henderson
Apr 01, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* fold-const.c (folda): Preserve types of comparisons.
From-SVN: r80327
parent
354d4c68
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
gcc/ChangeLog
+4
-0
gcc/fold-const.c
+7
-7
No files found.
gcc/ChangeLog
View file @
af5bdf6a
2004-04-01 Waldek Hebisch <hebisch@math.uni.wroc.pl>
* fold-const.c (folda): Preserve types of comparisons.
2004-04-01 Richard Henderson <rth@redhat.com>
* toplev.c (backend_init): Move init_optimization_passes call ...
...
...
gcc/fold-const.c
View file @
af5bdf6a
...
...
@@ -5366,7 +5366,7 @@ tree_swap_operands_p (tree arg0, tree arg1, bool reorder)
The related simplifications include x*1 => x, x*0 => 0, etc.,
and application of the associative law.
NOP_EXPR conversions may be removed freely (as long as we
are careful not to change the
C type of the overall expression)
are careful not to change the
type of the overall expression).
We cannot simplify through a CONVERT_EXPR, FIX_EXPR or FLOAT_EXPR,
but we can constant-fold them if they have constant operands. */
...
...
@@ -7173,9 +7173,9 @@ fold (tree expr)
&&
integer_zerop
(
arg1
))
{
if
(
code
==
EQ_EXPR
)
return
integer_zero_node
;
return
fold_convert
(
type
,
integer_zero_node
)
;
else
return
integer_one_node
;
return
fold_convert
(
type
,
integer_one_node
)
;
}
/* If this is an equality comparison of the address of two non-weak,
...
...
@@ -7196,11 +7196,11 @@ fold (tree expr)
&&
!
DECL_EXTERNAL
(
TREE_OPERAND
(
arg1
,
0
)))
{
if
(
code
==
EQ_EXPR
)
return
(
operand_equal_p
(
arg0
,
arg1
,
0
)
?
integer_one_node
:
integer_zero_node
);
return
fold_convert
(
type
,
(
operand_equal_p
(
arg0
,
arg1
,
0
)
?
integer_one_node
:
integer_zero_node
)
)
;
else
return
(
operand_equal_p
(
arg0
,
arg1
,
0
)
?
integer_zero_node
:
integer_one_node
);
return
fold_convert
(
type
,
(
operand_equal_p
(
arg0
,
arg1
,
0
)
?
integer_zero_node
:
integer_one_node
)
)
;
}
if
(
FLOAT_TYPE_P
(
TREE_TYPE
(
arg0
)))
...
...
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