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
7f0b305c
Commit
7f0b305c
authored
Jan 10, 1995
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(fold): Avoid infinite recursion caused by last change.
From-SVN: r8730
parent
dddd8006
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
gcc/fold-const.c
+7
-5
No files found.
gcc/fold-const.c
View file @
7f0b305c
...
...
@@ -3366,17 +3366,17 @@ fold (expr)
tree
inter_type
=
TREE_TYPE
(
TREE_OPERAND
(
t
,
0
));
tree
final_type
=
TREE_TYPE
(
t
);
int
inside_int
=
INTEGRAL_TYPE_P
(
inside_type
);
int
inside_ptr
=
TREE_CODE
(
inside_type
)
==
POINTER_TYPE
;
int
inside_ptr
=
POINTER_TYPE_P
(
inside_type
)
;
int
inside_float
=
FLOAT_TYPE_P
(
inside_type
);
int
inside_prec
=
TYPE_PRECISION
(
inside_type
);
int
inside_unsignedp
=
TREE_UNSIGNED
(
inside_type
);
int
inter_int
=
INTEGRAL_TYPE_P
(
inter_type
);
int
inter_ptr
=
TREE_CODE
(
inter_type
)
==
POINTER_TYPE
;
int
inter_ptr
=
POINTER_TYPE_P
(
inter_type
)
;
int
inter_float
=
FLOAT_TYPE_P
(
inter_type
);
int
inter_prec
=
TYPE_PRECISION
(
inter_type
);
int
inter_unsignedp
=
TREE_UNSIGNED
(
inter_type
);
int
final_int
=
INTEGRAL_TYPE_P
(
final_type
);
int
final_ptr
=
TREE_CODE
(
final_type
)
==
POINTER_TYPE
;
int
final_ptr
=
POINTER_TYPE_P
(
final_type
)
;
int
final_float
=
FLOAT_TYPE_P
(
final_type
);
int
final_prec
=
TYPE_PRECISION
(
final_type
);
int
final_unsignedp
=
TREE_UNSIGNED
(
final_type
);
...
...
@@ -3393,11 +3393,13 @@ fold (expr)
/* Likewise, if the intermediate and final types are either both
float or both integer, we don't need the middle conversion if
it is wider than the final type and doesn't change the signedness
(for integers). */
(for integers). Avoid this if the final type is a pointer
since then we sometimes need the inner conversion. */
if
((((
inter_int
||
inter_ptr
)
&&
(
inside_int
||
inside_ptr
))
||
(
inter_float
&&
inside_float
))
&&
inter_prec
>=
inside_prec
&&
(
inter_float
||
inter_unsignedp
==
inside_unsignedp
))
&&
(
inter_float
||
inter_unsignedp
==
inside_unsignedp
)
&&
!
final_ptr
)
return
convert
(
final_type
,
TREE_OPERAND
(
TREE_OPERAND
(
t
,
0
),
0
));
/* Two conversions in a row are not needed unless:
...
...
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