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
3b998c11
Commit
3b998c11
authored
May 25, 1992
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
From-SVN: r1079
parent
1ce634c3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
11 deletions
+64
-11
gcc/explow.c
+12
-8
gcc/fold-const.c
+43
-0
gcc/reload1.c
+9
-3
No files found.
gcc/explow.c
View file @
3b998c11
...
...
@@ -846,14 +846,18 @@ allocate_dynamic_stack_space (size, target, known_align)
#ifdef MUST_ALIGN
if
(
GET_CODE
(
size
)
==
CONST_INT
)
size
=
gen_rtx
(
CONST_INT
,
VOIDmode
,
INTVAL
(
size
)
+
(
BIGGEST_ALIGNMENT
/
BITS_PER_UNIT
-
1
));
else
size
=
expand_binop
(
Pmode
,
add_optab
,
size
,
gen_rtx
(
CONST_INT
,
VOIDmode
,
BIGGEST_ALIGNMENT
/
BITS_PER_UNIT
-
1
),
0
,
1
,
OPTAB_LIB_WIDEN
);
if
(
known_align
%
BIGGEST_ALIGNMENT
!=
0
)
{
if
(
GET_CODE
(
size
)
==
CONST_INT
)
size
=
gen_rtx
(
CONST_INT
,
VOIDmode
,
(
INTVAL
(
size
)
+
(
BIGGEST_ALIGNMENT
/
BITS_PER_UNIT
-
1
)));
else
size
=
expand_binop
(
Pmode
,
add_optab
,
size
,
gen_rtx
(
CONST_INT
,
VOIDmode
,
BIGGEST_ALIGNMENT
/
BITS_PER_UNIT
-
1
),
0
,
1
,
OPTAB_LIB_WIDEN
);
}
#endif
#ifdef SETJMP_VIA_SAVE_AREA
...
...
gcc/fold-const.c
View file @
3b998c11
...
...
@@ -3140,6 +3140,49 @@ fold (expr)
return
non_lvalue
(
convert
(
type
,
arg0
));
if
(
integer_zerop
(
arg1
))
return
t
;
/* If we have ((a * C1) / C2) and C1 % C2 == 0, we can replace this with
(a * (C1/C2). Also look for when we have a SAVE_EXPR in
between. */
if
(
TREE_CODE
(
arg1
)
==
INTEGER_CST
&&
TREE_INT_CST_LOW
(
arg1
)
>
0
&&
TREE_INT_CST_HIGH
(
arg1
)
==
0
&&
TREE_CODE
(
arg0
)
==
MULT_EXPR
&&
TREE_CODE
(
TREE_OPERAND
(
arg0
,
1
))
==
INTEGER_CST
&&
TREE_INT_CST_LOW
(
TREE_OPERAND
(
arg0
,
1
))
>
0
&&
TREE_INT_CST_HIGH
(
TREE_OPERAND
(
arg0
,
1
))
==
0
&&
0
==
(
TREE_INT_CST_LOW
(
TREE_OPERAND
(
arg0
,
1
))
%
TREE_INT_CST_LOW
(
arg1
)))
{
tree
new_op
=
build_int_2
(
TREE_INT_CST_LOW
(
TREE_OPERAND
(
arg0
,
1
))
/
TREE_INT_CST_LOW
(
arg1
));
TREE_TYPE
(
new_op
)
=
type
;
return
build
(
MULT_EXPR
,
type
,
TREE_OPERAND
(
arg0
,
0
),
new_op
);
}
else
if
(
TREE_CODE
(
arg1
)
==
INTEGER_CST
&&
TREE_INT_CST_LOW
(
arg1
)
>
0
&&
TREE_INT_CST_HIGH
(
arg1
)
==
0
&&
TREE_CODE
(
arg0
)
==
SAVE_EXPR
&&
TREE_CODE
(
TREE_OPERAND
(
arg0
,
0
))
==
MULT_EXPR
&&
(
TREE_CODE
(
TREE_OPERAND
(
TREE_OPERAND
(
arg0
,
0
),
1
))
==
INTEGER_CST
)
&&
(
TREE_INT_CST_LOW
(
TREE_OPERAND
(
TREE_OPERAND
(
arg0
,
0
),
1
))
>
0
)
&&
(
TREE_INT_CST_HIGH
(
TREE_OPERAND
(
TREE_OPERAND
(
arg0
,
0
),
1
))
==
0
)
&&
(
TREE_INT_CST_LOW
(
TREE_OPERAND
(
TREE_OPERAND
(
arg0
,
0
),
1
))
%
TREE_INT_CST_LOW
(
arg1
))
==
0
)
{
tree
new_op
=
build_int_2
(
TREE_INT_CST_LOW
(
TREE_OPERAND
(
TREE_OPERAND
(
arg0
,
0
),
1
))
/
TREE_INT_CST_LOW
(
arg1
));
TREE_TYPE
(
new_op
)
=
type
;
return
build
(
MULT_EXPR
,
type
,
TREE_OPERAND
(
TREE_OPERAND
(
arg0
,
0
),
0
),
new_op
);
}
#if !defined (REAL_IS_NOT_DOUBLE) || defined (REAL_ARITHMETIC)
#ifndef REAL_INFINITY
if
(
TREE_CODE
(
arg1
)
==
REAL_CST
...
...
gcc/reload1.c
View file @
3b998c11
...
...
@@ -5522,7 +5522,9 @@ gen_input_reload (reloadreg, in, before_insn, is_asm)
else
if
(
GET_RTX_CLASS
(
GET_CODE
(
in
))
==
'o'
||
GET_CODE
(
in
)
==
SUBREG
)
{
rtx
x
=
emit_insn_before
(
gen_move_insn
(
reloadreg
,
in
),
before_insn
);
if
(
is_asm
&&
recog_memoized
(
x
)
<
0
)
if
(
is_asm
&&
(
recog_memoized
(
x
)
<
0
||
(
insn_extract
(
x
),
!
constrain_operands
(
INSN_CODE
(
x
),
1
))))
{
delete_insn
(
x
);
return
0
;
...
...
@@ -5534,7 +5536,9 @@ gen_input_reload (reloadreg, in, before_insn, is_asm)
{
rtx
x
=
emit_insn_before
(
gen_reload_load_address
(
reloadreg
,
in
),
before_insn
);
if
(
is_asm
&&
recog_memoized
(
x
)
<
0
)
if
(
is_asm
&&
(
recog_memoized
(
x
)
<
0
||
(
insn_extract
(
x
),
!
constrain_operands
(
INSN_CODE
(
x
),
1
))))
{
delete_insn
(
x
);
return
0
;
...
...
@@ -5547,7 +5551,9 @@ gen_input_reload (reloadreg, in, before_insn, is_asm)
{
rtx
x
=
emit_insn_before
(
gen_rtx
(
SET
,
VOIDmode
,
reloadreg
,
in
),
before_insn
);
if
(
is_asm
&&
recog_memoized
(
x
)
<
0
)
if
(
is_asm
&&
(
recog_memoized
(
x
)
<
0
||
(
insn_extract
(
x
),
!
constrain_operands
(
INSN_CODE
(
x
),
1
))))
{
delete_insn
(
x
);
return
0
;
...
...
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