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
e428d738
Commit
e428d738
authored
Nov 12, 1999
by
Bernd Schmidt
Committed by
Bernd Schmidt
Nov 12, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove useless code
From-SVN: r30499
parent
68ed151f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
49 deletions
+14
-49
gcc/ChangeLog
+13
-0
gcc/cse.c
+1
-49
No files found.
gcc/ChangeLog
View file @
e428d738
Fri
Nov
12
12
:
36
:
04
1999
Bernd
Schmidt
<
bernds
@cygnus
.
co
.
uk
>
*
cse
.
c
(
hash_arg_in_struct
)
:
Delete
.
(
struct
table_elt
)
:
Delete
elt
in_struct
.
(
struct
set
)
:
Delete
elt
src_in_struct
.
(
merge_equiv_classes
)
:
Don
'
t
set
either
hash_arg_in_struct
or
the
corresponding
in_struct
elts
.
(
canon_hash
)
:
Likewise
.
(
safe_hash
)
:
Likewise
.
(
find_best_addr
)
:
Likewise
.
(
record_jump_cond
)
:
Likewise
.
(
cse_insn
)
:
Likewise
.
Thu
Nov
11
19
:
45
:
24
1999
Jim
Wilson
<
wilson
@cygnus
.
com
>
Thu
Nov
11
19
:
45
:
24
1999
Jim
Wilson
<
wilson
@cygnus
.
com
>
*
loop
.
c
(
invariant_p
,
case
MEM
):
Put
MEM_VOLATILE_P
check
back
.
*
loop
.
c
(
invariant_p
,
case
MEM
):
Put
MEM_VOLATILE_P
check
back
.
...
...
gcc/cse.c
View file @
e428d738
...
@@ -388,11 +388,6 @@ static rtx memory_extend_rtx;
...
@@ -388,11 +388,6 @@ static rtx memory_extend_rtx;
static
int
hash_arg_in_memory
;
static
int
hash_arg_in_memory
;
/* canon_hash stores 1 in hash_arg_in_struct
if it notices a reference to memory that's part of a structure. */
static
int
hash_arg_in_struct
;
/* The hash table contains buckets which are chains of `struct table_elt's,
/* The hash table contains buckets which are chains of `struct table_elt's,
each recording one expression's information.
each recording one expression's information.
That expression is in the `exp' field.
That expression is in the `exp' field.
...
@@ -414,9 +409,6 @@ static int hash_arg_in_struct;
...
@@ -414,9 +409,6 @@ static int hash_arg_in_struct;
the address is either a symbol constant or a constant plus
the address is either a symbol constant or a constant plus
the frame pointer or argument pointer.
the frame pointer or argument pointer.
The `in_struct' field is nonzero for elements that
involve any reference to memory inside a structure or array.
The `related_value' field is used to connect related expressions
The `related_value' field is used to connect related expressions
(that differ by adding an integer).
(that differ by adding an integer).
The related expressions are chained in a circular fashion.
The related expressions are chained in a circular fashion.
...
@@ -448,7 +440,6 @@ struct table_elt
...
@@ -448,7 +440,6 @@ struct table_elt
int
cost
;
int
cost
;
enum
machine_mode
mode
;
enum
machine_mode
mode
;
char
in_memory
;
char
in_memory
;
char
in_struct
;
char
is_const
;
char
is_const
;
char
flag
;
char
flag
;
};
};
...
@@ -1683,7 +1674,6 @@ merge_equiv_classes (class1, class2)
...
@@ -1683,7 +1674,6 @@ merge_equiv_classes (class1, class2)
if
(
GET_CODE
(
exp
)
==
REG
||
exp_equiv_p
(
exp
,
exp
,
1
,
0
))
if
(
GET_CODE
(
exp
)
==
REG
||
exp_equiv_p
(
exp
,
exp
,
1
,
0
))
{
{
hash_arg_in_memory
=
0
;
hash_arg_in_memory
=
0
;
hash_arg_in_struct
=
0
;
hash
=
HASH
(
exp
,
mode
);
hash
=
HASH
(
exp
,
mode
);
if
(
GET_CODE
(
exp
)
==
REG
)
if
(
GET_CODE
(
exp
)
==
REG
)
...
@@ -1698,7 +1688,6 @@ merge_equiv_classes (class1, class2)
...
@@ -1698,7 +1688,6 @@ merge_equiv_classes (class1, class2)
}
}
new
=
insert
(
exp
,
class1
,
hash
,
mode
);
new
=
insert
(
exp
,
class1
,
hash
,
mode
);
new
->
in_memory
=
hash_arg_in_memory
;
new
->
in_memory
=
hash_arg_in_memory
;
new
->
in_struct
=
hash_arg_in_struct
;
}
}
}
}
}
}
...
@@ -2099,8 +2088,6 @@ use_related_value (x, elt)
...
@@ -2099,8 +2088,6 @@ use_related_value (x, elt)
Store 1 in hash_arg_in_memory if X contains a MEM rtx
Store 1 in hash_arg_in_memory if X contains a MEM rtx
which does not have the RTX_UNCHANGING_P bit set.
which does not have the RTX_UNCHANGING_P bit set.
In this case, also store 1 in hash_arg_in_struct
if there is a MEM rtx which has the MEM_IN_STRUCT_P bit set.
Note that cse_insn knows that the hash code of a MEM expression
Note that cse_insn knows that the hash code of a MEM expression
is just (int) MEM plus the hash code of the address. */
is just (int) MEM plus the hash code of the address. */
...
@@ -2212,7 +2199,6 @@ canon_hash (x, mode)
...
@@ -2212,7 +2199,6 @@ canon_hash (x, mode)
if
(
!
RTX_UNCHANGING_P
(
x
)
||
FIXED_BASE_PLUS_P
(
XEXP
(
x
,
0
)))
if
(
!
RTX_UNCHANGING_P
(
x
)
||
FIXED_BASE_PLUS_P
(
XEXP
(
x
,
0
)))
{
{
hash_arg_in_memory
=
1
;
hash_arg_in_memory
=
1
;
if
(
MEM_IN_STRUCT_P
(
x
))
hash_arg_in_struct
=
1
;
}
}
/* Now that we have already found this special case,
/* Now that we have already found this special case,
might as well speed it up as much as possible. */
might as well speed it up as much as possible. */
...
@@ -2294,10 +2280,8 @@ safe_hash (x, mode)
...
@@ -2294,10 +2280,8 @@ safe_hash (x, mode)
{
{
int
save_do_not_record
=
do_not_record
;
int
save_do_not_record
=
do_not_record
;
int
save_hash_arg_in_memory
=
hash_arg_in_memory
;
int
save_hash_arg_in_memory
=
hash_arg_in_memory
;
int
save_hash_arg_in_struct
=
hash_arg_in_struct
;
unsigned
hash
=
canon_hash
(
x
,
mode
);
unsigned
hash
=
canon_hash
(
x
,
mode
);
hash_arg_in_memory
=
save_hash_arg_in_memory
;
hash_arg_in_memory
=
save_hash_arg_in_memory
;
hash_arg_in_struct
=
save_hash_arg_in_struct
;
do_not_record
=
save_do_not_record
;
do_not_record
=
save_do_not_record
;
return
hash
;
return
hash
;
}
}
...
@@ -2842,7 +2826,6 @@ find_best_addr (insn, loc)
...
@@ -2842,7 +2826,6 @@ find_best_addr (insn, loc)
#endif
#endif
int
save_do_not_record
=
do_not_record
;
int
save_do_not_record
=
do_not_record
;
int
save_hash_arg_in_memory
=
hash_arg_in_memory
;
int
save_hash_arg_in_memory
=
hash_arg_in_memory
;
int
save_hash_arg_in_struct
=
hash_arg_in_struct
;
int
addr_volatile
;
int
addr_volatile
;
int
regno
;
int
regno
;
unsigned
hash
;
unsigned
hash
;
...
@@ -2898,7 +2881,6 @@ find_best_addr (insn, loc)
...
@@ -2898,7 +2881,6 @@ find_best_addr (insn, loc)
addr_volatile
=
do_not_record
;
addr_volatile
=
do_not_record
;
do_not_record
=
save_do_not_record
;
do_not_record
=
save_do_not_record
;
hash_arg_in_memory
=
save_hash_arg_in_memory
;
hash_arg_in_memory
=
save_hash_arg_in_memory
;
hash_arg_in_struct
=
save_hash_arg_in_struct
;
if
(
addr_volatile
)
if
(
addr_volatile
)
return
;
return
;
...
@@ -2987,7 +2969,6 @@ find_best_addr (insn, loc)
...
@@ -2987,7 +2969,6 @@ find_best_addr (insn, loc)
hash
=
HASH
(
XEXP
(
*
loc
,
0
),
Pmode
);
hash
=
HASH
(
XEXP
(
*
loc
,
0
),
Pmode
);
do_not_record
=
save_do_not_record
;
do_not_record
=
save_do_not_record
;
hash_arg_in_memory
=
save_hash_arg_in_memory
;
hash_arg_in_memory
=
save_hash_arg_in_memory
;
hash_arg_in_struct
=
save_hash_arg_in_struct
;
elt
=
lookup
(
XEXP
(
*
loc
,
0
),
hash
,
Pmode
);
elt
=
lookup
(
XEXP
(
*
loc
,
0
),
hash
,
Pmode
);
if
(
elt
==
0
)
if
(
elt
==
0
)
...
@@ -4355,7 +4336,7 @@ record_jump_cond (code, mode, op0, op1, reversed_nonequality)
...
@@ -4355,7 +4336,7 @@ record_jump_cond (code, mode, op0, op1, reversed_nonequality)
int
reversed_nonequality
;
int
reversed_nonequality
;
{
{
unsigned
op0_hash
,
op1_hash
;
unsigned
op0_hash
,
op1_hash
;
int
op0_in_memory
,
op
0_in_struct
,
op1_in_memory
,
op1_in_struct
;
int
op0_in_memory
,
op
1_in_memory
;
struct
table_elt
*
op0_elt
,
*
op1_elt
;
struct
table_elt
*
op0_elt
,
*
op1_elt
;
/* If OP0 and OP1 are known equal, and either is a paradoxical SUBREG,
/* If OP0 and OP1 are known equal, and either is a paradoxical SUBREG,
...
@@ -4425,20 +4406,16 @@ record_jump_cond (code, mode, op0, op1, reversed_nonequality)
...
@@ -4425,20 +4406,16 @@ record_jump_cond (code, mode, op0, op1, reversed_nonequality)
do_not_record
=
0
;
do_not_record
=
0
;
hash_arg_in_memory
=
0
;
hash_arg_in_memory
=
0
;
hash_arg_in_struct
=
0
;
op0_hash
=
HASH
(
op0
,
mode
);
op0_hash
=
HASH
(
op0
,
mode
);
op0_in_memory
=
hash_arg_in_memory
;
op0_in_memory
=
hash_arg_in_memory
;
op0_in_struct
=
hash_arg_in_struct
;
if
(
do_not_record
)
if
(
do_not_record
)
return
;
return
;
do_not_record
=
0
;
do_not_record
=
0
;
hash_arg_in_memory
=
0
;
hash_arg_in_memory
=
0
;
hash_arg_in_struct
=
0
;
op1_hash
=
HASH
(
op1
,
mode
);
op1_hash
=
HASH
(
op1
,
mode
);
op1_in_memory
=
hash_arg_in_memory
;
op1_in_memory
=
hash_arg_in_memory
;
op1_in_struct
=
hash_arg_in_struct
;
if
(
do_not_record
)
if
(
do_not_record
)
return
;
return
;
...
@@ -4491,7 +4468,6 @@ record_jump_cond (code, mode, op0, op1, reversed_nonequality)
...
@@ -4491,7 +4468,6 @@ record_jump_cond (code, mode, op0, op1, reversed_nonequality)
op0_elt
=
insert
(
op0
,
NULL_PTR
,
op0_hash
,
mode
);
op0_elt
=
insert
(
op0
,
NULL_PTR
,
op0_hash
,
mode
);
op0_elt
->
in_memory
=
op0_in_memory
;
op0_elt
->
in_memory
=
op0_in_memory
;
op0_elt
->
in_struct
=
op0_in_struct
;
}
}
qty_comparison_code
[
REG_QTY
(
REGNO
(
op0
))]
=
code
;
qty_comparison_code
[
REG_QTY
(
REGNO
(
op0
))]
=
code
;
...
@@ -4511,7 +4487,6 @@ record_jump_cond (code, mode, op0, op1, reversed_nonequality)
...
@@ -4511,7 +4487,6 @@ record_jump_cond (code, mode, op0, op1, reversed_nonequality)
op1_elt
=
insert
(
op1
,
NULL_PTR
,
op1_hash
,
mode
);
op1_elt
=
insert
(
op1
,
NULL_PTR
,
op1_hash
,
mode
);
op1_elt
->
in_memory
=
op1_in_memory
;
op1_elt
->
in_memory
=
op1_in_memory
;
op1_elt
->
in_struct
=
op1_in_struct
;
}
}
qty_comparison_qty
[
REG_QTY
(
REGNO
(
op0
))]
=
REG_QTY
(
REGNO
(
op1
));
qty_comparison_qty
[
REG_QTY
(
REGNO
(
op0
))]
=
REG_QTY
(
REGNO
(
op1
));
...
@@ -4539,7 +4514,6 @@ record_jump_cond (code, mode, op0, op1, reversed_nonequality)
...
@@ -4539,7 +4514,6 @@ record_jump_cond (code, mode, op0, op1, reversed_nonequality)
op0_elt
=
insert
(
op0
,
NULL_PTR
,
op0_hash
,
mode
);
op0_elt
=
insert
(
op0
,
NULL_PTR
,
op0_hash
,
mode
);
op0_elt
->
in_memory
=
op0_in_memory
;
op0_elt
->
in_memory
=
op0_in_memory
;
op0_elt
->
in_struct
=
op0_in_struct
;
}
}
if
(
op1_elt
==
0
)
if
(
op1_elt
==
0
)
...
@@ -4552,7 +4526,6 @@ record_jump_cond (code, mode, op0, op1, reversed_nonequality)
...
@@ -4552,7 +4526,6 @@ record_jump_cond (code, mode, op0, op1, reversed_nonequality)
op1_elt
=
insert
(
op1
,
NULL_PTR
,
op1_hash
,
mode
);
op1_elt
=
insert
(
op1
,
NULL_PTR
,
op1_hash
,
mode
);
op1_elt
->
in_memory
=
op1_in_memory
;
op1_elt
->
in_memory
=
op1_in_memory
;
op1_elt
->
in_struct
=
op1_in_struct
;
}
}
merge_equiv_classes
(
op0_elt
,
op1_elt
);
merge_equiv_classes
(
op0_elt
,
op1_elt
);
...
@@ -4587,8 +4560,6 @@ struct set
...
@@ -4587,8 +4560,6 @@ struct set
rtx
inner_dest
;
rtx
inner_dest
;
/* Nonzero if the SET_SRC is in memory. */
/* Nonzero if the SET_SRC is in memory. */
char
src_in_memory
;
char
src_in_memory
;
/* Nonzero if the SET_SRC is in a structure. */
char
src_in_struct
;
/* Nonzero if the SET_SRC contains something
/* Nonzero if the SET_SRC contains something
whose value cannot be predicted and understood. */
whose value cannot be predicted and understood. */
char
src_volatile
;
char
src_volatile
;
...
@@ -4622,7 +4593,6 @@ cse_insn (insn, libcall_insn)
...
@@ -4622,7 +4593,6 @@ cse_insn (insn, libcall_insn)
struct
table_elt
*
src_eqv_elt
=
0
;
struct
table_elt
*
src_eqv_elt
=
0
;
int
src_eqv_volatile
=
0
;
int
src_eqv_volatile
=
0
;
int
src_eqv_in_memory
=
0
;
int
src_eqv_in_memory
=
0
;
int
src_eqv_in_struct
=
0
;
unsigned
src_eqv_hash
=
0
;
unsigned
src_eqv_hash
=
0
;
struct
set
*
sets
=
NULL_PTR
;
struct
set
*
sets
=
NULL_PTR
;
...
@@ -4871,7 +4841,6 @@ cse_insn (insn, libcall_insn)
...
@@ -4871,7 +4841,6 @@ cse_insn (insn, libcall_insn)
eqvmode
=
GET_MODE
(
SUBREG_REG
(
XEXP
(
dest
,
0
)));
eqvmode
=
GET_MODE
(
SUBREG_REG
(
XEXP
(
dest
,
0
)));
do_not_record
=
0
;
do_not_record
=
0
;
hash_arg_in_memory
=
0
;
hash_arg_in_memory
=
0
;
hash_arg_in_struct
=
0
;
src_eqv
=
fold_rtx
(
src_eqv
,
insn
);
src_eqv
=
fold_rtx
(
src_eqv
,
insn
);
src_eqv_hash
=
HASH
(
src_eqv
,
eqvmode
);
src_eqv_hash
=
HASH
(
src_eqv
,
eqvmode
);
...
@@ -4882,7 +4851,6 @@ cse_insn (insn, libcall_insn)
...
@@ -4882,7 +4851,6 @@ cse_insn (insn, libcall_insn)
src_eqv_volatile
=
do_not_record
;
src_eqv_volatile
=
do_not_record
;
src_eqv_in_memory
=
hash_arg_in_memory
;
src_eqv_in_memory
=
hash_arg_in_memory
;
src_eqv_in_struct
=
hash_arg_in_struct
;
}
}
/* If this is a STRICT_LOW_PART assignment, src_eqv corresponds to the
/* If this is a STRICT_LOW_PART assignment, src_eqv corresponds to the
...
@@ -4926,13 +4894,11 @@ cse_insn (insn, libcall_insn)
...
@@ -4926,13 +4894,11 @@ cse_insn (insn, libcall_insn)
prevent any further processing of this assignment. */
prevent any further processing of this assignment. */
do_not_record
=
0
;
do_not_record
=
0
;
hash_arg_in_memory
=
0
;
hash_arg_in_memory
=
0
;
hash_arg_in_struct
=
0
;
sets
[
i
].
src
=
src
;
sets
[
i
].
src
=
src
;
sets
[
i
].
src_hash
=
HASH
(
src
,
mode
);
sets
[
i
].
src_hash
=
HASH
(
src
,
mode
);
sets
[
i
].
src_volatile
=
do_not_record
;
sets
[
i
].
src_volatile
=
do_not_record
;
sets
[
i
].
src_in_memory
=
hash_arg_in_memory
;
sets
[
i
].
src_in_memory
=
hash_arg_in_memory
;
sets
[
i
].
src_in_struct
=
hash_arg_in_struct
;
/* If SRC is a MEM, there is a REG_EQUIV note for SRC, and DEST is
/* If SRC is a MEM, there is a REG_EQUIV note for SRC, and DEST is
a pseudo that is set more than once, do not record SRC. Using
a pseudo that is set more than once, do not record SRC. Using
...
@@ -5480,12 +5446,10 @@ cse_insn (insn, libcall_insn)
...
@@ -5480,12 +5446,10 @@ cse_insn (insn, libcall_insn)
{
{
do_not_record
=
0
;
do_not_record
=
0
;
hash_arg_in_memory
=
0
;
hash_arg_in_memory
=
0
;
hash_arg_in_struct
=
0
;
sets
[
i
].
src
=
src
;
sets
[
i
].
src
=
src
;
sets
[
i
].
src_hash
=
HASH
(
src
,
mode
);
sets
[
i
].
src_hash
=
HASH
(
src
,
mode
);
sets
[
i
].
src_volatile
=
do_not_record
;
sets
[
i
].
src_volatile
=
do_not_record
;
sets
[
i
].
src_in_memory
=
hash_arg_in_memory
;
sets
[
i
].
src_in_memory
=
hash_arg_in_memory
;
sets
[
i
].
src_in_struct
=
hash_arg_in_struct
;
sets
[
i
].
src_elt
=
lookup
(
src
,
sets
[
i
].
src_hash
,
mode
);
sets
[
i
].
src_elt
=
lookup
(
src
,
sets
[
i
].
src_hash
,
mode
);
}
}
...
@@ -5723,7 +5687,6 @@ cse_insn (insn, libcall_insn)
...
@@ -5723,7 +5687,6 @@ cse_insn (insn, libcall_insn)
}
}
elt
=
insert
(
src_eqv
,
classp
,
src_eqv_hash
,
eqvmode
);
elt
=
insert
(
src_eqv
,
classp
,
src_eqv_hash
,
eqvmode
);
elt
->
in_memory
=
src_eqv_in_memory
;
elt
->
in_memory
=
src_eqv_in_memory
;
elt
->
in_struct
=
src_eqv_in_struct
;
src_eqv_elt
=
elt
;
src_eqv_elt
=
elt
;
/* Check to see if src_eqv_elt is the same as a set source which
/* Check to see if src_eqv_elt is the same as a set source which
...
@@ -5780,7 +5743,6 @@ cse_insn (insn, libcall_insn)
...
@@ -5780,7 +5743,6 @@ cse_insn (insn, libcall_insn)
}
}
elt
=
insert
(
src
,
classp
,
sets
[
i
].
src_hash
,
mode
);
elt
=
insert
(
src
,
classp
,
sets
[
i
].
src_hash
,
mode
);
elt
->
in_memory
=
sets
[
i
].
src_in_memory
;
elt
->
in_memory
=
sets
[
i
].
src_in_memory
;
elt
->
in_struct
=
sets
[
i
].
src_in_struct
;
sets
[
i
].
src_elt
=
classp
=
elt
;
sets
[
i
].
src_elt
=
classp
=
elt
;
}
}
else
else
...
@@ -5982,15 +5944,6 @@ cse_insn (insn, libcall_insn)
...
@@ -5982,15 +5944,6 @@ cse_insn (insn, libcall_insn)
||
FIXED_BASE_PLUS_P
(
XEXP
(
sets
[
i
].
inner_dest
,
||
FIXED_BASE_PLUS_P
(
XEXP
(
sets
[
i
].
inner_dest
,
0
))));
0
))));
if
(
elt
->
in_memory
)
{
/* This implicitly assumes a whole struct
need not have MEM_IN_STRUCT_P.
But a whole struct is *supposed* to have MEM_IN_STRUCT_P. */
elt
->
in_struct
=
(
MEM_IN_STRUCT_P
(
sets
[
i
].
inner_dest
)
||
sets
[
i
].
inner_dest
!=
SET_DEST
(
sets
[
i
].
rtl
));
}
/* If we have (set (subreg:m1 (reg:m2 foo) 0) (bar:m1)), M1 is no
/* If we have (set (subreg:m1 (reg:m2 foo) 0) (bar:m1)), M1 is no
narrower than M2, and both M1 and M2 are the same number of words,
narrower than M2, and both M1 and M2 are the same number of words,
we are also doing (set (reg:m2 foo) (subreg:m2 (bar:m1) 0)) so
we are also doing (set (reg:m2 foo) (subreg:m2 (bar:m1) 0)) so
...
@@ -6047,7 +6000,6 @@ cse_insn (insn, libcall_insn)
...
@@ -6047,7 +6000,6 @@ cse_insn (insn, libcall_insn)
}
}
src_elt
=
insert
(
new_src
,
classp
,
src_hash
,
new_mode
);
src_elt
=
insert
(
new_src
,
classp
,
src_hash
,
new_mode
);
src_elt
->
in_memory
=
elt
->
in_memory
;
src_elt
->
in_memory
=
elt
->
in_memory
;
src_elt
->
in_struct
=
elt
->
in_struct
;
}
}
else
if
(
classp
&&
classp
!=
src_elt
->
first_same_value
)
else
if
(
classp
&&
classp
!=
src_elt
->
first_same_value
)
/* Show that two things that we've seen before are
/* Show that two things that we've seen before are
...
...
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