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
7c7b029d
Commit
7c7b029d
authored
May 24, 1992
by
Richard Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
From-SVN: r1070
parent
329d2160
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
8 deletions
+21
-8
gcc/fold-const.c
+21
-8
No files found.
gcc/fold-const.c
View file @
7c7b029d
...
@@ -45,6 +45,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
...
@@ -45,6 +45,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "flags.h"
#include "flags.h"
#include "tree.h"
#include "tree.h"
/* Handle floating overflow for `const_binop'. */
static
jmp_buf
float_error
;
void
lshift_double
();
void
lshift_double
();
void
rshift_double
();
void
rshift_double
();
void
lrotate_double
();
void
lrotate_double
();
...
@@ -938,9 +941,6 @@ split_tree (in, code, varp, conp, varsignp)
...
@@ -938,9 +941,6 @@ split_tree (in, code, varp, conp, varsignp)
We assume ARG1 and ARG2 have the same data type,
We assume ARG1 and ARG2 have the same data type,
or at least are the same kind of constant and the same machine mode. */
or at least are the same kind of constant and the same machine mode. */
/* Handle floating overflow for `const_binop'. */
static
jmp_buf
const_binop_error
;
static
tree
static
tree
const_binop
(
code
,
arg1
,
arg2
)
const_binop
(
code
,
arg1
,
arg2
)
enum
tree_code
code
;
enum
tree_code
code
;
...
@@ -1165,15 +1165,16 @@ const_binop (code, arg1, arg2)
...
@@ -1165,15 +1165,16 @@ const_binop (code, arg1, arg2)
register
REAL_VALUE_TYPE
d1
;
register
REAL_VALUE_TYPE
d1
;
register
REAL_VALUE_TYPE
d2
;
register
REAL_VALUE_TYPE
d2
;
register
REAL_VALUE_TYPE
value
;
register
REAL_VALUE_TYPE
value
;
tree
t
;
d1
=
TREE_REAL_CST
(
arg1
);
d1
=
TREE_REAL_CST
(
arg1
);
d2
=
TREE_REAL_CST
(
arg2
);
d2
=
TREE_REAL_CST
(
arg2
);
if
(
setjmp
(
const_binop
_error
))
if
(
setjmp
(
float
_error
))
{
{
warning
(
"floating overflow in constant folding"
);
warning
(
"floating overflow in constant folding"
);
return
build
(
code
,
TREE_TYPE
(
arg1
),
arg1
,
arg2
);
return
build
(
code
,
TREE_TYPE
(
arg1
),
arg1
,
arg2
);
}
}
set_float_handler
(
const_binop
_error
);
set_float_handler
(
float
_error
);
#ifdef REAL_ARITHMETIC
#ifdef REAL_ARITHMETIC
REAL_ARITHMETIC
(
value
,
code
,
d1
,
d2
);
REAL_ARITHMETIC
(
value
,
code
,
d1
,
d2
);
...
@@ -1213,9 +1214,10 @@ const_binop (code, arg1, arg2)
...
@@ -1213,9 +1214,10 @@ const_binop (code, arg1, arg2)
abort
();
abort
();
}
}
#endif
/* no REAL_ARITHMETIC */
#endif
/* no REAL_ARITHMETIC */
set_float_handler
(
0
);
t
=
build_real
(
TREE_TYPE
(
arg1
),
return
build_real
(
TREE_TYPE
(
arg1
),
REAL_VALUE_TRUNCATE
(
TYPE_MODE
(
TREE_TYPE
(
arg1
)),
value
));
REAL_VALUE_TRUNCATE
(
TYPE_MODE
(
TREE_TYPE
(
arg1
)),
value
));
set_float_handler
(
0
);
return
t
;
}
}
#endif
/* not REAL_IS_NOT_DOUBLE, or REAL_ARITHMETIC */
#endif
/* not REAL_IS_NOT_DOUBLE, or REAL_ARITHMETIC */
if
(
TREE_CODE
(
arg1
)
==
COMPLEX_CST
)
if
(
TREE_CODE
(
arg1
)
==
COMPLEX_CST
)
...
@@ -1413,8 +1415,19 @@ fold_convert (t, arg1)
...
@@ -1413,8 +1415,19 @@ fold_convert (t, arg1)
return
build_real_from_int_cst
(
type
,
arg1
);
return
build_real_from_int_cst
(
type
,
arg1
);
#endif
/* not REAL_IS_NOT_DOUBLE, or REAL_ARITHMETIC */
#endif
/* not REAL_IS_NOT_DOUBLE, or REAL_ARITHMETIC */
if
(
TREE_CODE
(
arg1
)
==
REAL_CST
)
if
(
TREE_CODE
(
arg1
)
==
REAL_CST
)
return
build_real
(
type
,
REAL_VALUE_TRUNCATE
(
TYPE_MODE
(
type
),
{
if
(
setjmp
(
float_error
))
{
warning
(
"floating overflow in constant folding"
);
return
t
;
}
set_float_handler
(
float_error
);
t
=
build_real
(
type
,
REAL_VALUE_TRUNCATE
(
TYPE_MODE
(
type
),
TREE_REAL_CST
(
arg1
)));
TREE_REAL_CST
(
arg1
)));
set_float_handler
(
0
);
return
t
;
}
}
}
TREE_CONSTANT
(
t
)
=
1
;
TREE_CONSTANT
(
t
)
=
1
;
return
t
;
return
t
;
...
...
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