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
eceef4c9
Commit
eceef4c9
authored
Sep 12, 1999
by
Bernd Schmidt
Committed by
Bernd Schmidt
Sep 12, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use structures not many single arrays in reload
From-SVN: r29361
parent
c2a37c55
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
899 additions
and
902 deletions
+899
-902
gcc/ChangeLog
+23
-0
gcc/reload.c
+383
-457
gcc/reload.h
+75
-25
gcc/reload1.c
+418
-420
No files found.
gcc/ChangeLog
View file @
eceef4c9
Sun
Sep
12
15
:
53
:
20
1999
Bernd
Schmidt
<
bernds
@cygnus
.
co
.
uk
>
*
reload
.
h
(
reload_in
,
reload_out
,
reload_in_reg
,
reload_out_reg
,
reload_reg_class
,
reload_inmode
,
reload_outmode
,
reload_optional
,
reload_nongroup
,
reload_inc
,
reload_opnum
,
reload_secondary_p
,
reload_secondary_in_reload
,
reload_secondary_out_reload
,
reload_secondary_in_icode
,
reload_secondary_out_icode
,
reload_reg_rtx
,
reload_when_needed
)
:
Delete
declarations
.
(
struct
reload
)
:
New
structure
.
(
rld
)
:
Declare
new
array
.
*
reload
.
c
(
reload_in
,
reload_out
,
reload_in_reg
,
reload_out_reg
,
reload_reg_class
,
reload_inmode
,
reload_outmode
,
reload_optional
,
reload_nongroup
,
reload_inc
,
reload_opnum
,
reload_secondary_p
,
reload_secondary_in_reload
,
reload_secondary_out_reload
,
reload_secondary_in_icode
,
reload_secondary_out_icode
,
reload_reg_rtx
,
reload_when_needed
)
:
Delete
definitions
.
(
rld
)
:
New
array
.
(
whole
file
)
:
Replace
uses
of
the
deleted
arrays
with
uses
of
rld
.
*
reload1
.
c
(
whole
file
)
:
Replace
uses
of
the
deleted
arrays
with
uses
of
rld
.
(
choose_reload_regs
)
:
Copy
in
/
out
of
save_reload_reg_rtx
with
explicit
loops
,
not
with
bcopy
.
Sun
Sep
12
05
:
00
:
24
1999
Richard
Henderson
<
rth
@cygnus
.
com
>
Sun
Sep
12
05
:
00
:
24
1999
Richard
Henderson
<
rth
@cygnus
.
com
>
*
recog
.
h
(
insn_template
,
insn_outfun
,
insn_n_operands
,
insn_n_dups
,
*
recog
.
h
(
insn_template
,
insn_outfun
,
insn_n_operands
,
insn_n_dups
,
...
...
gcc/reload.c
View file @
eceef4c9
...
@@ -115,82 +115,10 @@ a register with any other reload. */
...
@@ -115,82 +115,10 @@ a register with any other reload. */
#define REG_MODE_OK_FOR_BASE_P(REGNO, MODE) REG_OK_FOR_BASE_P (REGNO)
#define REG_MODE_OK_FOR_BASE_P(REGNO, MODE) REG_OK_FOR_BASE_P (REGNO)
#endif
#endif
/* The variables set up by `find_reloads' are:
/* All reloads of the current insn are recorded here. See reload.h for
comments. */
n_reloads number of distinct reloads needed; max reload # + 1
tables indexed by reload number
reload_in rtx for value to reload from
reload_out rtx for where to store reload-reg afterward if nec
(often the same as reload_in)
reload_reg_class enum reg_class, saying what regs to reload into
reload_inmode enum machine_mode; mode this operand should have
when reloaded, on input.
reload_outmode enum machine_mode; mode this operand should have
when reloaded, on output.
reload_optional char, nonzero for an optional reload.
Optional reloads are ignored unless the
value is already sitting in a register.
reload_nongroup char, nonzero when a reload must use a register
not already allocated to a group.
reload_inc int, positive amount to increment or decrement by if
reload_in is a PRE_DEC, PRE_INC, POST_DEC, POST_INC.
Ignored otherwise (don't assume it is zero).
reload_in_reg rtx. A reg for which reload_in is the equivalent.
If reload_in is a symbol_ref which came from
reg_equiv_constant, then this is the pseudo
which has that symbol_ref as equivalent.
reload_reg_rtx rtx. This is the register to reload into.
If it is zero when `find_reloads' returns,
you must find a suitable register in the class
specified by reload_reg_class, and store here
an rtx for that register with mode from
reload_inmode or reload_outmode.
reload_nocombine char, nonzero if this reload shouldn't be
combined with another reload.
reload_opnum int, operand number being reloaded. This is
used to group related reloads and need not always
be equal to the actual operand number in the insn,
though it current will be; for in-out operands, it
is one of the two operand numbers.
reload_when_needed enum, classifies reload as needed either for
addressing an input reload, addressing an output,
for addressing a non-reloaded mem ref,
or for unspecified purposes (i.e., more than one
of the above).
reload_secondary_p int, 1 if this is a secondary register for one
or more reloads.
reload_secondary_in_reload
reload_secondary_out_reload
int, gives the reload number of a secondary
reload, when needed; otherwise -1
reload_secondary_in_icode
reload_secondary_out_icode
enum insn_code, if a secondary reload is required,
gives the INSN_CODE that uses the secondary
reload as a scratch register, or CODE_FOR_nothing
if the secondary reload register is to be an
intermediate register. */
int
n_reloads
;
int
n_reloads
;
struct
reload
rld
[
MAX_RELOADS
];
rtx
reload_in
[
MAX_RELOADS
];
rtx
reload_out
[
MAX_RELOADS
];
enum
reg_class
reload_reg_class
[
MAX_RELOADS
];
enum
machine_mode
reload_inmode
[
MAX_RELOADS
];
enum
machine_mode
reload_outmode
[
MAX_RELOADS
];
rtx
reload_reg_rtx
[
MAX_RELOADS
];
char
reload_optional
[
MAX_RELOADS
];
char
reload_nongroup
[
MAX_RELOADS
];
int
reload_inc
[
MAX_RELOADS
];
rtx
reload_in_reg
[
MAX_RELOADS
];
rtx
reload_out_reg
[
MAX_RELOADS
];
char
reload_nocombine
[
MAX_RELOADS
];
int
reload_opnum
[
MAX_RELOADS
];
enum
reload_type
reload_when_needed
[
MAX_RELOADS
];
int
reload_secondary_p
[
MAX_RELOADS
];
int
reload_secondary_in_reload
[
MAX_RELOADS
];
int
reload_secondary_out_reload
[
MAX_RELOADS
];
enum
insn_code
reload_secondary_in_icode
[
MAX_RELOADS
];
enum
insn_code
reload_secondary_out_icode
[
MAX_RELOADS
];
/* All the "earlyclobber" operands of the current insn
/* All the "earlyclobber" operands of the current insn
are recorded here. */
are recorded here. */
...
@@ -496,58 +424,58 @@ push_secondary_reload (in_p, x, opnum, optional, reload_class, reload_mode,
...
@@ -496,58 +424,58 @@ push_secondary_reload (in_p, x, opnum, optional, reload_class, reload_mode,
if
(
t_class
!=
NO_REGS
)
if
(
t_class
!=
NO_REGS
)
{
{
for
(
t_reload
=
0
;
t_reload
<
n_reloads
;
t_reload
++
)
for
(
t_reload
=
0
;
t_reload
<
n_reloads
;
t_reload
++
)
if
(
r
eload_secondary_p
[
t_reload
]
if
(
r
ld
[
t_reload
].
secondary_p
&&
(
reg_class_subset_p
(
t_class
,
r
eload_reg_class
[
t_reload
]
)
&&
(
reg_class_subset_p
(
t_class
,
r
ld
[
t_reload
].
class
)
||
reg_class_subset_p
(
r
eload_reg_class
[
t_reload
]
,
t_class
))
||
reg_class_subset_p
(
r
ld
[
t_reload
].
class
,
t_class
))
&&
((
in_p
&&
r
eload_inmode
[
t_reload
]
==
t_mode
)
&&
((
in_p
&&
r
ld
[
t_reload
].
inmode
==
t_mode
)
||
(
!
in_p
&&
r
eload_outmode
[
t_reload
]
==
t_mode
))
||
(
!
in_p
&&
r
ld
[
t_reload
].
outmode
==
t_mode
))
&&
((
in_p
&&
(
r
eload_secondary_in_icode
[
t_reload
]
&&
((
in_p
&&
(
r
ld
[
t_reload
].
secondary_in_icode
==
CODE_FOR_nothing
))
==
CODE_FOR_nothing
))
||
(
!
in_p
&&
(
r
eload_secondary_out_icode
[
t_reload
]
||
(
!
in_p
&&
(
r
ld
[
t_reload
].
secondary_out_icode
==
CODE_FOR_nothing
)))
==
CODE_FOR_nothing
)))
&&
(
reg_class_size
[(
int
)
t_class
]
==
1
||
SMALL_REGISTER_CLASSES
)
&&
(
reg_class_size
[(
int
)
t_class
]
==
1
||
SMALL_REGISTER_CLASSES
)
&&
MERGABLE_RELOADS
(
secondary_type
,
&&
MERGABLE_RELOADS
(
secondary_type
,
r
eload_when_needed
[
t_reload
]
,
r
ld
[
t_reload
].
when_needed
,
opnum
,
r
eload_opnum
[
t_reload
]
))
opnum
,
r
ld
[
t_reload
].
opnum
))
{
{
if
(
in_p
)
if
(
in_p
)
r
eload_inmode
[
t_reload
]
=
t_mode
;
r
ld
[
t_reload
].
inmode
=
t_mode
;
if
(
!
in_p
)
if
(
!
in_p
)
r
eload_outmode
[
t_reload
]
=
t_mode
;
r
ld
[
t_reload
].
outmode
=
t_mode
;
if
(
reg_class_subset_p
(
t_class
,
r
eload_reg_class
[
t_reload
]
))
if
(
reg_class_subset_p
(
t_class
,
r
ld
[
t_reload
].
class
))
r
eload_reg_class
[
t_reload
]
=
t_class
;
r
ld
[
t_reload
].
class
=
t_class
;
r
eload_opnum
[
t_reload
]
=
MIN
(
reload_opnum
[
t_reload
]
,
opnum
);
r
ld
[
t_reload
].
opnum
=
MIN
(
rld
[
t_reload
].
opnum
,
opnum
);
r
eload_optional
[
t_reload
]
&=
optional
;
r
ld
[
t_reload
].
optional
&=
optional
;
r
eload_secondary_p
[
t_reload
]
=
1
;
r
ld
[
t_reload
].
secondary_p
=
1
;
if
(
MERGE_TO_OTHER
(
secondary_type
,
r
eload_when_needed
[
t_reload
]
,
if
(
MERGE_TO_OTHER
(
secondary_type
,
r
ld
[
t_reload
].
when_needed
,
opnum
,
r
eload_opnum
[
t_reload
]
))
opnum
,
r
ld
[
t_reload
].
opnum
))
r
eload_when_needed
[
t_reload
]
=
RELOAD_OTHER
;
r
ld
[
t_reload
].
when_needed
=
RELOAD_OTHER
;
}
}
if
(
t_reload
==
n_reloads
)
if
(
t_reload
==
n_reloads
)
{
{
/* We need to make a new tertiary reload for this register class. */
/* We need to make a new tertiary reload for this register class. */
r
eload_in
[
t_reload
]
=
reload_out
[
t_reload
]
=
0
;
r
ld
[
t_reload
].
in
=
rld
[
t_reload
].
out
=
0
;
r
eload_reg_class
[
t_reload
]
=
t_class
;
r
ld
[
t_reload
].
class
=
t_class
;
r
eload_inmode
[
t_reload
]
=
in_p
?
t_mode
:
VOIDmode
;
r
ld
[
t_reload
].
inmode
=
in_p
?
t_mode
:
VOIDmode
;
r
eload_outmode
[
t_reload
]
=
!
in_p
?
t_mode
:
VOIDmode
;
r
ld
[
t_reload
].
outmode
=
!
in_p
?
t_mode
:
VOIDmode
;
r
eload_reg_rtx
[
t_reload
]
=
0
;
r
ld
[
t_reload
].
reg_rtx
=
0
;
r
eload_optional
[
t_reload
]
=
optional
;
r
ld
[
t_reload
].
optional
=
optional
;
r
eload_nongroup
[
t_reload
]
=
0
;
r
ld
[
t_reload
].
nongroup
=
0
;
r
eload_inc
[
t_reload
]
=
0
;
r
ld
[
t_reload
].
inc
=
0
;
/* Maybe we could combine these, but it seems too tricky. */
/* Maybe we could combine these, but it seems too tricky. */
r
eload_nocombine
[
t_reload
]
=
1
;
r
ld
[
t_reload
].
nocombine
=
1
;
r
eload_in_reg
[
t_reload
]
=
0
;
r
ld
[
t_reload
].
in_reg
=
0
;
r
eload_out_reg
[
t_reload
]
=
0
;
r
ld
[
t_reload
].
out_reg
=
0
;
r
eload_opnum
[
t_reload
]
=
opnum
;
r
ld
[
t_reload
].
opnum
=
opnum
;
r
eload_when_needed
[
t_reload
]
=
secondary_type
;
r
ld
[
t_reload
].
when_needed
=
secondary_type
;
r
eload_secondary_in_reload
[
t_reload
]
=
-
1
;
r
ld
[
t_reload
].
secondary_in_reload
=
-
1
;
r
eload_secondary_out_reload
[
t_reload
]
=
-
1
;
r
ld
[
t_reload
].
secondary_out_reload
=
-
1
;
r
eload_secondary_in_icode
[
t_reload
]
=
CODE_FOR_nothing
;
r
ld
[
t_reload
].
secondary_in_icode
=
CODE_FOR_nothing
;
r
eload_secondary_out_icode
[
t_reload
]
=
CODE_FOR_nothing
;
r
ld
[
t_reload
].
secondary_out_icode
=
CODE_FOR_nothing
;
r
eload_secondary_p
[
t_reload
]
=
1
;
r
ld
[
t_reload
].
secondary_p
=
1
;
n_reloads
++
;
n_reloads
++
;
}
}
...
@@ -555,33 +483,33 @@ push_secondary_reload (in_p, x, opnum, optional, reload_class, reload_mode,
...
@@ -555,33 +483,33 @@ push_secondary_reload (in_p, x, opnum, optional, reload_class, reload_mode,
/* See if we can reuse an existing secondary reload. */
/* See if we can reuse an existing secondary reload. */
for
(
s_reload
=
0
;
s_reload
<
n_reloads
;
s_reload
++
)
for
(
s_reload
=
0
;
s_reload
<
n_reloads
;
s_reload
++
)
if
(
r
eload_secondary_p
[
s_reload
]
if
(
r
ld
[
s_reload
].
secondary_p
&&
(
reg_class_subset_p
(
class
,
r
eload_reg_class
[
s_reload
]
)
&&
(
reg_class_subset_p
(
class
,
r
ld
[
s_reload
].
class
)
||
reg_class_subset_p
(
r
eload_reg_class
[
s_reload
]
,
class
))
||
reg_class_subset_p
(
r
ld
[
s_reload
].
class
,
class
))
&&
((
in_p
&&
r
eload_inmode
[
s_reload
]
==
mode
)
&&
((
in_p
&&
r
ld
[
s_reload
].
inmode
==
mode
)
||
(
!
in_p
&&
r
eload_outmode
[
s_reload
]
==
mode
))
||
(
!
in_p
&&
r
ld
[
s_reload
].
outmode
==
mode
))
&&
((
in_p
&&
r
eload_secondary_in_reload
[
s_reload
]
==
t_reload
)
&&
((
in_p
&&
r
ld
[
s_reload
].
secondary_in_reload
==
t_reload
)
||
(
!
in_p
&&
r
eload_secondary_out_reload
[
s_reload
]
==
t_reload
))
||
(
!
in_p
&&
r
ld
[
s_reload
].
secondary_out_reload
==
t_reload
))
&&
((
in_p
&&
r
eload_secondary_in_icode
[
s_reload
]
==
t_icode
)
&&
((
in_p
&&
r
ld
[
s_reload
].
secondary_in_icode
==
t_icode
)
||
(
!
in_p
&&
r
eload_secondary_out_icode
[
s_reload
]
==
t_icode
))
||
(
!
in_p
&&
r
ld
[
s_reload
].
secondary_out_icode
==
t_icode
))
&&
(
reg_class_size
[(
int
)
class
]
==
1
||
SMALL_REGISTER_CLASSES
)
&&
(
reg_class_size
[(
int
)
class
]
==
1
||
SMALL_REGISTER_CLASSES
)
&&
MERGABLE_RELOADS
(
secondary_type
,
r
eload_when_needed
[
s_reload
]
,
&&
MERGABLE_RELOADS
(
secondary_type
,
r
ld
[
s_reload
].
when_needed
,
opnum
,
r
eload_opnum
[
s_reload
]
))
opnum
,
r
ld
[
s_reload
].
opnum
))
{
{
if
(
in_p
)
if
(
in_p
)
r
eload_inmode
[
s_reload
]
=
mode
;
r
ld
[
s_reload
].
inmode
=
mode
;
if
(
!
in_p
)
if
(
!
in_p
)
r
eload_outmode
[
s_reload
]
=
mode
;
r
ld
[
s_reload
].
outmode
=
mode
;
if
(
reg_class_subset_p
(
class
,
r
eload_reg_class
[
s_reload
]
))
if
(
reg_class_subset_p
(
class
,
r
ld
[
s_reload
].
class
))
r
eload_reg_class
[
s_reload
]
=
class
;
r
ld
[
s_reload
].
class
=
class
;
r
eload_opnum
[
s_reload
]
=
MIN
(
reload_opnum
[
s_reload
]
,
opnum
);
r
ld
[
s_reload
].
opnum
=
MIN
(
rld
[
s_reload
].
opnum
,
opnum
);
r
eload_optional
[
s_reload
]
&=
optional
;
r
ld
[
s_reload
].
optional
&=
optional
;
r
eload_secondary_p
[
s_reload
]
=
1
;
r
ld
[
s_reload
].
secondary_p
=
1
;
if
(
MERGE_TO_OTHER
(
secondary_type
,
r
eload_when_needed
[
s_reload
]
,
if
(
MERGE_TO_OTHER
(
secondary_type
,
r
ld
[
s_reload
].
when_needed
,
opnum
,
r
eload_opnum
[
s_reload
]
))
opnum
,
r
ld
[
s_reload
].
opnum
))
r
eload_when_needed
[
s_reload
]
=
RELOAD_OTHER
;
r
ld
[
s_reload
].
when_needed
=
RELOAD_OTHER
;
}
}
if
(
s_reload
==
n_reloads
)
if
(
s_reload
==
n_reloads
)
...
@@ -598,27 +526,27 @@ push_secondary_reload (in_p, x, opnum, optional, reload_class, reload_mode,
...
@@ -598,27 +526,27 @@ push_secondary_reload (in_p, x, opnum, optional, reload_class, reload_mode,
#endif
#endif
/* We need to make a new secondary reload for this register class. */
/* We need to make a new secondary reload for this register class. */
r
eload_in
[
s_reload
]
=
reload_out
[
s_reload
]
=
0
;
r
ld
[
s_reload
].
in
=
rld
[
s_reload
].
out
=
0
;
r
eload_reg_class
[
s_reload
]
=
class
;
r
ld
[
s_reload
].
class
=
class
;
r
eload_inmode
[
s_reload
]
=
in_p
?
mode
:
VOIDmode
;
r
ld
[
s_reload
].
inmode
=
in_p
?
mode
:
VOIDmode
;
r
eload_outmode
[
s_reload
]
=
!
in_p
?
mode
:
VOIDmode
;
r
ld
[
s_reload
].
outmode
=
!
in_p
?
mode
:
VOIDmode
;
r
eload_reg_rtx
[
s_reload
]
=
0
;
r
ld
[
s_reload
].
reg_rtx
=
0
;
r
eload_optional
[
s_reload
]
=
optional
;
r
ld
[
s_reload
].
optional
=
optional
;
r
eload_nongroup
[
s_reload
]
=
0
;
r
ld
[
s_reload
].
nongroup
=
0
;
r
eload_inc
[
s_reload
]
=
0
;
r
ld
[
s_reload
].
inc
=
0
;
/* Maybe we could combine these, but it seems too tricky. */
/* Maybe we could combine these, but it seems too tricky. */
r
eload_nocombine
[
s_reload
]
=
1
;
r
ld
[
s_reload
].
nocombine
=
1
;
r
eload_in_reg
[
s_reload
]
=
0
;
r
ld
[
s_reload
].
in_reg
=
0
;
r
eload_out_reg
[
s_reload
]
=
0
;
r
ld
[
s_reload
].
out_reg
=
0
;
r
eload_opnum
[
s_reload
]
=
opnum
;
r
ld
[
s_reload
].
opnum
=
opnum
;
r
eload_when_needed
[
s_reload
]
=
secondary_type
;
r
ld
[
s_reload
].
when_needed
=
secondary_type
;
r
eload_secondary_in_reload
[
s_reload
]
=
in_p
?
t_reload
:
-
1
;
r
ld
[
s_reload
].
secondary_in_reload
=
in_p
?
t_reload
:
-
1
;
r
eload_secondary_out_reload
[
s_reload
]
=
!
in_p
?
t_reload
:
-
1
;
r
ld
[
s_reload
].
secondary_out_reload
=
!
in_p
?
t_reload
:
-
1
;
r
eload_secondary_in_icode
[
s_reload
]
=
in_p
?
t_icode
:
CODE_FOR_nothing
;
r
ld
[
s_reload
].
secondary_in_icode
=
in_p
?
t_icode
:
CODE_FOR_nothing
;
r
eload_secondary_out_icode
[
s_reload
]
r
ld
[
s_reload
].
secondary_out_icode
=
!
in_p
?
t_icode
:
CODE_FOR_nothing
;
=
!
in_p
?
t_icode
:
CODE_FOR_nothing
;
r
eload_secondary_p
[
s_reload
]
=
1
;
r
ld
[
s_reload
].
secondary_p
=
1
;
n_reloads
++
;
n_reloads
++
;
...
@@ -783,21 +711,19 @@ find_reusable_reload (p_in, out, class, type, opnum, dont_share)
...
@@ -783,21 +711,19 @@ find_reusable_reload (p_in, out, class, type, opnum, dont_share)
than we otherwise would. */
than we otherwise would. */
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
if
((
reg_class_subset_p
(
class
,
r
eload_reg_class
[
i
]
)
if
((
reg_class_subset_p
(
class
,
r
ld
[
i
].
class
)
||
reg_class_subset_p
(
r
eload_reg_class
[
i
]
,
class
))
||
reg_class_subset_p
(
r
ld
[
i
].
class
,
class
))
/* If the existing reload has a register, it must fit our class. */
/* If the existing reload has a register, it must fit our class. */
&&
(
r
eload_reg_rtx
[
i
]
==
0
&&
(
r
ld
[
i
].
reg_rtx
==
0
||
TEST_HARD_REG_BIT
(
reg_class_contents
[(
int
)
class
],
||
TEST_HARD_REG_BIT
(
reg_class_contents
[(
int
)
class
],
true_regnum
(
reload_reg_rtx
[
i
])))
true_regnum
(
rld
[
i
].
reg_rtx
)))
&&
((
in
!=
0
&&
MATCHES
(
reload_in
[
i
],
in
)
&&
!
dont_share
&&
((
in
!=
0
&&
MATCHES
(
rld
[
i
].
in
,
in
)
&&
!
dont_share
&&
(
out
==
0
||
reload_out
[
i
]
==
0
||
MATCHES
(
reload_out
[
i
],
out
)))
&&
(
out
==
0
||
rld
[
i
].
out
==
0
||
MATCHES
(
rld
[
i
].
out
,
out
)))
||
||
(
out
!=
0
&&
MATCHES
(
rld
[
i
].
out
,
out
)
(
out
!=
0
&&
MATCHES
(
reload_out
[
i
],
out
)
&&
(
in
==
0
||
rld
[
i
].
in
==
0
||
MATCHES
(
rld
[
i
].
in
,
in
))))
&&
(
in
==
0
||
reload_in
[
i
]
==
0
||
MATCHES
(
reload_in
[
i
],
in
))))
&&
(
rld
[
i
].
out
==
0
||
!
earlyclobber_operand_p
(
rld
[
i
].
out
))
&&
(
reload_out
[
i
]
==
0
||
!
earlyclobber_operand_p
(
reload_out
[
i
]))
&&
(
reg_class_size
[(
int
)
class
]
==
1
||
SMALL_REGISTER_CLASSES
)
&&
(
reg_class_size
[(
int
)
class
]
==
1
||
SMALL_REGISTER_CLASSES
)
&&
MERGABLE_RELOADS
(
type
,
reload_when_needed
[
i
],
&&
MERGABLE_RELOADS
(
type
,
rld
[
i
].
when_needed
,
opnum
,
rld
[
i
].
opnum
))
opnum
,
reload_opnum
[
i
]))
return
i
;
return
i
;
/* Reloading a plain reg for input can match a reload to postincrement
/* Reloading a plain reg for input can match a reload to postincrement
...
@@ -806,36 +732,36 @@ find_reusable_reload (p_in, out, class, type, opnum, dont_share)
...
@@ -806,36 +732,36 @@ find_reusable_reload (p_in, out, class, type, opnum, dont_share)
the preincrementation as happening before any ref in this insn
the preincrementation as happening before any ref in this insn
to that register. */
to that register. */
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
if
((
reg_class_subset_p
(
class
,
r
eload_reg_class
[
i
]
)
if
((
reg_class_subset_p
(
class
,
r
ld
[
i
].
class
)
||
reg_class_subset_p
(
r
eload_reg_class
[
i
]
,
class
))
||
reg_class_subset_p
(
r
ld
[
i
].
class
,
class
))
/* If the existing reload has a register, it must fit our
/* If the existing reload has a register, it must fit our
class. */
class. */
&&
(
r
eload_reg_rtx
[
i
]
==
0
&&
(
r
ld
[
i
].
reg_rtx
==
0
||
TEST_HARD_REG_BIT
(
reg_class_contents
[(
int
)
class
],
||
TEST_HARD_REG_BIT
(
reg_class_contents
[(
int
)
class
],
true_regnum
(
r
eload_reg_rtx
[
i
]
)))
true_regnum
(
r
ld
[
i
].
reg_rtx
)))
&&
out
==
0
&&
r
eload_out
[
i
]
==
0
&&
reload_in
[
i
]
!=
0
&&
out
==
0
&&
r
ld
[
i
].
out
==
0
&&
rld
[
i
].
in
!=
0
&&
((
GET_CODE
(
in
)
==
REG
&&
((
GET_CODE
(
in
)
==
REG
&&
(
GET_CODE
(
r
eload_in
[
i
]
)
==
POST_INC
&&
(
GET_CODE
(
r
ld
[
i
].
in
)
==
POST_INC
||
GET_CODE
(
r
eload_in
[
i
]
)
==
POST_DEC
||
GET_CODE
(
r
ld
[
i
].
in
)
==
POST_DEC
||
GET_CODE
(
r
eload_in
[
i
]
)
==
PRE_INC
||
GET_CODE
(
r
ld
[
i
].
in
)
==
PRE_INC
||
GET_CODE
(
r
eload_in
[
i
]
)
==
PRE_DEC
)
||
GET_CODE
(
r
ld
[
i
].
in
)
==
PRE_DEC
)
&&
MATCHES
(
XEXP
(
r
eload_in
[
i
]
,
0
),
in
))
&&
MATCHES
(
XEXP
(
r
ld
[
i
].
in
,
0
),
in
))
||
||
(
GET_CODE
(
r
eload_in
[
i
]
)
==
REG
(
GET_CODE
(
r
ld
[
i
].
in
)
==
REG
&&
(
GET_CODE
(
in
)
==
POST_INC
&&
(
GET_CODE
(
in
)
==
POST_INC
||
GET_CODE
(
in
)
==
POST_DEC
||
GET_CODE
(
in
)
==
POST_DEC
||
GET_CODE
(
in
)
==
PRE_INC
||
GET_CODE
(
in
)
==
PRE_INC
||
GET_CODE
(
in
)
==
PRE_DEC
)
||
GET_CODE
(
in
)
==
PRE_DEC
)
&&
MATCHES
(
XEXP
(
in
,
0
),
r
eload_in
[
i
]
)))
&&
MATCHES
(
XEXP
(
in
,
0
),
r
ld
[
i
].
in
)))
&&
(
r
eload_out
[
i
]
==
0
||
!
earlyclobber_operand_p
(
reload_out
[
i
]
))
&&
(
r
ld
[
i
].
out
==
0
||
!
earlyclobber_operand_p
(
rld
[
i
].
out
))
&&
(
reg_class_size
[(
int
)
class
]
==
1
||
SMALL_REGISTER_CLASSES
)
&&
(
reg_class_size
[(
int
)
class
]
==
1
||
SMALL_REGISTER_CLASSES
)
&&
MERGABLE_RELOADS
(
type
,
r
eload_when_needed
[
i
]
,
&&
MERGABLE_RELOADS
(
type
,
r
ld
[
i
].
when_needed
,
opnum
,
r
eload_opnum
[
i
]
))
opnum
,
r
ld
[
i
].
opnum
))
{
{
/* Make sure reload_in ultimately has the increment,
/* Make sure reload_in ultimately has the increment,
not the plain register. */
not the plain register. */
if
(
GET_CODE
(
in
)
==
REG
)
if
(
GET_CODE
(
in
)
==
REG
)
*
p_in
=
r
eload_in
[
i
]
;
*
p_in
=
r
ld
[
i
].
in
;
return
i
;
return
i
;
}
}
return
n_reloads
;
return
n_reloads
;
...
@@ -1311,25 +1237,25 @@ push_reload (in, out, inloc, outloc, class,
...
@@ -1311,25 +1237,25 @@ push_reload (in, out, inloc, outloc, class,
#endif
#endif
i
=
n_reloads
;
i
=
n_reloads
;
r
eload_in
[
i
]
=
in
;
r
ld
[
i
].
in
=
in
;
r
eload_out
[
i
]
=
out
;
r
ld
[
i
].
out
=
out
;
r
eload_reg_class
[
i
]
=
class
;
r
ld
[
i
].
class
=
class
;
r
eload_inmode
[
i
]
=
inmode
;
r
ld
[
i
].
inmode
=
inmode
;
r
eload_outmode
[
i
]
=
outmode
;
r
ld
[
i
].
outmode
=
outmode
;
r
eload_reg_rtx
[
i
]
=
0
;
r
ld
[
i
].
reg_rtx
=
0
;
r
eload_optional
[
i
]
=
optional
;
r
ld
[
i
].
optional
=
optional
;
r
eload_nongroup
[
i
]
=
0
;
r
ld
[
i
].
nongroup
=
0
;
r
eload_inc
[
i
]
=
0
;
r
ld
[
i
].
inc
=
0
;
r
eload_nocombine
[
i
]
=
0
;
r
ld
[
i
].
nocombine
=
0
;
r
eload_in_reg
[
i
]
=
inloc
?
*
inloc
:
0
;
r
ld
[
i
].
in_reg
=
inloc
?
*
inloc
:
0
;
r
eload_out_reg
[
i
]
=
outloc
?
*
outloc
:
0
;
r
ld
[
i
].
out_reg
=
outloc
?
*
outloc
:
0
;
r
eload_opnum
[
i
]
=
opnum
;
r
ld
[
i
].
opnum
=
opnum
;
r
eload_when_needed
[
i
]
=
type
;
r
ld
[
i
].
when_needed
=
type
;
r
eload_secondary_in_reload
[
i
]
=
secondary_in_reload
;
r
ld
[
i
].
secondary_in_reload
=
secondary_in_reload
;
r
eload_secondary_out_reload
[
i
]
=
secondary_out_reload
;
r
ld
[
i
].
secondary_out_reload
=
secondary_out_reload
;
r
eload_secondary_in_icode
[
i
]
=
secondary_in_icode
;
r
ld
[
i
].
secondary_in_icode
=
secondary_in_icode
;
r
eload_secondary_out_icode
[
i
]
=
secondary_out_icode
;
r
ld
[
i
].
secondary_out_icode
=
secondary_out_icode
;
r
eload_secondary_p
[
i
]
=
0
;
r
ld
[
i
].
secondary_p
=
0
;
n_reloads
++
;
n_reloads
++
;
...
@@ -1351,11 +1277,11 @@ push_reload (in, out, inloc, outloc, class,
...
@@ -1351,11 +1277,11 @@ push_reload (in, out, inloc, outloc, class,
/* The modes can be different. If they are, we want to reload in
/* The modes can be different. If they are, we want to reload in
the larger mode, so that the value is valid for both modes. */
the larger mode, so that the value is valid for both modes. */
if
(
inmode
!=
VOIDmode
if
(
inmode
!=
VOIDmode
&&
GET_MODE_SIZE
(
inmode
)
>
GET_MODE_SIZE
(
r
eload_inmode
[
i
]
))
&&
GET_MODE_SIZE
(
inmode
)
>
GET_MODE_SIZE
(
r
ld
[
i
].
inmode
))
r
eload_inmode
[
i
]
=
inmode
;
r
ld
[
i
].
inmode
=
inmode
;
if
(
outmode
!=
VOIDmode
if
(
outmode
!=
VOIDmode
&&
GET_MODE_SIZE
(
outmode
)
>
GET_MODE_SIZE
(
r
eload_outmode
[
i
]
))
&&
GET_MODE_SIZE
(
outmode
)
>
GET_MODE_SIZE
(
r
ld
[
i
].
outmode
))
r
eload_outmode
[
i
]
=
outmode
;
r
ld
[
i
].
outmode
=
outmode
;
if
(
in
!=
0
)
if
(
in
!=
0
)
{
{
rtx
in_reg
=
inloc
?
*
inloc
:
0
;
rtx
in_reg
=
inloc
?
*
inloc
:
0
;
...
@@ -1373,35 +1299,35 @@ push_reload (in, out, inloc, outloc, class,
...
@@ -1373,35 +1299,35 @@ push_reload (in, out, inloc, outloc, class,
choose_reload_regs will remove the replacements for address
choose_reload_regs will remove the replacements for address
reloads of inherited reloads which results in the same
reloads of inherited reloads which results in the same
problem. */
problem. */
if
(
r
eload_in
[
i
]
!=
in
&&
rtx_equal_p
(
in
,
reload_in
[
i
]
)
if
(
r
ld
[
i
].
in
!=
in
&&
rtx_equal_p
(
in
,
rld
[
i
].
in
)
&&
!
(
r
eload_optional
[
i
]
&&
optional
))
&&
!
(
r
ld
[
i
].
optional
&&
optional
))
{
{
/* We must keep the address reload with the lower operand
/* We must keep the address reload with the lower operand
number alive. */
number alive. */
if
(
opnum
>
r
eload_opnum
[
i
]
)
if
(
opnum
>
r
ld
[
i
].
opnum
)
{
{
remove_address_replacements
(
in
);
remove_address_replacements
(
in
);
in
=
r
eload_in
[
i
]
;
in
=
r
ld
[
i
].
in
;
in_reg
=
r
eload_in_reg
[
i
]
;
in_reg
=
r
ld
[
i
].
in_reg
;
}
}
else
else
remove_address_replacements
(
r
eload_in
[
i
]
);
remove_address_replacements
(
r
ld
[
i
].
in
);
}
}
r
eload_in
[
i
]
=
in
;
r
ld
[
i
].
in
=
in
;
r
eload_in_reg
[
i
]
=
in_reg
;
r
ld
[
i
].
in_reg
=
in_reg
;
}
}
if
(
out
!=
0
)
if
(
out
!=
0
)
{
{
r
eload_out
[
i
]
=
out
;
r
ld
[
i
].
out
=
out
;
r
eload_out_reg
[
i
]
=
outloc
?
*
outloc
:
0
;
r
ld
[
i
].
out_reg
=
outloc
?
*
outloc
:
0
;
}
}
if
(
reg_class_subset_p
(
class
,
r
eload_reg_class
[
i
]
))
if
(
reg_class_subset_p
(
class
,
r
ld
[
i
].
class
))
r
eload_reg_class
[
i
]
=
class
;
r
ld
[
i
].
class
=
class
;
r
eload_optional
[
i
]
&=
optional
;
r
ld
[
i
].
optional
&=
optional
;
if
(
MERGE_TO_OTHER
(
type
,
r
eload_when_needed
[
i
]
,
if
(
MERGE_TO_OTHER
(
type
,
r
ld
[
i
].
when_needed
,
opnum
,
r
eload_opnum
[
i
]
))
opnum
,
r
ld
[
i
].
opnum
))
r
eload_when_needed
[
i
]
=
RELOAD_OTHER
;
r
ld
[
i
].
when_needed
=
RELOAD_OTHER
;
r
eload_opnum
[
i
]
=
MIN
(
reload_opnum
[
i
]
,
opnum
);
r
ld
[
i
].
opnum
=
MIN
(
rld
[
i
].
opnum
,
opnum
);
}
}
/* If the ostensible rtx being reload differs from the rtx found
/* If the ostensible rtx being reload differs from the rtx found
...
@@ -1409,7 +1335,7 @@ push_reload (in, out, inloc, outloc, class,
...
@@ -1409,7 +1335,7 @@ push_reload (in, out, inloc, outloc, class,
because we cannot reliably tell whether it appears in the insn. */
because we cannot reliably tell whether it appears in the insn. */
if
(
in
!=
0
&&
in
!=
*
inloc
)
if
(
in
!=
0
&&
in
!=
*
inloc
)
r
eload_nocombine
[
i
]
=
1
;
r
ld
[
i
].
nocombine
=
1
;
#if 0
#if 0
/* This was replaced by changes in find_reloads_address_1 and the new
/* This was replaced by changes in find_reloads_address_1 and the new
...
@@ -1423,12 +1349,12 @@ push_reload (in, out, inloc, outloc, class,
...
@@ -1423,12 +1349,12 @@ push_reload (in, out, inloc, outloc, class,
if (out != 0 && sets_cc0_p (PATTERN (this_insn)))
if (out != 0 && sets_cc0_p (PATTERN (this_insn)))
{
{
out = 0;
out = 0;
r
eload_out[i]
= 0;
r
ld[i].out
= 0;
r
eload_inc[i]
= find_inc_amount (PATTERN (this_insn), in);
r
ld[i].inc
= find_inc_amount (PATTERN (this_insn), in);
/* If we did not find a nonzero amount-to-increment-by,
/* If we did not find a nonzero amount-to-increment-by,
that contradicts the belief that IN is being incremented
that contradicts the belief that IN is being incremented
in an address in this insn. */
in an address in this insn. */
if (r
eload_inc[i]
== 0)
if (r
ld[i].inc
== 0)
abort ();
abort ();
}
}
#endif
#endif
...
@@ -1462,25 +1388,25 @@ push_reload (in, out, inloc, outloc, class,
...
@@ -1462,25 +1388,25 @@ push_reload (in, out, inloc, outloc, class,
supposed to be made to match, see if either one of the two
supposed to be made to match, see if either one of the two
can serve as the place to reload into.
can serve as the place to reload into.
If one of them is acceptable, set r
eload_reg_rtx[i]
If one of them is acceptable, set r
ld[i].reg_rtx
to that one. */
to that one. */
if
(
in
!=
0
&&
out
!=
0
&&
in
!=
out
&&
r
eload_reg_rtx
[
i
]
==
0
)
if
(
in
!=
0
&&
out
!=
0
&&
in
!=
out
&&
r
ld
[
i
].
reg_rtx
==
0
)
{
{
r
eload_reg_rtx
[
i
]
=
find_dummy_reload
(
in
,
out
,
inloc
,
outloc
,
r
ld
[
i
].
reg_rtx
=
find_dummy_reload
(
in
,
out
,
inloc
,
outloc
,
inmode
,
outmode
,
inmode
,
outmode
,
reload_reg_class
[
i
]
,
i
,
rld
[
i
].
class
,
i
,
earlyclobber_operand_p
(
out
));
earlyclobber_operand_p
(
out
));
/* If the outgoing register already contains the same value
/* If the outgoing register already contains the same value
as the incoming one, we can dispense with loading it.
as the incoming one, we can dispense with loading it.
The easiest way to tell the caller that is to give a phony
The easiest way to tell the caller that is to give a phony
value for the incoming operand (same as outgoing one). */
value for the incoming operand (same as outgoing one). */
if
(
r
eload_reg_rtx
[
i
]
==
out
if
(
r
ld
[
i
].
reg_rtx
==
out
&&
(
GET_CODE
(
in
)
==
REG
||
CONSTANT_P
(
in
))
&&
(
GET_CODE
(
in
)
==
REG
||
CONSTANT_P
(
in
))
&&
0
!=
find_equiv_reg
(
in
,
this_insn
,
0
,
REGNO
(
out
),
&&
0
!=
find_equiv_reg
(
in
,
this_insn
,
0
,
REGNO
(
out
),
static_reload_reg_p
,
i
,
inmode
))
static_reload_reg_p
,
i
,
inmode
))
r
eload_in
[
i
]
=
out
;
r
ld
[
i
].
in
=
out
;
}
}
/* If this is an input reload and the operand contains a register that
/* If this is an input reload and the operand contains a register that
...
@@ -1495,7 +1421,7 @@ push_reload (in, out, inloc, outloc, class,
...
@@ -1495,7 +1421,7 @@ push_reload (in, out, inloc, outloc, class,
But if there is no spilling in this block, that is OK.
But if there is no spilling in this block, that is OK.
An explicitly used hard reg cannot be a spill reg. */
An explicitly used hard reg cannot be a spill reg. */
if
(
r
eload_reg_rtx
[
i
]
==
0
&&
in
!=
0
)
if
(
r
ld
[
i
].
reg_rtx
==
0
&&
in
!=
0
)
{
{
rtx
note
;
rtx
note
;
int
regno
;
int
regno
;
...
@@ -1536,7 +1462,7 @@ push_reload (in, out, inloc, outloc, class,
...
@@ -1536,7 +1462,7 @@ push_reload (in, out, inloc, outloc, class,
&&
TEST_HARD_REG_BIT
(
reg_class_contents
[(
int
)
class
],
regno
)
&&
TEST_HARD_REG_BIT
(
reg_class_contents
[(
int
)
class
],
regno
)
&&
!
fixed_regs
[
regno
])
&&
!
fixed_regs
[
regno
])
{
{
r
eload_reg_rtx
[
i
]
=
gen_rtx_REG
(
inmode
,
regno
);
r
ld
[
i
].
reg_rtx
=
gen_rtx_REG
(
inmode
,
regno
);
break
;
break
;
}
}
}
}
...
@@ -1614,8 +1540,8 @@ remove_address_replacements (in_rtx)
...
@@ -1614,8 +1540,8 @@ remove_address_replacements (in_rtx)
if
(
reload_flags
[
i
]
==
1
)
if
(
reload_flags
[
i
]
==
1
)
{
{
deallocate_reload_reg
(
i
);
deallocate_reload_reg
(
i
);
remove_address_replacements
(
r
eload_in
[
i
]
);
remove_address_replacements
(
r
ld
[
i
].
in
);
r
eload_in
[
i
]
=
0
;
r
ld
[
i
].
in
=
0
;
something_changed
=
1
;
something_changed
=
1
;
}
}
}
}
...
@@ -1672,103 +1598,103 @@ combine_reloads ()
...
@@ -1672,103 +1598,103 @@ combine_reloads ()
and that one is mandatory. */
and that one is mandatory. */
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
if
(
r
eload_out
[
i
]
!=
0
)
if
(
r
ld
[
i
].
out
!=
0
)
{
{
if
(
output_reload
>=
0
)
if
(
output_reload
>=
0
)
return
;
return
;
output_reload
=
i
;
output_reload
=
i
;
}
}
if
(
output_reload
<
0
||
r
eload_optional
[
output_reload
]
)
if
(
output_reload
<
0
||
r
ld
[
output_reload
].
optional
)
return
;
return
;
/* An input-output reload isn't combinable. */
/* An input-output reload isn't combinable. */
if
(
r
eload_in
[
output_reload
]
!=
0
)
if
(
r
ld
[
output_reload
].
in
!=
0
)
return
;
return
;
/* If this reload is for an earlyclobber operand, we can't do anything. */
/* If this reload is for an earlyclobber operand, we can't do anything. */
if
(
earlyclobber_operand_p
(
r
eload_out
[
output_reload
]
))
if
(
earlyclobber_operand_p
(
r
ld
[
output_reload
].
out
))
return
;
return
;
/* Check each input reload; can we combine it? */
/* Check each input reload; can we combine it? */
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
if
(
r
eload_in
[
i
]
&&
!
reload_optional
[
i
]
&&
!
reload_nocombine
[
i
]
if
(
r
ld
[
i
].
in
&&
!
rld
[
i
].
optional
&&
!
rld
[
i
].
nocombine
/* Life span of this reload must not extend past main insn. */
/* Life span of this reload must not extend past main insn. */
&&
r
eload_when_needed
[
i
]
!=
RELOAD_FOR_OUTPUT_ADDRESS
&&
r
ld
[
i
].
when_needed
!=
RELOAD_FOR_OUTPUT_ADDRESS
&&
r
eload_when_needed
[
i
]
!=
RELOAD_FOR_OUTADDR_ADDRESS
&&
r
ld
[
i
].
when_needed
!=
RELOAD_FOR_OUTADDR_ADDRESS
&&
r
eload_when_needed
[
i
]
!=
RELOAD_OTHER
&&
r
ld
[
i
].
when_needed
!=
RELOAD_OTHER
&&
(
CLASS_MAX_NREGS
(
r
eload_reg_class
[
i
],
reload_inmode
[
i
]
)
&&
(
CLASS_MAX_NREGS
(
r
ld
[
i
].
class
,
rld
[
i
].
inmode
)
==
CLASS_MAX_NREGS
(
r
eload_reg_class
[
output_reload
]
,
==
CLASS_MAX_NREGS
(
r
ld
[
output_reload
].
class
,
r
eload_outmode
[
output_reload
]
))
r
ld
[
output_reload
].
outmode
))
&&
r
eload_inc
[
i
]
==
0
&&
r
ld
[
i
].
inc
==
0
&&
r
eload_reg_rtx
[
i
]
==
0
&&
r
ld
[
i
].
reg_rtx
==
0
#ifdef SECONDARY_MEMORY_NEEDED
#ifdef SECONDARY_MEMORY_NEEDED
/* Don't combine two reloads with different secondary
/* Don't combine two reloads with different secondary
memory locations. */
memory locations. */
&&
(
secondary_memlocs_elim
[(
int
)
r
eload_outmode
[
output_reload
]][
reload_opnum
[
i
]
]
==
0
&&
(
secondary_memlocs_elim
[(
int
)
r
ld
[
output_reload
].
outmode
][
rld
[
i
].
opnum
]
==
0
||
secondary_memlocs_elim
[(
int
)
r
eload_outmode
[
output_reload
]][
reload_opnum
[
output_reload
]
]
==
0
||
secondary_memlocs_elim
[(
int
)
r
ld
[
output_reload
].
outmode
][
rld
[
output_reload
].
opnum
]
==
0
||
rtx_equal_p
(
secondary_memlocs_elim
[(
int
)
r
eload_outmode
[
output_reload
]][
reload_opnum
[
i
]
],
||
rtx_equal_p
(
secondary_memlocs_elim
[(
int
)
r
ld
[
output_reload
].
outmode
][
rld
[
i
].
opnum
],
secondary_memlocs_elim
[(
int
)
r
eload_outmode
[
output_reload
]][
reload_opnum
[
output_reload
]
]))
secondary_memlocs_elim
[(
int
)
r
ld
[
output_reload
].
outmode
][
rld
[
output_reload
].
opnum
]))
#endif
#endif
&&
(
SMALL_REGISTER_CLASSES
&&
(
SMALL_REGISTER_CLASSES
?
(
r
eload_reg_class
[
i
]
==
reload_reg_class
[
output_reload
]
)
?
(
r
ld
[
i
].
class
==
rld
[
output_reload
].
class
)
:
(
reg_class_subset_p
(
r
eload_reg_class
[
i
]
,
:
(
reg_class_subset_p
(
r
ld
[
i
].
class
,
r
eload_reg_class
[
output_reload
]
)
r
ld
[
output_reload
].
class
)
||
reg_class_subset_p
(
r
eload_reg_class
[
output_reload
]
,
||
reg_class_subset_p
(
r
ld
[
output_reload
].
class
,
r
eload_reg_class
[
i
]
)))
r
ld
[
i
].
class
)))
&&
(
MATCHES
(
r
eload_in
[
i
],
reload_out
[
output_reload
]
)
&&
(
MATCHES
(
r
ld
[
i
].
in
,
rld
[
output_reload
].
out
)
/* Args reversed because the first arg seems to be
/* Args reversed because the first arg seems to be
the one that we imagine being modified
the one that we imagine being modified
while the second is the one that might be affected. */
while the second is the one that might be affected. */
||
(
!
reg_overlap_mentioned_for_reload_p
(
r
eload_out
[
output_reload
]
,
||
(
!
reg_overlap_mentioned_for_reload_p
(
r
ld
[
output_reload
].
out
,
r
eload_in
[
i
]
)
r
ld
[
i
].
in
)
/* However, if the input is a register that appears inside
/* However, if the input is a register that appears inside
the output, then we also can't share.
the output, then we also can't share.
Imagine (set (mem (reg 69)) (plus (reg 69) ...)).
Imagine (set (mem (reg 69)) (plus (reg 69) ...)).
If the same reload reg is used for both reg 69 and the
If the same reload reg is used for both reg 69 and the
result to be stored in memory, then that result
result to be stored in memory, then that result
will clobber the address of the memory ref. */
will clobber the address of the memory ref. */
&&
!
(
GET_CODE
(
r
eload_in
[
i
]
)
==
REG
&&
!
(
GET_CODE
(
r
ld
[
i
].
in
)
==
REG
&&
reg_overlap_mentioned_for_reload_p
(
r
eload_in
[
i
]
,
&&
reg_overlap_mentioned_for_reload_p
(
r
ld
[
i
].
in
,
r
eload_out
[
output_reload
]
))))
r
ld
[
output_reload
].
out
))))
&&
(
reg_class_size
[(
int
)
r
eload_reg_class
[
i
]
]
&&
(
reg_class_size
[(
int
)
r
ld
[
i
].
class
]
||
SMALL_REGISTER_CLASSES
)
||
SMALL_REGISTER_CLASSES
)
/* We will allow making things slightly worse by combining an
/* We will allow making things slightly worse by combining an
input and an output, but no worse than that. */
input and an output, but no worse than that. */
&&
(
r
eload_when_needed
[
i
]
==
RELOAD_FOR_INPUT
&&
(
r
ld
[
i
].
when_needed
==
RELOAD_FOR_INPUT
||
r
eload_when_needed
[
i
]
==
RELOAD_FOR_OUTPUT
))
||
r
ld
[
i
].
when_needed
==
RELOAD_FOR_OUTPUT
))
{
{
int
j
;
int
j
;
/* We have found a reload to combine with! */
/* We have found a reload to combine with! */
r
eload_out
[
i
]
=
reload_out
[
output_reload
]
;
r
ld
[
i
].
out
=
rld
[
output_reload
].
out
;
r
eload_out_reg
[
i
]
=
reload_out_reg
[
output_reload
]
;
r
ld
[
i
].
out_reg
=
rld
[
output_reload
].
out_reg
;
r
eload_outmode
[
i
]
=
reload_outmode
[
output_reload
]
;
r
ld
[
i
].
outmode
=
rld
[
output_reload
].
outmode
;
/* Mark the old output reload as inoperative. */
/* Mark the old output reload as inoperative. */
r
eload_out
[
output_reload
]
=
0
;
r
ld
[
output_reload
].
out
=
0
;
/* The combined reload is needed for the entire insn. */
/* The combined reload is needed for the entire insn. */
r
eload_when_needed
[
i
]
=
RELOAD_OTHER
;
r
ld
[
i
].
when_needed
=
RELOAD_OTHER
;
/* If the output reload had a secondary reload, copy it. */
/* If the output reload had a secondary reload, copy it. */
if
(
r
eload_secondary_out_reload
[
output_reload
]
!=
-
1
)
if
(
r
ld
[
output_reload
].
secondary_out_reload
!=
-
1
)
{
{
r
eload_secondary_out_reload
[
i
]
r
ld
[
i
].
secondary_out_reload
=
r
eload_secondary_out_reload
[
output_reload
]
;
=
r
ld
[
output_reload
].
secondary_out_reload
;
r
eload_secondary_out_icode
[
i
]
r
ld
[
i
].
secondary_out_icode
=
r
eload_secondary_out_icode
[
output_reload
]
;
=
r
ld
[
output_reload
].
secondary_out_icode
;
}
}
#ifdef SECONDARY_MEMORY_NEEDED
#ifdef SECONDARY_MEMORY_NEEDED
/* Copy any secondary MEM. */
/* Copy any secondary MEM. */
if
(
secondary_memlocs_elim
[(
int
)
r
eload_outmode
[
output_reload
]][
reload_opnum
[
output_reload
]
]
!=
0
)
if
(
secondary_memlocs_elim
[(
int
)
r
ld
[
output_reload
].
outmode
][
rld
[
output_reload
].
opnum
]
!=
0
)
secondary_memlocs_elim
[(
int
)
r
eload_outmode
[
output_reload
]][
reload_opnum
[
i
]
]
secondary_memlocs_elim
[(
int
)
r
ld
[
output_reload
].
outmode
][
rld
[
i
].
opnum
]
=
secondary_memlocs_elim
[(
int
)
r
eload_outmode
[
output_reload
]][
reload_opnum
[
output_reload
]
];
=
secondary_memlocs_elim
[(
int
)
r
ld
[
output_reload
].
outmode
][
rld
[
output_reload
].
opnum
];
#endif
#endif
/* If required, minimize the register class. */
/* If required, minimize the register class. */
if
(
reg_class_subset_p
(
r
eload_reg_class
[
output_reload
]
,
if
(
reg_class_subset_p
(
r
ld
[
output_reload
].
class
,
r
eload_reg_class
[
i
]
))
r
ld
[
i
].
class
))
r
eload_reg_class
[
i
]
=
reload_reg_class
[
output_reload
]
;
r
ld
[
i
].
class
=
rld
[
output_reload
].
class
;
/* Transfer all replacements from the old reload to the combined. */
/* Transfer all replacements from the old reload to the combined. */
for
(
j
=
0
;
j
<
n_replacements
;
j
++
)
for
(
j
=
0
;
j
<
n_replacements
;
j
++
)
...
@@ -1799,27 +1725,27 @@ combine_reloads ()
...
@@ -1799,27 +1725,27 @@ combine_reloads ()
if
(
REG_NOTE_KIND
(
note
)
==
REG_DEAD
if
(
REG_NOTE_KIND
(
note
)
==
REG_DEAD
&&
GET_CODE
(
XEXP
(
note
,
0
))
==
REG
&&
GET_CODE
(
XEXP
(
note
,
0
))
==
REG
&&
!
reg_overlap_mentioned_for_reload_p
(
XEXP
(
note
,
0
),
&&
!
reg_overlap_mentioned_for_reload_p
(
XEXP
(
note
,
0
),
r
eload_out
[
output_reload
]
)
r
ld
[
output_reload
].
out
)
&&
REGNO
(
XEXP
(
note
,
0
))
<
FIRST_PSEUDO_REGISTER
&&
REGNO
(
XEXP
(
note
,
0
))
<
FIRST_PSEUDO_REGISTER
&&
HARD_REGNO_MODE_OK
(
REGNO
(
XEXP
(
note
,
0
)),
r
eload_outmode
[
output_reload
]
)
&&
HARD_REGNO_MODE_OK
(
REGNO
(
XEXP
(
note
,
0
)),
r
ld
[
output_reload
].
outmode
)
&&
TEST_HARD_REG_BIT
(
reg_class_contents
[(
int
)
r
eload_reg_class
[
output_reload
]
],
&&
TEST_HARD_REG_BIT
(
reg_class_contents
[(
int
)
r
ld
[
output_reload
].
class
],
REGNO
(
XEXP
(
note
,
0
)))
REGNO
(
XEXP
(
note
,
0
)))
&&
(
HARD_REGNO_NREGS
(
REGNO
(
XEXP
(
note
,
0
)),
r
eload_outmode
[
output_reload
]
)
&&
(
HARD_REGNO_NREGS
(
REGNO
(
XEXP
(
note
,
0
)),
r
ld
[
output_reload
].
outmode
)
<=
HARD_REGNO_NREGS
(
REGNO
(
XEXP
(
note
,
0
)),
GET_MODE
(
XEXP
(
note
,
0
))))
<=
HARD_REGNO_NREGS
(
REGNO
(
XEXP
(
note
,
0
)),
GET_MODE
(
XEXP
(
note
,
0
))))
/* Ensure that a secondary or tertiary reload for this output
/* Ensure that a secondary or tertiary reload for this output
won't want this register. */
won't want this register. */
&&
((
secondary_out
=
r
eload_secondary_out_reload
[
output_reload
]
)
==
-
1
&&
((
secondary_out
=
r
ld
[
output_reload
].
secondary_out_reload
)
==
-
1
||
(
!
(
TEST_HARD_REG_BIT
||
(
!
(
TEST_HARD_REG_BIT
(
reg_class_contents
[(
int
)
r
eload_reg_class
[
secondary_out
]
],
(
reg_class_contents
[(
int
)
r
ld
[
secondary_out
].
class
],
REGNO
(
XEXP
(
note
,
0
))))
REGNO
(
XEXP
(
note
,
0
))))
&&
((
secondary_out
=
r
eload_secondary_out_reload
[
secondary_out
]
)
==
-
1
&&
((
secondary_out
=
r
ld
[
secondary_out
].
secondary_out_reload
)
==
-
1
||
!
(
TEST_HARD_REG_BIT
||
!
(
TEST_HARD_REG_BIT
(
reg_class_contents
[(
int
)
r
eload_reg_class
[
secondary_out
]
],
(
reg_class_contents
[(
int
)
r
ld
[
secondary_out
].
class
],
REGNO
(
XEXP
(
note
,
0
)))))))
REGNO
(
XEXP
(
note
,
0
)))))))
&&
!
fixed_regs
[
REGNO
(
XEXP
(
note
,
0
))])
&&
!
fixed_regs
[
REGNO
(
XEXP
(
note
,
0
))])
{
{
r
eload_reg_rtx
[
output_reload
]
r
ld
[
output_reload
].
reg_rtx
=
gen_rtx_REG
(
r
eload_outmode
[
output_reload
]
,
=
gen_rtx_REG
(
r
ld
[
output_reload
].
outmode
,
REGNO
(
XEXP
(
note
,
0
)));
REGNO
(
XEXP
(
note
,
0
)));
return
;
return
;
}
}
...
@@ -1835,7 +1761,7 @@ combine_reloads ()
...
@@ -1835,7 +1761,7 @@ combine_reloads ()
If FOR_REAL is >= 0, it is the number of the reload,
If FOR_REAL is >= 0, it is the number of the reload,
and in some cases when it can be discovered that OUT doesn't need
and in some cases when it can be discovered that OUT doesn't need
to be computed, clear out r
eload_out[FOR_REAL]
.
to be computed, clear out r
ld[FOR_REAL].out
.
If FOR_REAL is -1, this should not be done, because this call
If FOR_REAL is -1, this should not be done, because this call
is just to see if a register can be found, not to find and install it.
is just to see if a register can be found, not to find and install it.
...
@@ -1974,7 +1900,7 @@ find_dummy_reload (real_in, real_out, inloc, outloc,
...
@@ -1974,7 +1900,7 @@ find_dummy_reload (real_in, real_out, inloc, outloc,
and changed our mind, it means OUT is a dummy that
and changed our mind, it means OUT is a dummy that
dies here. So don't bother copying value to it. */
dies here. So don't bother copying value to it. */
if
(
for_real
>=
0
&&
value
==
real_out
)
if
(
for_real
>=
0
&&
value
==
real_out
)
r
eload_out
[
for_real
]
=
0
;
r
ld
[
for_real
].
out
=
0
;
if
(
GET_CODE
(
real_in
)
==
REG
)
if
(
GET_CODE
(
real_in
)
==
REG
)
value
=
real_in
;
value
=
real_in
;
else
else
...
@@ -2707,7 +2633,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
...
@@ -2707,7 +2633,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
&&
(
set
==
0
||
&
SET_DEST
(
set
)
!=
recog_data
.
operand_loc
[
i
]))
&&
(
set
==
0
||
&
SET_DEST
(
set
)
!=
recog_data
.
operand_loc
[
i
]))
{
{
/* Record the existing mode so that the check if constants are
/* Record the existing mode so that the check if constants are
allowed will work when operand_mode isn't specified. */
allowed will work when operand_mode isn't specified.
*/
if
(
operand_mode
[
i
]
==
VOIDmode
)
if
(
operand_mode
[
i
]
==
VOIDmode
)
operand_mode
[
i
]
=
GET_MODE
(
recog_data
.
operand
[
i
]);
operand_mode
[
i
]
=
GET_MODE
(
recog_data
.
operand
[
i
]);
...
@@ -2742,7 +2668,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
...
@@ -2742,7 +2668,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
"no input reloads" requirement for this insn. */
"no input reloads" requirement for this insn. */
if
(
no_input_reloads
)
if
(
no_input_reloads
)
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
if
(
r
eload_in
[
i
]
!=
0
)
if
(
r
ld
[
i
].
in
!=
0
)
abort
();
abort
();
#endif
#endif
...
@@ -3576,10 +3502,10 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
...
@@ -3576,10 +3502,10 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
{
{
if
(
r
eload_opnum
[
i
]
==
commutative
)
if
(
r
ld
[
i
].
opnum
==
commutative
)
r
eload_opnum
[
i
]
=
commutative
+
1
;
r
ld
[
i
].
opnum
=
commutative
+
1
;
else
if
(
r
eload_opnum
[
i
]
==
commutative
+
1
)
else
if
(
r
ld
[
i
].
opnum
==
commutative
+
1
)
r
eload_opnum
[
i
]
=
commutative
;
r
ld
[
i
].
opnum
=
commutative
;
}
}
}
}
...
@@ -3662,7 +3588,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
...
@@ -3662,7 +3588,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
BASE_REG_CLASS
,
BASE_REG_CLASS
,
GET_MODE
(
XEXP
(
recog_data
.
operand
[
i
],
0
)),
GET_MODE
(
XEXP
(
recog_data
.
operand
[
i
],
0
)),
VOIDmode
,
0
,
0
,
i
,
RELOAD_FOR_INPUT
);
VOIDmode
,
0
,
0
,
i
,
RELOAD_FOR_INPUT
);
r
eload_inc
[
operand_reloadnum
[
i
]]
r
ld
[
operand_reloadnum
[
i
]].
inc
=
GET_MODE_SIZE
(
GET_MODE
(
recog_data
.
operand
[
i
]));
=
GET_MODE_SIZE
(
GET_MODE
(
recog_data
.
operand
[
i
]));
/* If this operand is an output, we will have made any
/* If this operand is an output, we will have made any
...
@@ -3674,13 +3600,13 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
...
@@ -3674,13 +3600,13 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
{
{
for
(
j
=
0
;
j
<
n_reloads
;
j
++
)
for
(
j
=
0
;
j
<
n_reloads
;
j
++
)
{
{
if
(
r
eload_opnum
[
j
]
==
i
)
if
(
r
ld
[
j
].
opnum
==
i
)
{
{
if
(
r
eload_when_needed
[
j
]
==
RELOAD_FOR_OUTPUT_ADDRESS
)
if
(
r
ld
[
j
].
when_needed
==
RELOAD_FOR_OUTPUT_ADDRESS
)
r
eload_when_needed
[
j
]
=
RELOAD_FOR_INPUT_ADDRESS
;
r
ld
[
j
].
when_needed
=
RELOAD_FOR_INPUT_ADDRESS
;
else
if
(
r
eload_when_needed
[
j
]
else
if
(
r
ld
[
j
].
when_needed
==
RELOAD_FOR_OUTADDR_ADDRESS
)
==
RELOAD_FOR_OUTADDR_ADDRESS
)
r
eload_when_needed
[
j
]
=
RELOAD_FOR_INPADDR_ADDRESS
;
r
ld
[
j
].
when_needed
=
RELOAD_FOR_INPADDR_ADDRESS
;
}
}
}
}
}
}
...
@@ -3908,18 +3834,18 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
...
@@ -3908,18 +3834,18 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
search for an existing equivalent reg (same value now) in the right class.
search for an existing equivalent reg (same value now) in the right class.
We can use it as long as we don't need to change its contents. */
We can use it as long as we don't need to change its contents. */
for (i = 0; i < n_reloads; i++)
for (i = 0; i < n_reloads; i++)
if (r
eload_reg_rtx[i]
== 0
if (r
ld[i].reg_rtx
== 0
&& r
eload_in[i]
!= 0
&& r
ld[i].in
!= 0
&& GET_CODE (r
eload_in[i]
) == REG
&& GET_CODE (r
ld[i].in
) == REG
&& r
eload_out[i]
== 0)
&& r
ld[i].out
== 0)
{
{
r
eload_reg_rtx[i]
r
ld[i].reg_rtx
= find_equiv_reg (r
eload_in[i], insn, reload_reg_class[i]
, -1,
= find_equiv_reg (r
ld[i].in, insn, rld[i].class
, -1,
static_reload_reg_p, 0, r
eload_inmode[i]
);
static_reload_reg_p, 0, r
ld[i].inmode
);
/* Prevent generation of insn to load the value
/* Prevent generation of insn to load the value
because the one we found already has the value. */
because the one we found already has the value. */
if (r
eload_reg_rtx[i]
)
if (r
ld[i].reg_rtx
)
r
eload_in[i] = reload_reg_rtx[i]
;
r
ld[i].in = rld[i].reg_rtx
;
}
}
#endif
#endif
...
@@ -3938,33 +3864,33 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
...
@@ -3938,33 +3864,33 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
int
k
;
int
k
;
for
(
j
=
i
+
1
;
j
<
n_reloads
;
j
++
)
for
(
j
=
i
+
1
;
j
<
n_reloads
;
j
++
)
if
((
r
eload_when_needed
[
i
]
==
RELOAD_FOR_INPUT_ADDRESS
if
((
r
ld
[
i
].
when_needed
==
RELOAD_FOR_INPUT_ADDRESS
||
r
eload_when_needed
[
i
]
==
RELOAD_FOR_OUTPUT_ADDRESS
||
r
ld
[
i
].
when_needed
==
RELOAD_FOR_OUTPUT_ADDRESS
||
r
eload_when_needed
[
i
]
==
RELOAD_FOR_INPADDR_ADDRESS
||
r
ld
[
i
].
when_needed
==
RELOAD_FOR_INPADDR_ADDRESS
||
r
eload_when_needed
[
i
]
==
RELOAD_FOR_OUTADDR_ADDRESS
)
||
r
ld
[
i
].
when_needed
==
RELOAD_FOR_OUTADDR_ADDRESS
)
&&
(
r
eload_when_needed
[
j
]
==
RELOAD_FOR_INPUT_ADDRESS
&&
(
r
ld
[
j
].
when_needed
==
RELOAD_FOR_INPUT_ADDRESS
||
r
eload_when_needed
[
j
]
==
RELOAD_FOR_OUTPUT_ADDRESS
||
r
ld
[
j
].
when_needed
==
RELOAD_FOR_OUTPUT_ADDRESS
||
r
eload_when_needed
[
j
]
==
RELOAD_FOR_INPADDR_ADDRESS
||
r
ld
[
j
].
when_needed
==
RELOAD_FOR_INPADDR_ADDRESS
||
r
eload_when_needed
[
j
]
==
RELOAD_FOR_OUTADDR_ADDRESS
)
||
r
ld
[
j
].
when_needed
==
RELOAD_FOR_OUTADDR_ADDRESS
)
&&
rtx_equal_p
(
r
eload_in
[
i
],
reload_in
[
j
]
)
&&
rtx_equal_p
(
r
ld
[
i
].
in
,
rld
[
j
].
in
)
&&
(
operand_reloadnum
[
r
eload_opnum
[
i
]
]
<
0
&&
(
operand_reloadnum
[
r
ld
[
i
].
opnum
]
<
0
||
r
eload_optional
[
operand_reloadnum
[
reload_opnum
[
i
]]]
)
||
r
ld
[
operand_reloadnum
[
rld
[
i
].
opnum
]].
optional
)
&&
(
operand_reloadnum
[
r
eload_opnum
[
j
]
]
<
0
&&
(
operand_reloadnum
[
r
ld
[
j
].
opnum
]
<
0
||
r
eload_optional
[
operand_reloadnum
[
reload_opnum
[
j
]]]
)
||
r
ld
[
operand_reloadnum
[
rld
[
j
].
opnum
]].
optional
)
&&
(
goal_alternative_matches
[
r
eload_opnum
[
i
]]
==
reload_opnum
[
j
]
&&
(
goal_alternative_matches
[
r
ld
[
i
].
opnum
]
==
rld
[
j
].
opnum
||
(
goal_alternative_matches
[
r
eload_opnum
[
j
]
]
||
(
goal_alternative_matches
[
r
ld
[
j
].
opnum
]
==
r
eload_opnum
[
i
]
)))
==
r
ld
[
i
].
opnum
)))
{
{
for
(
k
=
0
;
k
<
n_replacements
;
k
++
)
for
(
k
=
0
;
k
<
n_replacements
;
k
++
)
if
(
replacements
[
k
].
what
==
j
)
if
(
replacements
[
k
].
what
==
j
)
replacements
[
k
].
what
=
i
;
replacements
[
k
].
what
=
i
;
if
(
r
eload_when_needed
[
i
]
==
RELOAD_FOR_INPADDR_ADDRESS
if
(
r
ld
[
i
].
when_needed
==
RELOAD_FOR_INPADDR_ADDRESS
||
r
eload_when_needed
[
i
]
==
RELOAD_FOR_OUTADDR_ADDRESS
)
||
r
ld
[
i
].
when_needed
==
RELOAD_FOR_OUTADDR_ADDRESS
)
r
eload_when_needed
[
i
]
=
RELOAD_FOR_OPADDR_ADDR
;
r
ld
[
i
].
when_needed
=
RELOAD_FOR_OPADDR_ADDR
;
else
else
r
eload_when_needed
[
i
]
=
RELOAD_FOR_OPERAND_ADDRESS
;
r
ld
[
i
].
when_needed
=
RELOAD_FOR_OPERAND_ADDRESS
;
r
eload_in
[
j
]
=
0
;
r
ld
[
j
].
in
=
0
;
}
}
}
}
...
@@ -3987,68 +3913,68 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
...
@@ -3987,68 +3913,68 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
{
{
if
(
r
eload_secondary_p
[
i
]
if
(
r
ld
[
i
].
secondary_p
&&
r
eload_when_needed
[
i
]
==
operand_type
[
reload_opnum
[
i
]
])
&&
r
ld
[
i
].
when_needed
==
operand_type
[
rld
[
i
].
opnum
])
r
eload_when_needed
[
i
]
=
address_type
[
reload_opnum
[
i
]
];
r
ld
[
i
].
when_needed
=
address_type
[
rld
[
i
].
opnum
];
if
((
r
eload_when_needed
[
i
]
==
RELOAD_FOR_INPUT_ADDRESS
if
((
r
ld
[
i
].
when_needed
==
RELOAD_FOR_INPUT_ADDRESS
||
r
eload_when_needed
[
i
]
==
RELOAD_FOR_OUTPUT_ADDRESS
||
r
ld
[
i
].
when_needed
==
RELOAD_FOR_OUTPUT_ADDRESS
||
r
eload_when_needed
[
i
]
==
RELOAD_FOR_INPADDR_ADDRESS
||
r
ld
[
i
].
when_needed
==
RELOAD_FOR_INPADDR_ADDRESS
||
r
eload_when_needed
[
i
]
==
RELOAD_FOR_OUTADDR_ADDRESS
)
||
r
ld
[
i
].
when_needed
==
RELOAD_FOR_OUTADDR_ADDRESS
)
&&
(
operand_reloadnum
[
r
eload_opnum
[
i
]
]
<
0
&&
(
operand_reloadnum
[
r
ld
[
i
].
opnum
]
<
0
||
r
eload_optional
[
operand_reloadnum
[
reload_opnum
[
i
]]]
))
||
r
ld
[
operand_reloadnum
[
rld
[
i
].
opnum
]].
optional
))
{
{
/* If we have a secondary reload to go along with this reload,
/* If we have a secondary reload to go along with this reload,
change its type to RELOAD_FOR_OPADDR_ADDR. */
change its type to RELOAD_FOR_OPADDR_ADDR. */
if
((
r
eload_when_needed
[
i
]
==
RELOAD_FOR_INPUT_ADDRESS
if
((
r
ld
[
i
].
when_needed
==
RELOAD_FOR_INPUT_ADDRESS
||
r
eload_when_needed
[
i
]
==
RELOAD_FOR_INPADDR_ADDRESS
)
||
r
ld
[
i
].
when_needed
==
RELOAD_FOR_INPADDR_ADDRESS
)
&&
r
eload_secondary_in_reload
[
i
]
!=
-
1
)
&&
r
ld
[
i
].
secondary_in_reload
!=
-
1
)
{
{
int
secondary_in_reload
=
r
eload_secondary_in_reload
[
i
]
;
int
secondary_in_reload
=
r
ld
[
i
].
secondary_in_reload
;
r
eload_when_needed
[
secondary_in_reload
]
r
ld
[
secondary_in_reload
].
when_needed
=
RELOAD_FOR_OPADDR_ADDR
;
=
RELOAD_FOR_OPADDR_ADDR
;
/* If there's a tertiary reload we have to change it also. */
/* If there's a tertiary reload we have to change it also. */
if
(
secondary_in_reload
>
0
if
(
secondary_in_reload
>
0
&&
r
eload_secondary_in_reload
[
secondary_in_reload
]
!=
-
1
)
&&
r
ld
[
secondary_in_reload
].
secondary_in_reload
!=
-
1
)
r
eload_when_needed
[
reload_secondary_in_reload
[
secondary_in_reload
]]
r
ld
[
rld
[
secondary_in_reload
].
secondary_in_reload
].
when_needed
=
RELOAD_FOR_OPADDR_ADDR
;
=
RELOAD_FOR_OPADDR_ADDR
;
}
}
if
((
r
eload_when_needed
[
i
]
==
RELOAD_FOR_OUTPUT_ADDRESS
if
((
r
ld
[
i
].
when_needed
==
RELOAD_FOR_OUTPUT_ADDRESS
||
r
eload_when_needed
[
i
]
==
RELOAD_FOR_OUTADDR_ADDRESS
)
||
r
ld
[
i
].
when_needed
==
RELOAD_FOR_OUTADDR_ADDRESS
)
&&
r
eload_secondary_out_reload
[
i
]
!=
-
1
)
&&
r
ld
[
i
].
secondary_out_reload
!=
-
1
)
{
{
int
secondary_out_reload
=
r
eload_secondary_out_reload
[
i
]
;
int
secondary_out_reload
=
r
ld
[
i
].
secondary_out_reload
;
r
eload_when_needed
[
secondary_out_reload
]
r
ld
[
secondary_out_reload
].
when_needed
=
RELOAD_FOR_OPADDR_ADDR
;
=
RELOAD_FOR_OPADDR_ADDR
;
/* If there's a tertiary reload we have to change it also. */
/* If there's a tertiary reload we have to change it also. */
if
(
secondary_out_reload
if
(
secondary_out_reload
&&
r
eload_secondary_out_reload
[
secondary_out_reload
]
!=
-
1
)
&&
r
ld
[
secondary_out_reload
].
secondary_out_reload
!=
-
1
)
r
eload_when_needed
[
reload_secondary_out_reload
[
secondary_out_reload
]]
r
ld
[
rld
[
secondary_out_reload
].
secondary_out_reload
].
when_needed
=
RELOAD_FOR_OPADDR_ADDR
;
=
RELOAD_FOR_OPADDR_ADDR
;
}
}
if
(
r
eload_when_needed
[
i
]
==
RELOAD_FOR_INPADDR_ADDRESS
if
(
r
ld
[
i
].
when_needed
==
RELOAD_FOR_INPADDR_ADDRESS
||
r
eload_when_needed
[
i
]
==
RELOAD_FOR_OUTADDR_ADDRESS
)
||
r
ld
[
i
].
when_needed
==
RELOAD_FOR_OUTADDR_ADDRESS
)
r
eload_when_needed
[
i
]
=
RELOAD_FOR_OPADDR_ADDR
;
r
ld
[
i
].
when_needed
=
RELOAD_FOR_OPADDR_ADDR
;
else
else
r
eload_when_needed
[
i
]
=
RELOAD_FOR_OPERAND_ADDRESS
;
r
ld
[
i
].
when_needed
=
RELOAD_FOR_OPERAND_ADDRESS
;
}
}
if
((
r
eload_when_needed
[
i
]
==
RELOAD_FOR_INPUT_ADDRESS
if
((
r
ld
[
i
].
when_needed
==
RELOAD_FOR_INPUT_ADDRESS
||
r
eload_when_needed
[
i
]
==
RELOAD_FOR_INPADDR_ADDRESS
)
||
r
ld
[
i
].
when_needed
==
RELOAD_FOR_INPADDR_ADDRESS
)
&&
operand_reloadnum
[
r
eload_opnum
[
i
]
]
>=
0
&&
operand_reloadnum
[
r
ld
[
i
].
opnum
]
>=
0
&&
(
r
eload_when_needed
[
operand_reloadnum
[
reload_opnum
[
i
]]]
&&
(
r
ld
[
operand_reloadnum
[
rld
[
i
].
opnum
]].
when_needed
==
RELOAD_OTHER
))
==
RELOAD_OTHER
))
r
eload_when_needed
[
i
]
=
RELOAD_FOR_OTHER_ADDRESS
;
r
ld
[
i
].
when_needed
=
RELOAD_FOR_OTHER_ADDRESS
;
if
(
goal_alternative_matches
[
r
eload_opnum
[
i
]
]
>=
0
)
if
(
goal_alternative_matches
[
r
ld
[
i
].
opnum
]
>=
0
)
r
eload_opnum
[
i
]
=
goal_alternative_matches
[
reload_opnum
[
i
]
];
r
ld
[
i
].
opnum
=
goal_alternative_matches
[
rld
[
i
].
opnum
];
}
}
/* Scan all the reloads, and check for RELOAD_FOR_OPERAND_ADDRESS reloads.
/* Scan all the reloads, and check for RELOAD_FOR_OPERAND_ADDRESS reloads.
...
@@ -4089,7 +4015,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
...
@@ -4089,7 +4015,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
first_inpaddr_num
[
i
]
=
first_outpaddr_num
[
i
]
=
-
2
;
first_inpaddr_num
[
i
]
=
first_outpaddr_num
[
i
]
=
-
2
;
for
(
i
=
n_reloads
-
1
;
i
>=
0
;
i
--
)
for
(
i
=
n_reloads
-
1
;
i
>=
0
;
i
--
)
{
{
switch
(
r
eload_when_needed
[
i
]
)
switch
(
r
ld
[
i
].
when_needed
)
{
{
case
RELOAD_FOR_OPERAND_ADDRESS
:
case
RELOAD_FOR_OPERAND_ADDRESS
:
if
(
++
first_op_addr_num
>=
0
)
if
(
++
first_op_addr_num
>=
0
)
...
@@ -4099,16 +4025,16 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
...
@@ -4099,16 +4025,16 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
}
}
break
;
break
;
case
RELOAD_FOR_INPUT_ADDRESS
:
case
RELOAD_FOR_INPUT_ADDRESS
:
if
(
++
first_inpaddr_num
[
r
eload_opnum
[
i
]
]
>=
0
)
if
(
++
first_inpaddr_num
[
r
ld
[
i
].
opnum
]
>=
0
)
{
{
first_inpaddr_num
[
r
eload_opnum
[
i
]
]
=
i
;
first_inpaddr_num
[
r
ld
[
i
].
opnum
]
=
i
;
need_change
=
1
;
need_change
=
1
;
}
}
break
;
break
;
case
RELOAD_FOR_OUTPUT_ADDRESS
:
case
RELOAD_FOR_OUTPUT_ADDRESS
:
if
(
++
first_outpaddr_num
[
r
eload_opnum
[
i
]
]
>=
0
)
if
(
++
first_outpaddr_num
[
r
ld
[
i
].
opnum
]
>=
0
)
{
{
first_outpaddr_num
[
r
eload_opnum
[
i
]
]
=
i
;
first_outpaddr_num
[
r
ld
[
i
].
opnum
]
=
i
;
need_change
=
1
;
need_change
=
1
;
}
}
break
;
break
;
...
@@ -4123,18 +4049,18 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
...
@@ -4123,18 +4049,18 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
{
{
int
first_num
,
type
;
int
first_num
,
type
;
switch
(
r
eload_when_needed
[
i
]
)
switch
(
r
ld
[
i
].
when_needed
)
{
{
case
RELOAD_FOR_OPADDR_ADDR
:
case
RELOAD_FOR_OPADDR_ADDR
:
first_num
=
first_op_addr_num
;
first_num
=
first_op_addr_num
;
type
=
RELOAD_FOR_OPERAND_ADDRESS
;
type
=
RELOAD_FOR_OPERAND_ADDRESS
;
break
;
break
;
case
RELOAD_FOR_INPADDR_ADDRESS
:
case
RELOAD_FOR_INPADDR_ADDRESS
:
first_num
=
first_inpaddr_num
[
r
eload_opnum
[
i
]
];
first_num
=
first_inpaddr_num
[
r
ld
[
i
].
opnum
];
type
=
RELOAD_FOR_INPUT_ADDRESS
;
type
=
RELOAD_FOR_INPUT_ADDRESS
;
break
;
break
;
case
RELOAD_FOR_OUTADDR_ADDRESS
:
case
RELOAD_FOR_OUTADDR_ADDRESS
:
first_num
=
first_outpaddr_num
[
r
eload_opnum
[
i
]
];
first_num
=
first_outpaddr_num
[
r
ld
[
i
].
opnum
];
type
=
RELOAD_FOR_OUTPUT_ADDRESS
;
type
=
RELOAD_FOR_OUTPUT_ADDRESS
;
break
;
break
;
default
:
default
:
...
@@ -4143,19 +4069,19 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
...
@@ -4143,19 +4069,19 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
if
(
first_num
<
0
)
if
(
first_num
<
0
)
continue
;
continue
;
else
if
(
i
>
first_num
)
else
if
(
i
>
first_num
)
r
eload_when_needed
[
i
]
=
type
;
r
ld
[
i
].
when_needed
=
type
;
else
else
{
{
/* Check if the only TYPE reload that uses reload I is
/* Check if the only TYPE reload that uses reload I is
reload FIRST_NUM. */
reload FIRST_NUM. */
for
(
j
=
n_reloads
-
1
;
j
>
first_num
;
j
--
)
for
(
j
=
n_reloads
-
1
;
j
>
first_num
;
j
--
)
{
{
if
(
r
eload_when_needed
[
j
]
==
type
if
(
r
ld
[
j
].
when_needed
==
type
&&
(
r
eload_secondary_p
[
i
]
&&
(
r
ld
[
i
].
secondary_p
?
r
eload_secondary_in_reload
[
j
]
==
i
?
r
ld
[
j
].
secondary_in_reload
==
i
:
reg_mentioned_p
(
r
eload_in
[
i
],
reload_in
[
j
]
)))
:
reg_mentioned_p
(
r
ld
[
i
].
in
,
rld
[
j
].
in
)))
{
{
r
eload_when_needed
[
i
]
=
type
;
r
ld
[
i
].
when_needed
=
type
;
break
;
break
;
}
}
}
}
...
@@ -4170,21 +4096,21 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
...
@@ -4170,21 +4096,21 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
check for the most common cases. */
check for the most common cases. */
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
if
(
r
eload_in
[
i
]
!=
0
&&
reload_out
[
i
]
==
0
if
(
r
ld
[
i
].
in
!=
0
&&
rld
[
i
].
out
==
0
&&
(
r
eload_when_needed
[
i
]
==
RELOAD_FOR_OPERAND_ADDRESS
&&
(
r
ld
[
i
].
when_needed
==
RELOAD_FOR_OPERAND_ADDRESS
||
r
eload_when_needed
[
i
]
==
RELOAD_FOR_OPADDR_ADDR
||
r
ld
[
i
].
when_needed
==
RELOAD_FOR_OPADDR_ADDR
||
r
eload_when_needed
[
i
]
==
RELOAD_FOR_OTHER_ADDRESS
))
||
r
ld
[
i
].
when_needed
==
RELOAD_FOR_OTHER_ADDRESS
))
for
(
j
=
0
;
j
<
n_reloads
;
j
++
)
for
(
j
=
0
;
j
<
n_reloads
;
j
++
)
if
(
i
!=
j
&&
r
eload_in
[
j
]
!=
0
&&
reload_out
[
j
]
==
0
if
(
i
!=
j
&&
r
ld
[
j
].
in
!=
0
&&
rld
[
j
].
out
==
0
&&
r
eload_when_needed
[
j
]
==
reload_when_needed
[
i
]
&&
r
ld
[
j
].
when_needed
==
rld
[
i
].
when_needed
&&
MATCHES
(
r
eload_in
[
i
],
reload_in
[
j
]
)
&&
MATCHES
(
r
ld
[
i
].
in
,
rld
[
j
].
in
)
&&
r
eload_reg_class
[
i
]
==
reload_reg_class
[
j
]
&&
r
ld
[
i
].
class
==
rld
[
j
].
class
&&
!
r
eload_nocombine
[
i
]
&&
!
reload_nocombine
[
j
]
&&
!
r
ld
[
i
].
nocombine
&&
!
rld
[
j
].
nocombine
&&
r
eload_reg_rtx
[
i
]
==
reload_reg_rtx
[
j
]
)
&&
r
ld
[
i
].
reg_rtx
==
rld
[
j
].
reg_rtx
)
{
{
r
eload_opnum
[
i
]
=
MIN
(
reload_opnum
[
i
],
reload_opnum
[
j
]
);
r
ld
[
i
].
opnum
=
MIN
(
rld
[
i
].
opnum
,
rld
[
j
].
opnum
);
transfer_replacements
(
i
,
j
);
transfer_replacements
(
i
,
j
);
r
eload_in
[
j
]
=
0
;
r
ld
[
j
].
in
=
0
;
}
}
/* Set which reloads must use registers not used in any group. Start
/* Set which reloads must use registers not used in any group. Start
...
@@ -4194,28 +4120,28 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
...
@@ -4194,28 +4120,28 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
changed
=
0
;
changed
=
0
;
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
{
{
enum
machine_mode
mode
=
r
eload_inmode
[
i
]
;
enum
machine_mode
mode
=
r
ld
[
i
].
inmode
;
enum
reg_class
class
=
r
eload_reg_class
[
i
]
;
enum
reg_class
class
=
r
ld
[
i
].
class
;
int
size
;
int
size
;
if
(
GET_MODE_SIZE
(
r
eload_outmode
[
i
]
)
>
GET_MODE_SIZE
(
mode
))
if
(
GET_MODE_SIZE
(
r
ld
[
i
].
outmode
)
>
GET_MODE_SIZE
(
mode
))
mode
=
r
eload_outmode
[
i
]
;
mode
=
r
ld
[
i
].
outmode
;
size
=
CLASS_MAX_NREGS
(
class
,
mode
);
size
=
CLASS_MAX_NREGS
(
class
,
mode
);
if
(
size
==
1
)
if
(
size
==
1
)
for
(
j
=
0
;
j
<
n_reloads
;
j
++
)
for
(
j
=
0
;
j
<
n_reloads
;
j
++
)
if
((
CLASS_MAX_NREGS
(
r
eload_reg_class
[
j
]
,
if
((
CLASS_MAX_NREGS
(
r
ld
[
j
].
class
,
(
GET_MODE_SIZE
(
r
eload_outmode
[
j
]
)
(
GET_MODE_SIZE
(
r
ld
[
j
].
outmode
)
>
GET_MODE_SIZE
(
r
eload_inmode
[
j
]
))
>
GET_MODE_SIZE
(
r
ld
[
j
].
inmode
))
?
r
eload_outmode
[
j
]
:
reload_inmode
[
j
]
)
?
r
ld
[
j
].
outmode
:
rld
[
j
].
inmode
)
>
1
)
>
1
)
&&
!
r
eload_optional
[
j
]
&&
!
r
ld
[
j
].
optional
&&
(
r
eload_in
[
j
]
!=
0
||
reload_out
[
j
]
!=
0
&&
(
r
ld
[
j
].
in
!=
0
||
rld
[
j
].
out
!=
0
||
r
eload_secondary_p
[
j
]
)
||
r
ld
[
j
].
secondary_p
)
&&
reloads_conflict
(
i
,
j
)
&&
reloads_conflict
(
i
,
j
)
&&
reg_classes_intersect_p
(
class
,
r
eload_reg_class
[
j
]
))
&&
reg_classes_intersect_p
(
class
,
r
ld
[
j
].
class
))
{
{
r
eload_nongroup
[
i
]
=
1
;
r
ld
[
i
].
nongroup
=
1
;
changed
=
1
;
changed
=
1
;
break
;
break
;
}
}
...
@@ -4227,21 +4153,21 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
...
@@ -4227,21 +4153,21 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
{
{
enum
machine_mode
mode
=
r
eload_inmode
[
i
]
;
enum
machine_mode
mode
=
r
ld
[
i
].
inmode
;
enum
reg_class
class
=
r
eload_reg_class
[
i
]
;
enum
reg_class
class
=
r
ld
[
i
].
class
;
int
size
;
int
size
;
if
(
GET_MODE_SIZE
(
r
eload_outmode
[
i
]
)
>
GET_MODE_SIZE
(
mode
))
if
(
GET_MODE_SIZE
(
r
ld
[
i
].
outmode
)
>
GET_MODE_SIZE
(
mode
))
mode
=
r
eload_outmode
[
i
]
;
mode
=
r
ld
[
i
].
outmode
;
size
=
CLASS_MAX_NREGS
(
class
,
mode
);
size
=
CLASS_MAX_NREGS
(
class
,
mode
);
if
(
!
r
eload_nongroup
[
i
]
&&
size
==
1
)
if
(
!
r
ld
[
i
].
nongroup
&&
size
==
1
)
for
(
j
=
0
;
j
<
n_reloads
;
j
++
)
for
(
j
=
0
;
j
<
n_reloads
;
j
++
)
if
(
r
eload_nongroup
[
j
]
if
(
r
ld
[
j
].
nongroup
&&
reloads_conflict
(
i
,
j
)
&&
reloads_conflict
(
i
,
j
)
&&
reg_classes_intersect_p
(
class
,
r
eload_reg_class
[
j
]
))
&&
reg_classes_intersect_p
(
class
,
r
ld
[
j
].
class
))
{
{
r
eload_nongroup
[
i
]
=
1
;
r
ld
[
i
].
nongroup
=
1
;
changed
=
1
;
changed
=
1
;
break
;
break
;
}
}
...
@@ -5363,7 +5289,7 @@ find_reloads_address_1 (mode, x, context, loc, opnum, type, ind_levels, insn)
...
@@ -5363,7 +5289,7 @@ find_reloads_address_1 (mode, x, context, loc, opnum, type, ind_levels, insn)
(
context
?
INDEX_REG_CLASS
:
BASE_REG_CLASS
),
(
context
?
INDEX_REG_CLASS
:
BASE_REG_CLASS
),
GET_MODE
(
x
),
GET_MODE
(
x
),
0
,
0
,
GET_MODE
(
x
),
GET_MODE
(
x
),
0
,
0
,
opnum
,
type
);
opnum
,
type
);
r
eload_inc
[
reloadnum
]
r
ld
[
reloadnum
].
inc
=
find_inc_amount
(
PATTERN
(
this_insn
),
XEXP
(
x_orig
,
0
));
=
find_inc_amount
(
PATTERN
(
this_insn
),
XEXP
(
x_orig
,
0
));
value
=
1
;
value
=
1
;
...
@@ -5388,7 +5314,7 @@ find_reloads_address_1 (mode, x, context, loc, opnum, type, ind_levels, insn)
...
@@ -5388,7 +5314,7 @@ find_reloads_address_1 (mode, x, context, loc, opnum, type, ind_levels, insn)
of an equivalent address for a pseudo that was not allocated to a
of an equivalent address for a pseudo that was not allocated to a
hard register. Verify that the specified address is valid and
hard register. Verify that the specified address is valid and
reload it into a register. */
reload it into a register. */
/* Variable `tem' might or might not be used in FIND_REG_INC_NOTE. */
/* Variable `tem' might or might not be used in FIND_REG_INC_NOTE.
*/
rtx
tem
ATTRIBUTE_UNUSED
=
XEXP
(
x
,
0
);
rtx
tem
ATTRIBUTE_UNUSED
=
XEXP
(
x
,
0
);
register
rtx
link
;
register
rtx
link
;
int
reloadnum
;
int
reloadnum
;
...
@@ -5409,7 +5335,7 @@ find_reloads_address_1 (mode, x, context, loc, opnum, type, ind_levels, insn)
...
@@ -5409,7 +5335,7 @@ find_reloads_address_1 (mode, x, context, loc, opnum, type, ind_levels, insn)
reloadnum
=
push_reload
(
x
,
NULL_RTX
,
loc
,
NULL_PTR
,
reloadnum
=
push_reload
(
x
,
NULL_RTX
,
loc
,
NULL_PTR
,
(
context
?
INDEX_REG_CLASS
:
BASE_REG_CLASS
),
(
context
?
INDEX_REG_CLASS
:
BASE_REG_CLASS
),
GET_MODE
(
x
),
VOIDmode
,
0
,
0
,
opnum
,
type
);
GET_MODE
(
x
),
VOIDmode
,
0
,
0
,
opnum
,
type
);
r
eload_inc
[
reloadnum
]
r
ld
[
reloadnum
].
inc
=
find_inc_amount
(
PATTERN
(
this_insn
),
XEXP
(
x
,
0
));
=
find_inc_amount
(
PATTERN
(
this_insn
),
XEXP
(
x
,
0
));
link
=
FIND_REG_INC_NOTE
(
this_insn
,
tem
);
link
=
FIND_REG_INC_NOTE
(
this_insn
,
tem
);
...
@@ -5725,7 +5651,7 @@ subst_reloads ()
...
@@ -5725,7 +5651,7 @@ subst_reloads ()
for
(
i
=
0
;
i
<
n_replacements
;
i
++
)
for
(
i
=
0
;
i
<
n_replacements
;
i
++
)
{
{
register
struct
replacement
*
r
=
&
replacements
[
i
];
register
struct
replacement
*
r
=
&
replacements
[
i
];
register
rtx
reloadreg
=
r
eload_reg_rtx
[
r
->
what
]
;
register
rtx
reloadreg
=
r
ld
[
r
->
what
].
reg_rtx
;
if
(
reloadreg
)
if
(
reloadreg
)
{
{
/* Encapsulate RELOADREG so its machine mode matches what
/* Encapsulate RELOADREG so its machine mode matches what
...
@@ -5754,7 +5680,7 @@ subst_reloads ()
...
@@ -5754,7 +5680,7 @@ subst_reloads ()
*
r
->
where
=
reloadreg
;
*
r
->
where
=
reloadreg
;
}
}
/* If reload got no reg and isn't optional, something's wrong. */
/* If reload got no reg and isn't optional, something's wrong. */
else
if
(
!
r
eload_optional
[
r
->
what
]
)
else
if
(
!
r
ld
[
r
->
what
].
optional
)
abort
();
abort
();
}
}
}
}
...
@@ -5831,7 +5757,7 @@ find_replacement (loc)
...
@@ -5831,7 +5757,7 @@ find_replacement (loc)
for
(
r
=
&
replacements
[
0
];
r
<
&
replacements
[
n_replacements
];
r
++
)
for
(
r
=
&
replacements
[
0
];
r
<
&
replacements
[
n_replacements
];
r
++
)
{
{
rtx
reloadreg
=
r
eload_reg_rtx
[
r
->
what
]
;
rtx
reloadreg
=
r
ld
[
r
->
what
].
reg_rtx
;
if
(
reloadreg
&&
r
->
where
==
loc
)
if
(
reloadreg
&&
r
->
where
==
loc
)
{
{
...
@@ -6334,11 +6260,11 @@ find_equiv_reg (goal, insn, class, other, reload_reg_p, goalreg, mode)
...
@@ -6334,11 +6260,11 @@ find_equiv_reg (goal, insn, class, other, reload_reg_p, goalreg, mode)
{
{
int
i
;
int
i
;
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
if
(
r
eload_reg_rtx
[
i
]
!=
0
&&
reload_in
[
i
]
)
if
(
r
ld
[
i
].
reg_rtx
!=
0
&&
rld
[
i
].
in
)
{
{
int
regno1
=
REGNO
(
r
eload_reg_rtx
[
i
]
);
int
regno1
=
REGNO
(
r
ld
[
i
].
reg_rtx
);
int
nregs1
=
HARD_REGNO_NREGS
(
regno1
,
int
nregs1
=
HARD_REGNO_NREGS
(
regno1
,
GET_MODE
(
r
eload_reg_rtx
[
i
]
));
GET_MODE
(
r
ld
[
i
].
reg_rtx
));
if
(
regno1
<
valueno
+
valuenregs
if
(
regno1
<
valueno
+
valuenregs
&&
regno1
+
nregs1
>
valueno
)
&&
regno1
+
nregs1
>
valueno
)
return
0
;
return
0
;
...
@@ -6663,84 +6589,84 @@ debug_reload_to_stream (f)
...
@@ -6663,84 +6589,84 @@ debug_reload_to_stream (f)
{
{
fprintf
(
f
,
"Reload %d: "
,
r
);
fprintf
(
f
,
"Reload %d: "
,
r
);
if
(
r
eload_in
[
r
]
!=
0
)
if
(
r
ld
[
r
].
in
!=
0
)
{
{
fprintf
(
f
,
"reload_in (%s) = "
,
fprintf
(
f
,
"reload_in (%s) = "
,
GET_MODE_NAME
(
r
eload_inmode
[
r
]
));
GET_MODE_NAME
(
r
ld
[
r
].
inmode
));
print_inline_rtx
(
f
,
r
eload_in
[
r
]
,
24
);
print_inline_rtx
(
f
,
r
ld
[
r
].
in
,
24
);
fprintf
(
f
,
"
\n\t
"
);
fprintf
(
f
,
"
\n\t
"
);
}
}
if
(
r
eload_out
[
r
]
!=
0
)
if
(
r
ld
[
r
].
out
!=
0
)
{
{
fprintf
(
f
,
"reload_out (%s) = "
,
fprintf
(
f
,
"reload_out (%s) = "
,
GET_MODE_NAME
(
r
eload_outmode
[
r
]
));
GET_MODE_NAME
(
r
ld
[
r
].
outmode
));
print_inline_rtx
(
f
,
r
eload_out
[
r
]
,
24
);
print_inline_rtx
(
f
,
r
ld
[
r
].
out
,
24
);
fprintf
(
f
,
"
\n\t
"
);
fprintf
(
f
,
"
\n\t
"
);
}
}
fprintf
(
f
,
"%s, "
,
reg_class_names
[(
int
)
r
eload_reg_class
[
r
]
]);
fprintf
(
f
,
"%s, "
,
reg_class_names
[(
int
)
r
ld
[
r
].
class
]);
fprintf
(
f
,
"%s (opnum = %d)"
,
fprintf
(
f
,
"%s (opnum = %d)"
,
reload_when_needed_name
[(
int
)
r
eload_when_needed
[
r
]
],
reload_when_needed_name
[(
int
)
r
ld
[
r
].
when_needed
],
r
eload_opnum
[
r
]
);
r
ld
[
r
].
opnum
);
if
(
r
eload_optional
[
r
]
)
if
(
r
ld
[
r
].
optional
)
fprintf
(
f
,
", optional"
);
fprintf
(
f
,
", optional"
);
if
(
r
eload_nongroup
[
r
]
)
if
(
r
ld
[
r
].
nongroup
)
fprintf
(
stderr
,
", nongroup"
);
fprintf
(
stderr
,
", nongroup"
);
if
(
r
eload_inc
[
r
]
!=
0
)
if
(
r
ld
[
r
].
inc
!=
0
)
fprintf
(
f
,
", inc by %d"
,
r
eload_inc
[
r
]
);
fprintf
(
f
,
", inc by %d"
,
r
ld
[
r
].
inc
);
if
(
r
eload_nocombine
[
r
]
)
if
(
r
ld
[
r
].
nocombine
)
fprintf
(
f
,
", can't combine"
);
fprintf
(
f
,
", can't combine"
);
if
(
r
eload_secondary_p
[
r
]
)
if
(
r
ld
[
r
].
secondary_p
)
fprintf
(
f
,
", secondary_reload_p"
);
fprintf
(
f
,
", secondary_reload_p"
);
if
(
r
eload_in_reg
[
r
]
!=
0
)
if
(
r
ld
[
r
].
in_reg
!=
0
)
{
{
fprintf
(
f
,
"
\n\t
reload_in_reg: "
);
fprintf
(
f
,
"
\n\t
reload_in_reg: "
);
print_inline_rtx
(
f
,
r
eload_in_reg
[
r
]
,
24
);
print_inline_rtx
(
f
,
r
ld
[
r
].
in_reg
,
24
);
}
}
if
(
r
eload_out_reg
[
r
]
!=
0
)
if
(
r
ld
[
r
].
out_reg
!=
0
)
{
{
fprintf
(
f
,
"
\n\t
reload_out_reg: "
);
fprintf
(
f
,
"
\n\t
reload_out_reg: "
);
print_inline_rtx
(
f
,
r
eload_out_reg
[
r
]
,
24
);
print_inline_rtx
(
f
,
r
ld
[
r
].
out_reg
,
24
);
}
}
if
(
r
eload_reg_rtx
[
r
]
!=
0
)
if
(
r
ld
[
r
].
reg_rtx
!=
0
)
{
{
fprintf
(
f
,
"
\n\t
reload_reg_rtx: "
);
fprintf
(
f
,
"
\n\t
reload_reg_rtx: "
);
print_inline_rtx
(
f
,
r
eload_reg_rtx
[
r
]
,
24
);
print_inline_rtx
(
f
,
r
ld
[
r
].
reg_rtx
,
24
);
}
}
prefix
=
"
\n\t
"
;
prefix
=
"
\n\t
"
;
if
(
r
eload_secondary_in_reload
[
r
]
!=
-
1
)
if
(
r
ld
[
r
].
secondary_in_reload
!=
-
1
)
{
{
fprintf
(
f
,
"%ssecondary_in_reload = %d"
,
fprintf
(
f
,
"%ssecondary_in_reload = %d"
,
prefix
,
r
eload_secondary_in_reload
[
r
]
);
prefix
,
r
ld
[
r
].
secondary_in_reload
);
prefix
=
", "
;
prefix
=
", "
;
}
}
if
(
r
eload_secondary_out_reload
[
r
]
!=
-
1
)
if
(
r
ld
[
r
].
secondary_out_reload
!=
-
1
)
fprintf
(
f
,
"%ssecondary_out_reload = %d
\n
"
,
fprintf
(
f
,
"%ssecondary_out_reload = %d
\n
"
,
prefix
,
r
eload_secondary_out_reload
[
r
]
);
prefix
,
r
ld
[
r
].
secondary_out_reload
);
prefix
=
"
\n\t
"
;
prefix
=
"
\n\t
"
;
if
(
r
eload_secondary_in_icode
[
r
]
!=
CODE_FOR_nothing
)
if
(
r
ld
[
r
].
secondary_in_icode
!=
CODE_FOR_nothing
)
{
{
fprintf
(
stderr
,
"%ssecondary_in_icode = %s"
,
prefix
,
fprintf
(
stderr
,
"%ssecondary_in_icode = %s"
,
prefix
,
insn_data
[
r
eload_secondary_in_icode
[
r
]
].
name
);
insn_data
[
r
ld
[
r
].
secondary_in_icode
].
name
);
prefix
=
", "
;
prefix
=
", "
;
}
}
if
(
r
eload_secondary_out_icode
[
r
]
!=
CODE_FOR_nothing
)
if
(
r
ld
[
r
].
secondary_out_icode
!=
CODE_FOR_nothing
)
fprintf
(
stderr
,
"%ssecondary_out_icode = %s"
,
prefix
,
fprintf
(
stderr
,
"%ssecondary_out_icode = %s"
,
prefix
,
insn_data
[
r
eload_secondary_out_icode
[
r
]
].
name
);
insn_data
[
r
ld
[
r
].
secondary_out_icode
].
name
);
fprintf
(
f
,
"
\n
"
);
fprintf
(
f
,
"
\n
"
);
}
}
...
...
gcc/reload.h
View file @
eceef4c9
...
@@ -45,33 +45,9 @@ Boston, MA 02111-1307, USA. */
...
@@ -45,33 +45,9 @@ Boston, MA 02111-1307, USA. */
#endif
#endif
extern
int
memory_move_secondary_cost
PROTO
((
enum
machine_mode
,
enum
reg_class
,
int
));
extern
int
memory_move_secondary_cost
PROTO
((
enum
machine_mode
,
enum
reg_class
,
int
));
/* See reload.c and reload1.c for comments on these variables. */
/* Maximum number of reloads we can need. */
/* Maximum number of reloads we can need. */
#define MAX_RELOADS (2 * MAX_RECOG_OPERANDS * (MAX_REGS_PER_ADDRESS + 1))
#define MAX_RELOADS (2 * MAX_RECOG_OPERANDS * (MAX_REGS_PER_ADDRESS + 1))
extern
rtx
reload_in
[
MAX_RELOADS
];
extern
rtx
reload_out
[
MAX_RELOADS
];
extern
rtx
reload_in_reg
[
MAX_RELOADS
];
extern
rtx
reload_out_reg
[
MAX_RELOADS
];
extern
enum
reg_class
reload_reg_class
[
MAX_RELOADS
];
extern
enum
machine_mode
reload_inmode
[
MAX_RELOADS
];
extern
enum
machine_mode
reload_outmode
[
MAX_RELOADS
];
extern
char
reload_optional
[
MAX_RELOADS
];
extern
char
reload_nongroup
[
MAX_RELOADS
];
extern
int
reload_inc
[
MAX_RELOADS
];
extern
int
reload_opnum
[
MAX_RELOADS
];
extern
int
reload_secondary_p
[
MAX_RELOADS
];
extern
int
reload_secondary_in_reload
[
MAX_RELOADS
];
extern
int
reload_secondary_out_reload
[
MAX_RELOADS
];
#ifdef MAX_INSN_CODE
extern
enum
insn_code
reload_secondary_in_icode
[
MAX_RELOADS
];
extern
enum
insn_code
reload_secondary_out_icode
[
MAX_RELOADS
];
#endif
extern
int
n_reloads
;
extern
rtx
reload_reg_rtx
[
MAX_RELOADS
];
/* Encode the usage of a reload. The following codes are supported:
/* Encode the usage of a reload. The following codes are supported:
RELOAD_FOR_INPUT reload of an input operand
RELOAD_FOR_INPUT reload of an input operand
...
@@ -105,7 +81,81 @@ enum reload_type
...
@@ -105,7 +81,81 @@ enum reload_type
RELOAD_OTHER
,
RELOAD_FOR_OTHER_ADDRESS
RELOAD_OTHER
,
RELOAD_FOR_OTHER_ADDRESS
};
};
extern
enum
reload_type
reload_when_needed
[
MAX_RELOADS
];
#ifdef MAX_INSN_CODE
/* Each reload is recorded with a structure like this. */
struct
reload
{
/* The value to reload from */
rtx
in
;
/* Where to store reload-reg afterward if nec (often the same as
reload_in) */
rtx
out
;
/* The class of registers to reload into. */
enum
reg_class
class
;
/* The mode this operand should have when reloaded, on input. */
enum
machine_mode
inmode
;
/* The mode this operand should have when reloaded, on output. */
enum
machine_mode
outmode
;
/* Positive amount to increment or decrement by if
reload_in is a PRE_DEC, PRE_INC, POST_DEC, POST_INC.
Ignored otherwise (don't assume it is zero). */
int
inc
;
/* A reg for which reload_in is the equivalent.
If reload_in is a symbol_ref which came from
reg_equiv_constant, then this is the pseudo
which has that symbol_ref as equivalent. */
rtx
in_reg
;
rtx
out_reg
;
/* Used in find_reload_regs to record the allocated register. */
int
regno
;
/* This is the register to reload into. If it is zero when `find_reloads'
returns, you must find a suitable register in the class specified by
reload_reg_class, and store here an rtx for that register with mode from
reload_inmode or reload_outmode. */
rtx
reg_rtx
;
/* The operand number being reloaded. This is used to group related reloads
and need not always be equal to the actual operand number in the insn,
though it current will be; for in-out operands, it is one of the two
operand numbers. */
int
opnum
;
/* Gives the reload number of a secondary input reload, when needed;
otherwise -1. */
int
secondary_in_reload
;
/* Gives the reload number of a secondary output reload, when needed;
otherwise -1. */
int
secondary_out_reload
;
/* If a secondary input reload is required, gives the INSN_CODE that uses the
secondary reload as a scratch register, or CODE_FOR_nothing if the
secondary reload register is to be an intermediate register. */
enum
insn_code
secondary_in_icode
;
/* Likewise, for a secondary output reload. */
enum
insn_code
secondary_out_icode
;
/* Classifies reload as needed either for addressing an input reload,
addressing an output, for addressing a non-reloaded mem ref, or for
unspecified purposes (i.e., more than one of the above). */
enum
reload_type
when_needed
;
/* Nonzero for an optional reload. Optional reloads are ignored unless the
value is already sitting in a register. */
unsigned
int
optional
:
1
;
/* nonzero if this reload shouldn't be combined with another reload. */
unsigned
int
nocombine
:
1
;
/* Nonzero if this is a secondary register for one or more reloads. */
unsigned
int
secondary_p
:
1
;
/* Nonzero if this reload must use a register not already allocated to a
group. */
unsigned
int
nongroup
:
1
;
};
extern
struct
reload
rld
[
MAX_RELOADS
];
extern
int
n_reloads
;
#endif
extern
rtx
*
reg_equiv_constant
;
extern
rtx
*
reg_equiv_constant
;
extern
rtx
*
reg_equiv_memory_loc
;
extern
rtx
*
reg_equiv_memory_loc
;
...
...
gcc/reload1.c
View file @
eceef4c9
...
@@ -1502,7 +1502,7 @@ calculate_needs (chain)
...
@@ -1502,7 +1502,7 @@ calculate_needs (chain)
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
{
{
register
enum
reg_class
*
p
;
register
enum
reg_class
*
p
;
enum
reg_class
class
=
r
eload_reg_class
[
i
]
;
enum
reg_class
class
=
r
ld
[
i
].
class
;
int
size
;
int
size
;
enum
machine_mode
mode
;
enum
machine_mode
mode
;
struct
needs
*
this_needs
;
struct
needs
*
this_needs
;
...
@@ -1511,19 +1511,19 @@ calculate_needs (chain)
...
@@ -1511,19 +1511,19 @@ calculate_needs (chain)
regs mentioned in the insn can be used for reloading.
regs mentioned in the insn can be used for reloading.
Don't count optional reloads.
Don't count optional reloads.
Don't count reloads that got combined with others. */
Don't count reloads that got combined with others. */
if
(
r
eload_reg_rtx
[
i
]
!=
0
if
(
r
ld
[
i
].
reg_rtx
!=
0
||
r
eload_optional
[
i
]
!=
0
||
r
ld
[
i
].
optional
!=
0
||
(
r
eload_out
[
i
]
==
0
&&
reload_in
[
i
]
==
0
||
(
r
ld
[
i
].
out
==
0
&&
rld
[
i
].
in
==
0
&&
!
r
eload_secondary_p
[
i
]
))
&&
!
r
ld
[
i
].
secondary_p
))
continue
;
continue
;
mode
=
r
eload_inmode
[
i
]
;
mode
=
r
ld
[
i
].
inmode
;
if
(
GET_MODE_SIZE
(
r
eload_outmode
[
i
]
)
>
GET_MODE_SIZE
(
mode
))
if
(
GET_MODE_SIZE
(
r
ld
[
i
].
outmode
)
>
GET_MODE_SIZE
(
mode
))
mode
=
r
eload_outmode
[
i
]
;
mode
=
r
ld
[
i
].
outmode
;
size
=
CLASS_MAX_NREGS
(
class
,
mode
);
size
=
CLASS_MAX_NREGS
(
class
,
mode
);
/* Decide which time-of-use to count this reload for. */
/* Decide which time-of-use to count this reload for. */
switch
(
r
eload_when_needed
[
i
]
)
switch
(
r
ld
[
i
].
when_needed
)
{
{
case
RELOAD_OTHER
:
case
RELOAD_OTHER
:
this_needs
=
&
insn_needs
.
other
;
this_needs
=
&
insn_needs
.
other
;
...
@@ -1541,16 +1541,16 @@ calculate_needs (chain)
...
@@ -1541,16 +1541,16 @@ calculate_needs (chain)
this_needs
=
&
insn_needs
.
other_addr
;
this_needs
=
&
insn_needs
.
other_addr
;
break
;
break
;
case
RELOAD_FOR_INPUT_ADDRESS
:
case
RELOAD_FOR_INPUT_ADDRESS
:
this_needs
=
&
insn_needs
.
in_addr
[
r
eload_opnum
[
i
]
];
this_needs
=
&
insn_needs
.
in_addr
[
r
ld
[
i
].
opnum
];
break
;
break
;
case
RELOAD_FOR_INPADDR_ADDRESS
:
case
RELOAD_FOR_INPADDR_ADDRESS
:
this_needs
=
&
insn_needs
.
in_addr_addr
[
r
eload_opnum
[
i
]
];
this_needs
=
&
insn_needs
.
in_addr_addr
[
r
ld
[
i
].
opnum
];
break
;
break
;
case
RELOAD_FOR_OUTPUT_ADDRESS
:
case
RELOAD_FOR_OUTPUT_ADDRESS
:
this_needs
=
&
insn_needs
.
out_addr
[
r
eload_opnum
[
i
]
];
this_needs
=
&
insn_needs
.
out_addr
[
r
ld
[
i
].
opnum
];
break
;
break
;
case
RELOAD_FOR_OUTADDR_ADDRESS
:
case
RELOAD_FOR_OUTADDR_ADDRESS
:
this_needs
=
&
insn_needs
.
out_addr_addr
[
r
eload_opnum
[
i
]
];
this_needs
=
&
insn_needs
.
out_addr_addr
[
r
ld
[
i
].
opnum
];
break
;
break
;
case
RELOAD_FOR_OPERAND_ADDRESS
:
case
RELOAD_FOR_OPERAND_ADDRESS
:
this_needs
=
&
insn_needs
.
op_addr
;
this_needs
=
&
insn_needs
.
op_addr
;
...
@@ -1601,10 +1601,10 @@ calculate_needs (chain)
...
@@ -1601,10 +1601,10 @@ calculate_needs (chain)
}
}
else
if
(
size
==
1
)
else
if
(
size
==
1
)
{
{
this_needs
->
regs
[(
unsigned
char
)
r
eload_nongroup
[
i
]
][(
int
)
class
]
+=
1
;
this_needs
->
regs
[(
unsigned
char
)
r
ld
[
i
].
nongroup
][(
int
)
class
]
+=
1
;
p
=
reg_class_superclasses
[(
int
)
class
];
p
=
reg_class_superclasses
[(
int
)
class
];
while
(
*
p
!=
LIM_REG_CLASSES
)
while
(
*
p
!=
LIM_REG_CLASSES
)
this_needs
->
regs
[(
unsigned
char
)
r
eload_nongroup
[
i
]
][(
int
)
*
p
++
]
+=
1
;
this_needs
->
regs
[(
unsigned
char
)
r
ld
[
i
].
nongroup
][(
int
)
*
p
++
]
+=
1
;
}
}
else
else
abort
();
abort
();
...
@@ -4353,7 +4353,7 @@ reload_as_needed (live_known)
...
@@ -4353,7 +4353,7 @@ reload_as_needed (live_known)
which have been performed by subst_reloads above. */
which have been performed by subst_reloads above. */
for
(
i
=
n_reloads
-
1
;
i
>=
0
;
i
--
)
for
(
i
=
n_reloads
-
1
;
i
>=
0
;
i
--
)
{
{
rtx
in_reg
=
r
eload_in_reg
[
i
]
;
rtx
in_reg
=
r
ld
[
i
].
in_reg
;
if
(
in_reg
)
if
(
in_reg
)
{
{
enum
rtx_code
code
=
GET_CODE
(
in_reg
);
enum
rtx_code
code
=
GET_CODE
(
in_reg
);
...
@@ -4364,14 +4364,14 @@ reload_as_needed (live_known)
...
@@ -4364,14 +4364,14 @@ reload_as_needed (live_known)
or we can't use the reload register for inheritance. */
or we can't use the reload register for inheritance. */
if
((
code
==
POST_INC
||
code
==
POST_DEC
)
if
((
code
==
POST_INC
||
code
==
POST_DEC
)
&&
TEST_HARD_REG_BIT
(
reg_reloaded_valid
,
&&
TEST_HARD_REG_BIT
(
reg_reloaded_valid
,
REGNO
(
r
eload_reg_rtx
[
i
]
))
REGNO
(
r
ld
[
i
].
reg_rtx
))
/* Make sure it is the inc/dec pseudo, and not
/* Make sure it is the inc/dec pseudo, and not
some other (e.g. output operand) pseudo. */
some other (e.g. output operand) pseudo. */
&&
(
reg_reloaded_contents
[
REGNO
(
r
eload_reg_rtx
[
i
]
)]
&&
(
reg_reloaded_contents
[
REGNO
(
r
ld
[
i
].
reg_rtx
)]
==
REGNO
(
XEXP
(
in_reg
,
0
))))
==
REGNO
(
XEXP
(
in_reg
,
0
))))
{
{
rtx
reload_reg
=
r
eload_reg_rtx
[
i
]
;
rtx
reload_reg
=
r
ld
[
i
].
reg_rtx
;
enum
machine_mode
mode
=
GET_MODE
(
reload_reg
);
enum
machine_mode
mode
=
GET_MODE
(
reload_reg
);
int
n
=
0
;
int
n
=
0
;
rtx
p
;
rtx
p
;
...
@@ -4430,14 +4430,14 @@ reload_as_needed (live_known)
...
@@ -4430,14 +4430,14 @@ reload_as_needed (live_known)
}
}
else
if
((
code
==
PRE_INC
||
code
==
PRE_DEC
)
else
if
((
code
==
PRE_INC
||
code
==
PRE_DEC
)
&&
TEST_HARD_REG_BIT
(
reg_reloaded_valid
,
&&
TEST_HARD_REG_BIT
(
reg_reloaded_valid
,
REGNO
(
r
eload_reg_rtx
[
i
]
))
REGNO
(
r
ld
[
i
].
reg_rtx
))
/* Make sure it is the inc/dec pseudo, and not
/* Make sure it is the inc/dec pseudo, and not
some other (e.g. output operand) pseudo. */
some other (e.g. output operand) pseudo. */
&&
(
reg_reloaded_contents
[
REGNO
(
r
eload_reg_rtx
[
i
]
)]
&&
(
reg_reloaded_contents
[
REGNO
(
r
ld
[
i
].
reg_rtx
)]
==
REGNO
(
XEXP
(
in_reg
,
0
))))
==
REGNO
(
XEXP
(
in_reg
,
0
))))
{
{
SET_HARD_REG_BIT
(
reg_is_output_reload
,
SET_HARD_REG_BIT
(
reg_is_output_reload
,
REGNO
(
r
eload_reg_rtx
[
i
]
));
REGNO
(
r
ld
[
i
].
reg_rtx
));
reg_has_output_reload
[
REGNO
(
XEXP
(
in_reg
,
0
))]
=
1
;
reg_has_output_reload
[
REGNO
(
XEXP
(
in_reg
,
0
))]
=
1
;
}
}
}
}
...
@@ -4452,7 +4452,7 @@ reload_as_needed (live_known)
...
@@ -4452,7 +4452,7 @@ reload_as_needed (live_known)
If so, its last-reload info is still valid
If so, its last-reload info is still valid
because it is based on this insn's reload. */
because it is based on this insn's reload. */
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
if
(
r
eload_out
[
i
]
==
XEXP
(
x
,
0
))
if
(
r
ld
[
i
].
out
==
XEXP
(
x
,
0
))
break
;
break
;
if
(
i
==
n_reloads
)
if
(
i
==
n_reloads
)
...
@@ -4559,13 +4559,13 @@ reload_reg_class_lower (r1p, r2p)
...
@@ -4559,13 +4559,13 @@ reload_reg_class_lower (r1p, r2p)
register
int
t
;
register
int
t
;
/* Consider required reloads before optional ones. */
/* Consider required reloads before optional ones. */
t
=
r
eload_optional
[
r1
]
-
reload_optional
[
r2
]
;
t
=
r
ld
[
r1
].
optional
-
rld
[
r2
].
optional
;
if
(
t
!=
0
)
if
(
t
!=
0
)
return
t
;
return
t
;
/* Count all solitary classes before non-solitary ones. */
/* Count all solitary classes before non-solitary ones. */
t
=
((
reg_class_size
[(
int
)
r
eload_reg_class
[
r2
]
]
==
1
)
t
=
((
reg_class_size
[(
int
)
r
ld
[
r2
].
class
]
==
1
)
-
(
reg_class_size
[(
int
)
r
eload_reg_class
[
r1
]
]
==
1
));
-
(
reg_class_size
[(
int
)
r
ld
[
r1
].
class
]
==
1
));
if
(
t
!=
0
)
if
(
t
!=
0
)
return
t
;
return
t
;
...
@@ -4575,7 +4575,7 @@ reload_reg_class_lower (r1p, r2p)
...
@@ -4575,7 +4575,7 @@ reload_reg_class_lower (r1p, r2p)
return
t
;
return
t
;
/* Consider reloads in order of increasing reg-class number. */
/* Consider reloads in order of increasing reg-class number. */
t
=
(
int
)
r
eload_reg_class
[
r1
]
-
(
int
)
reload_reg_class
[
r2
]
;
t
=
(
int
)
r
ld
[
r1
].
class
-
(
int
)
rld
[
r2
].
class
;
if
(
t
!=
0
)
if
(
t
!=
0
)
return
t
;
return
t
;
...
@@ -4774,11 +4774,11 @@ clear_reload_reg_in_use (regno, opnum, type, mode)
...
@@ -4774,11 +4774,11 @@ clear_reload_reg_in_use (regno, opnum, type, mode)
{
{
for
(
i
=
n_reloads
-
1
;
i
>=
0
;
i
--
)
for
(
i
=
n_reloads
-
1
;
i
>=
0
;
i
--
)
{
{
if
(
r
eload_when_needed
[
i
]
==
type
if
(
r
ld
[
i
].
when_needed
==
type
&&
(
check_any
||
r
eload_opnum
[
i
]
==
opnum
)
&&
(
check_any
||
r
ld
[
i
].
opnum
==
opnum
)
&&
r
eload_reg_rtx
[
i
]
)
&&
r
ld
[
i
].
reg_rtx
)
{
{
int
conflict_start
=
true_regnum
(
r
eload_reg_rtx
[
i
]
);
int
conflict_start
=
true_regnum
(
r
ld
[
i
].
reg_rtx
);
int
conflict_end
int
conflict_end
=
(
conflict_start
=
(
conflict_start
+
HARD_REGNO_NREGS
(
conflict_start
,
reload_mode
[
i
]));
+
HARD_REGNO_NREGS
(
conflict_start
,
reload_mode
[
i
]));
...
@@ -5093,10 +5093,10 @@ int
...
@@ -5093,10 +5093,10 @@ int
reloads_conflict
(
r1
,
r2
)
reloads_conflict
(
r1
,
r2
)
int
r1
,
r2
;
int
r1
,
r2
;
{
{
enum
reload_type
r1_type
=
r
eload_when_needed
[
r1
]
;
enum
reload_type
r1_type
=
r
ld
[
r1
].
when_needed
;
enum
reload_type
r2_type
=
r
eload_when_needed
[
r2
]
;
enum
reload_type
r2_type
=
r
ld
[
r2
].
when_needed
;
int
r1_opnum
=
r
eload_opnum
[
r1
]
;
int
r1_opnum
=
r
ld
[
r1
].
opnum
;
int
r2_opnum
=
r
eload_opnum
[
r2
]
;
int
r2_opnum
=
r
ld
[
r2
].
opnum
;
/* RELOAD_OTHER conflicts with everything. */
/* RELOAD_OTHER conflicts with everything. */
if
(
r2_type
==
RELOAD_OTHER
)
if
(
r2_type
==
RELOAD_OTHER
)
...
@@ -5282,17 +5282,17 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum,
...
@@ -5282,17 +5282,17 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum,
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
{
{
rtx
reg
=
r
eload_reg_rtx
[
i
]
;
rtx
reg
=
r
ld
[
i
].
reg_rtx
;
if
(
reg
&&
GET_CODE
(
reg
)
==
REG
if
(
reg
&&
GET_CODE
(
reg
)
==
REG
&&
((
unsigned
)
regno
-
true_regnum
(
reg
)
&&
((
unsigned
)
regno
-
true_regnum
(
reg
)
<=
HARD_REGNO_NREGS
(
REGNO
(
reg
),
GET_MODE
(
reg
))
-
(
unsigned
)
1
)
<=
HARD_REGNO_NREGS
(
REGNO
(
reg
),
GET_MODE
(
reg
))
-
(
unsigned
)
1
)
&&
i
!=
reloadnum
)
&&
i
!=
reloadnum
)
{
{
if
(
!
r
eload_in
[
i
]
||
!
rtx_equal_p
(
reload_in
[
i
]
,
value
)
if
(
!
r
ld
[
i
].
in
||
!
rtx_equal_p
(
rld
[
i
].
in
,
value
)
||
r
eload_out
[
i
]
||
out
)
||
r
ld
[
i
].
out
||
out
)
{
{
int
time2
;
int
time2
;
switch
(
r
eload_when_needed
[
i
]
)
switch
(
r
ld
[
i
].
when_needed
)
{
{
case
RELOAD_FOR_OTHER_ADDRESS
:
case
RELOAD_FOR_OTHER_ADDRESS
:
time2
=
0
;
time2
=
0
;
...
@@ -5309,34 +5309,34 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum,
...
@@ -5309,34 +5309,34 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum,
/* Unless the RELOAD_FOR_INPUT is an auto_inc expression.
/* Unless the RELOAD_FOR_INPUT is an auto_inc expression.
Then the address address is still needed to store
Then the address address is still needed to store
back the new address. */
back the new address. */
&&
!
r
eload_out
[
reloadnum
]
)
&&
!
r
ld
[
reloadnum
].
out
)
continue
;
continue
;
/* Likewise, if a RELOAD_FOR_INPUT can inherit a value, its
/* Likewise, if a RELOAD_FOR_INPUT can inherit a value, its
RELOAD_FOR_INPUT_ADDRESS / RELOAD_FOR_INPADDR_ADDRESS
RELOAD_FOR_INPUT_ADDRESS / RELOAD_FOR_INPADDR_ADDRESS
reloads go away. */
reloads go away. */
if
(
type
==
RELOAD_FOR_INPUT
&&
opnum
==
r
eload_opnum
[
i
]
if
(
type
==
RELOAD_FOR_INPUT
&&
opnum
==
r
ld
[
i
].
opnum
&&
ignore_address_reloads
&&
ignore_address_reloads
/* Unless we are reloading an auto_inc expression. */
/* Unless we are reloading an auto_inc expression. */
&&
!
r
eload_out
[
reloadnum
]
)
&&
!
r
ld
[
reloadnum
].
out
)
continue
;
continue
;
time2
=
r
eload_opnum
[
i
]
*
4
+
2
;
time2
=
r
ld
[
i
].
opnum
*
4
+
2
;
break
;
break
;
case
RELOAD_FOR_INPUT_ADDRESS
:
case
RELOAD_FOR_INPUT_ADDRESS
:
if
(
type
==
RELOAD_FOR_INPUT
&&
opnum
==
r
eload_opnum
[
i
]
if
(
type
==
RELOAD_FOR_INPUT
&&
opnum
==
r
ld
[
i
].
opnum
&&
ignore_address_reloads
&&
ignore_address_reloads
&&
!
r
eload_out
[
reloadnum
]
)
&&
!
r
ld
[
reloadnum
].
out
)
continue
;
continue
;
time2
=
r
eload_opnum
[
i
]
*
4
+
3
;
time2
=
r
ld
[
i
].
opnum
*
4
+
3
;
break
;
break
;
case
RELOAD_FOR_INPUT
:
case
RELOAD_FOR_INPUT
:
time2
=
r
eload_opnum
[
i
]
*
4
+
4
;
time2
=
r
ld
[
i
].
opnum
*
4
+
4
;
break
;
break
;
/* r
eload_opnum[i]
* 4 + 4 <= (MAX_RECOG_OPERAND - 1) * 4 + 4
/* r
ld[i].opnum
* 4 + 4 <= (MAX_RECOG_OPERAND - 1) * 4 + 4
== MAX_RECOG_OPERAND * 4 */
== MAX_RECOG_OPERAND * 4 */
case
RELOAD_FOR_OPADDR_ADDR
:
case
RELOAD_FOR_OPADDR_ADDR
:
if
(
type
==
RELOAD_FOR_OPERAND_ADDRESS
&&
reloadnum
==
i
+
1
if
(
type
==
RELOAD_FOR_OPERAND_ADDRESS
&&
reloadnum
==
i
+
1
&&
ignore_address_reloads
&&
ignore_address_reloads
&&
!
r
eload_out
[
reloadnum
]
)
&&
!
r
ld
[
reloadnum
].
out
)
continue
;
continue
;
time2
=
MAX_RECOG_OPERANDS
*
4
+
1
;
time2
=
MAX_RECOG_OPERANDS
*
4
+
1
;
break
;
break
;
...
@@ -5357,17 +5357,17 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum,
...
@@ -5357,17 +5357,17 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum,
case
RELOAD_FOR_OUTADDR_ADDRESS
:
case
RELOAD_FOR_OUTADDR_ADDRESS
:
if
(
type
==
RELOAD_FOR_OUTPUT_ADDRESS
&&
reloadnum
==
i
+
1
if
(
type
==
RELOAD_FOR_OUTPUT_ADDRESS
&&
reloadnum
==
i
+
1
&&
ignore_address_reloads
&&
ignore_address_reloads
&&
!
r
eload_out
[
reloadnum
]
)
&&
!
r
ld
[
reloadnum
].
out
)
continue
;
continue
;
time2
=
MAX_RECOG_OPERANDS
*
4
+
4
+
r
eload_opnum
[
i
]
;
time2
=
MAX_RECOG_OPERANDS
*
4
+
4
+
r
ld
[
i
].
opnum
;
break
;
break
;
case
RELOAD_FOR_OUTPUT_ADDRESS
:
case
RELOAD_FOR_OUTPUT_ADDRESS
:
time2
=
MAX_RECOG_OPERANDS
*
4
+
5
+
r
eload_opnum
[
i
]
;
time2
=
MAX_RECOG_OPERANDS
*
4
+
5
+
r
ld
[
i
].
opnum
;
break
;
break
;
case
RELOAD_OTHER
:
case
RELOAD_OTHER
:
/* If there is no conflict in the input part, handle this
/* If there is no conflict in the input part, handle this
like an output reload. */
like an output reload. */
if
(
!
r
eload_in
[
i
]
||
rtx_equal_p
(
reload_in
[
i
]
,
value
))
if
(
!
r
ld
[
i
].
in
||
rtx_equal_p
(
rld
[
i
].
in
,
value
))
{
{
time2
=
MAX_RECOG_OPERANDS
*
4
+
4
;
time2
=
MAX_RECOG_OPERANDS
*
4
+
4
;
break
;
break
;
...
@@ -5384,9 +5384,9 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum,
...
@@ -5384,9 +5384,9 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum,
return
0
;
return
0
;
}
}
if
((
time1
>=
time2
if
((
time1
>=
time2
&&
(
!
r
eload_in
[
i
]
||
reload_out
[
i
]
&&
(
!
r
ld
[
i
].
in
||
rld
[
i
].
out
||
!
rtx_equal_p
(
r
eload_in
[
i
]
,
value
)))
||
!
rtx_equal_p
(
r
ld
[
i
].
in
,
value
)))
||
(
out
&&
r
eload_out_reg
[
reloadnum
]
||
(
out
&&
r
ld
[
reloadnum
].
out_reg
&&
time2
>=
MAX_RECOG_OPERANDS
*
4
+
3
))
&&
time2
>=
MAX_RECOG_OPERANDS
*
4
+
3
))
return
0
;
return
0
;
}
}
...
@@ -5399,7 +5399,7 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum,
...
@@ -5399,7 +5399,7 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum,
LAST_RELOAD is non-zero if this is the last reload for the insn being
LAST_RELOAD is non-zero if this is the last reload for the insn being
processed.
processed.
Set r
eload_reg_rtx[R]
to the register allocated.
Set r
ld[R].reg_rtx
to the register allocated.
If NOERROR is nonzero, we return 1 if successful,
If NOERROR is nonzero, we return 1 if successful,
or 0 if we couldn't find a spill reg and we didn't change anything. */
or 0 if we couldn't find a spill reg and we didn't change anything. */
...
@@ -5461,7 +5461,7 @@ allocate_reload_reg (chain, r, last_reload, noerror)
...
@@ -5461,7 +5461,7 @@ allocate_reload_reg (chain, r, last_reload, noerror)
for
(
count
=
0
;
count
<
n_spills
;
count
++
)
for
(
count
=
0
;
count
<
n_spills
;
count
++
)
{
{
int
class
=
(
int
)
r
eload_reg_class
[
r
]
;
int
class
=
(
int
)
r
ld
[
r
].
class
;
int
regnum
;
int
regnum
;
i
++
;
i
++
;
...
@@ -5469,17 +5469,17 @@ allocate_reload_reg (chain, r, last_reload, noerror)
...
@@ -5469,17 +5469,17 @@ allocate_reload_reg (chain, r, last_reload, noerror)
i
-=
n_spills
;
i
-=
n_spills
;
regnum
=
spill_regs
[
i
];
regnum
=
spill_regs
[
i
];
if
((
reload_reg_free_p
(
regnum
,
r
eload_opnum
[
r
]
,
if
((
reload_reg_free_p
(
regnum
,
r
ld
[
r
].
opnum
,
r
eload_when_needed
[
r
]
)
r
ld
[
r
].
when_needed
)
||
(
r
eload_in
[
r
]
||
(
r
ld
[
r
].
in
/* We check reload_reg_used to make sure we
/* We check reload_reg_used to make sure we
don't clobber the return register. */
don't clobber the return register. */
&&
!
TEST_HARD_REG_BIT
(
reload_reg_used
,
regnum
)
&&
!
TEST_HARD_REG_BIT
(
reload_reg_used
,
regnum
)
&&
reload_reg_free_for_value_p
(
regnum
,
&&
reload_reg_free_for_value_p
(
regnum
,
r
eload_opnum
[
r
]
,
r
ld
[
r
].
opnum
,
r
eload_when_needed
[
r
]
,
r
ld
[
r
].
when_needed
,
r
eload_in
[
r
]
,
r
ld
[
r
].
in
,
r
eload_out
[
r
]
,
r
,
1
)))
r
ld
[
r
].
out
,
r
,
1
)))
&&
TEST_HARD_REG_BIT
(
reg_class_contents
[
class
],
regnum
)
&&
TEST_HARD_REG_BIT
(
reg_class_contents
[
class
],
regnum
)
&&
HARD_REGNO_MODE_OK
(
regnum
,
reload_mode
[
r
])
&&
HARD_REGNO_MODE_OK
(
regnum
,
reload_mode
[
r
])
/* Look first for regs to share, then for unshared. But
/* Look first for regs to share, then for unshared. But
...
@@ -5496,7 +5496,7 @@ allocate_reload_reg (chain, r, last_reload, noerror)
...
@@ -5496,7 +5496,7 @@ allocate_reload_reg (chain, r, last_reload, noerror)
(on 68000) got us two FP regs. If NR is 1,
(on 68000) got us two FP regs. If NR is 1,
we would reject both of them. */
we would reject both of them. */
if
(
force_group
)
if
(
force_group
)
nr
=
CLASS_MAX_NREGS
(
r
eload_reg_class
[
r
]
,
reload_mode
[
r
]);
nr
=
CLASS_MAX_NREGS
(
r
ld
[
r
].
class
,
reload_mode
[
r
]);
/* If we need only one reg, we have already won. */
/* If we need only one reg, we have already won. */
if
(
nr
==
1
)
if
(
nr
==
1
)
{
{
...
@@ -5515,8 +5515,8 @@ allocate_reload_reg (chain, r, last_reload, noerror)
...
@@ -5515,8 +5515,8 @@ allocate_reload_reg (chain, r, last_reload, noerror)
regno
=
regnum
+
nr
-
1
;
regno
=
regnum
+
nr
-
1
;
if
(
!
(
TEST_HARD_REG_BIT
(
reg_class_contents
[
class
],
regno
)
if
(
!
(
TEST_HARD_REG_BIT
(
reg_class_contents
[
class
],
regno
)
&&
spill_reg_order
[
regno
]
>=
0
&&
spill_reg_order
[
regno
]
>=
0
&&
reload_reg_free_p
(
regno
,
r
eload_opnum
[
r
]
,
&&
reload_reg_free_p
(
regno
,
r
ld
[
r
].
opnum
,
r
eload_when_needed
[
r
]
)
r
ld
[
r
].
when_needed
)
&&
!
TEST_HARD_REG_BIT
(
chain
->
counted_for_nongroups
,
&&
!
TEST_HARD_REG_BIT
(
chain
->
counted_for_nongroups
,
regno
)))
regno
)))
break
;
break
;
...
@@ -5556,28 +5556,28 @@ allocate_reload_reg (chain, r, last_reload, noerror)
...
@@ -5556,28 +5556,28 @@ allocate_reload_reg (chain, r, last_reload, noerror)
if
(
HARD_REGNO_MODE_OK
(
regno
,
reload_mode
[
r
]))
if
(
HARD_REGNO_MODE_OK
(
regno
,
reload_mode
[
r
]))
{
{
enum
machine_mode
test_mode
=
VOIDmode
;
enum
machine_mode
test_mode
=
VOIDmode
;
if
(
r
eload_in
[
r
]
)
if
(
r
ld
[
r
].
in
)
test_mode
=
GET_MODE
(
r
eload_in
[
r
]
);
test_mode
=
GET_MODE
(
r
ld
[
r
].
in
);
/* If r
eload_in[r]
has VOIDmode, it means we will load it
/* If r
ld[r].in
has VOIDmode, it means we will load it
in whatever mode the reload reg has: to wit, reload_mode[r].
in whatever mode the reload reg has: to wit, reload_mode[r].
We have already tested that for validity. */
We have already tested that for validity. */
/* Aside from that, we need to test that the expressions
/* Aside from that, we need to test that the expressions
to reload from or into have modes which are valid for this
to reload from or into have modes which are valid for this
reload register. Otherwise the reload insns would be invalid. */
reload register. Otherwise the reload insns would be invalid. */
if
(
!
(
r
eload_in
[
r
]
!=
0
&&
test_mode
!=
VOIDmode
if
(
!
(
r
ld
[
r
].
in
!=
0
&&
test_mode
!=
VOIDmode
&&
!
HARD_REGNO_MODE_OK
(
regno
,
test_mode
)))
&&
!
HARD_REGNO_MODE_OK
(
regno
,
test_mode
)))
if
(
!
(
r
eload_out
[
r
]
!=
0
if
(
!
(
r
ld
[
r
].
out
!=
0
&&
!
HARD_REGNO_MODE_OK
(
regno
,
GET_MODE
(
r
eload_out
[
r
]
))))
&&
!
HARD_REGNO_MODE_OK
(
regno
,
GET_MODE
(
r
ld
[
r
].
out
))))
{
{
/* The reg is OK. */
/* The reg is OK. */
last_spill_reg
=
i
;
last_spill_reg
=
i
;
/* Mark as in use for this insn the reload regs we use
/* Mark as in use for this insn the reload regs we use
for this. */
for this. */
mark_reload_reg_in_use
(
spill_regs
[
i
],
r
eload_opnum
[
r
]
,
mark_reload_reg_in_use
(
spill_regs
[
i
],
r
ld
[
r
].
opnum
,
r
eload_when_needed
[
r
]
,
reload_mode
[
r
]);
r
ld
[
r
].
when_needed
,
reload_mode
[
r
]);
r
eload_reg_rtx
[
r
]
=
new
;
r
ld
[
r
].
reg_rtx
=
new
;
reload_spill_index
[
r
]
=
spill_regs
[
i
];
reload_spill_index
[
r
]
=
spill_regs
[
i
];
return
1
;
return
1
;
}
}
...
@@ -5596,11 +5596,11 @@ allocate_reload_reg (chain, r, last_reload, noerror)
...
@@ -5596,11 +5596,11 @@ allocate_reload_reg (chain, r, last_reload, noerror)
don't match. Disable this reload so we don't crash in final. */
don't match. Disable this reload so we don't crash in final. */
error_for_asm
(
insn
,
error_for_asm
(
insn
,
"`asm' operand constraint incompatible with operand size"
);
"`asm' operand constraint incompatible with operand size"
);
r
eload_in
[
r
]
=
0
;
r
ld
[
r
].
in
=
0
;
r
eload_out
[
r
]
=
0
;
r
ld
[
r
].
out
=
0
;
r
eload_reg_rtx
[
r
]
=
0
;
r
ld
[
r
].
reg_rtx
=
0
;
r
eload_optional
[
r
]
=
1
;
r
ld
[
r
].
optional
=
1
;
r
eload_secondary_p
[
r
]
=
1
;
r
ld
[
r
].
secondary_p
=
1
;
return
1
;
return
1
;
}
}
...
@@ -5685,11 +5685,11 @@ choose_reload_regs (chain)
...
@@ -5685,11 +5685,11 @@ choose_reload_regs (chain)
{
{
int tem = 0;
int tem = 0;
for (j = 0; j < n_reloads; j++)
for (j = 0; j < n_reloads; j++)
if (! r
eload_optional[j]
if (! r
ld[j].optional
&& (r
eload_in[j] != 0 || reload_out[j] != 0 || reload_secondary_p[j]
)
&& (r
ld[j].in != 0 || rld[j].out != 0 || rld[j].secondary_p
)
&& (r
eload_reg_rtx[j]
== 0
&& (r
ld[j].reg_rtx
== 0
|| (! rtx_equal_p (r
eload_reg_rtx[j], reload_in[j]
)
|| (! rtx_equal_p (r
ld[j].reg_rtx, rld[j].in
)
&& ! rtx_equal_p (r
eload_reg_rtx[j], reload_out[j]
))))
&& ! rtx_equal_p (r
ld[j].reg_rtx, rld[j].out
))))
tem++;
tem++;
if (tem > n_spills)
if (tem > n_spills)
must_reuse = 1;
must_reuse = 1;
...
@@ -5710,32 +5710,30 @@ choose_reload_regs (chain)
...
@@ -5710,32 +5710,30 @@ choose_reload_regs (chain)
reload_order
[
j
]
=
j
;
reload_order
[
j
]
=
j
;
reload_spill_index
[
j
]
=
-
1
;
reload_spill_index
[
j
]
=
-
1
;
reload_mode
[
j
]
reload_mode
[
j
]
=
((
rld
[
j
].
inmode
==
VOIDmode
=
((
reload_inmode
[
j
]
==
VOIDmode
||
(
GET_MODE_SIZE
(
rld
[
j
].
outmode
)
||
(
GET_MODE_SIZE
(
reload_outmode
[
j
])
>
GET_MODE_SIZE
(
rld
[
j
].
inmode
)))
>
GET_MODE_SIZE
(
reload_inmode
[
j
])))
?
rld
[
j
].
outmode
:
rld
[
j
].
inmode
);
?
reload_outmode
[
j
]
:
reload_inmode
[
j
]);
reload_nregs
[
j
]
=
CLASS_MAX_NREGS
(
r
eload_reg_class
[
j
]
,
reload_mode
[
j
]);
reload_nregs
[
j
]
=
CLASS_MAX_NREGS
(
r
ld
[
j
].
class
,
reload_mode
[
j
]);
if
(
reload_nregs
[
j
]
>
1
)
if
(
reload_nregs
[
j
]
>
1
)
{
{
max_group_size
=
MAX
(
reload_nregs
[
j
],
max_group_size
);
max_group_size
=
MAX
(
reload_nregs
[
j
],
max_group_size
);
group_class
=
reg_class_superunion
[(
int
)
r
eload_reg_class
[
j
]
][(
int
)
group_class
];
group_class
=
reg_class_superunion
[(
int
)
r
ld
[
j
].
class
][(
int
)
group_class
];
}
}
save_reload_reg_rtx
[
j
]
=
rld
[
j
].
reg_rtx
;
/* If we have already decided to use a certain register,
/* If we have already decided to use a certain register,
don't use it in another way. */
don't use it in another way. */
if
(
r
eload_reg_rtx
[
j
]
)
if
(
r
ld
[
j
].
reg_rtx
)
mark_reload_reg_in_use
(
REGNO
(
r
eload_reg_rtx
[
j
]),
reload_opnum
[
j
]
,
mark_reload_reg_in_use
(
REGNO
(
r
ld
[
j
].
reg_rtx
),
rld
[
j
].
opnum
,
r
eload_when_needed
[
j
]
,
reload_mode
[
j
]);
r
ld
[
j
].
when_needed
,
reload_mode
[
j
]);
}
}
if
(
n_reloads
>
1
)
if
(
n_reloads
>
1
)
qsort
(
reload_order
,
n_reloads
,
sizeof
(
short
),
reload_reg_class_lower
);
qsort
(
reload_order
,
n_reloads
,
sizeof
(
short
),
reload_reg_class_lower
);
bcopy
((
char
*
)
reload_reg_rtx
,
(
char
*
)
save_reload_reg_rtx
,
sizeof
reload_reg_rtx
);
bcopy
(
reload_inherited
,
save_reload_inherited
,
sizeof
reload_inherited
);
bcopy
(
reload_inherited
,
save_reload_inherited
,
sizeof
reload_inherited
);
bcopy
((
char
*
)
reload_inheritance_insn
,
bcopy
((
char
*
)
reload_inheritance_insn
,
(
char
*
)
save_reload_inheritance_insn
,
(
char
*
)
save_reload_inheritance_insn
,
...
@@ -5807,8 +5805,8 @@ choose_reload_regs (chain)
...
@@ -5807,8 +5805,8 @@ choose_reload_regs (chain)
rtx
search_equiv
=
NULL_RTX
;
rtx
search_equiv
=
NULL_RTX
;
/* Ignore reloads that got marked inoperative. */
/* Ignore reloads that got marked inoperative. */
if
(
r
eload_out
[
r
]
==
0
&&
reload_in
[
r
]
==
0
if
(
r
ld
[
r
].
out
==
0
&&
rld
[
r
].
in
==
0
&&
!
r
eload_secondary_p
[
r
]
)
&&
!
r
ld
[
r
].
secondary_p
)
continue
;
continue
;
/* If find_reloads chose to use reload_in or reload_out as a reload
/* If find_reloads chose to use reload_in or reload_out as a reload
...
@@ -5816,11 +5814,11 @@ choose_reload_regs (chain)
...
@@ -5816,11 +5814,11 @@ choose_reload_regs (chain)
found one since we might save an insn if we find the value lying
found one since we might save an insn if we find the value lying
around.
around.
Try also when reload_in is a pseudo without a hard reg. */
Try also when reload_in is a pseudo without a hard reg. */
if
(
r
eload_in
[
r
]
!=
0
&&
reload_reg_rtx
[
r
]
!=
0
if
(
r
ld
[
r
].
in
!=
0
&&
rld
[
r
].
reg_rtx
!=
0
&&
(
rtx_equal_p
(
r
eload_in
[
r
],
reload_reg_rtx
[
r
]
)
&&
(
rtx_equal_p
(
r
ld
[
r
].
in
,
rld
[
r
].
reg_rtx
)
||
(
rtx_equal_p
(
r
eload_out
[
r
],
reload_reg_rtx
[
r
]
)
||
(
rtx_equal_p
(
r
ld
[
r
].
out
,
rld
[
r
].
reg_rtx
)
&&
GET_CODE
(
r
eload_in
[
r
]
)
!=
MEM
&&
GET_CODE
(
r
ld
[
r
].
in
)
!=
MEM
&&
true_regnum
(
r
eload_in
[
r
]
)
<
FIRST_PSEUDO_REGISTER
)))
&&
true_regnum
(
r
ld
[
r
].
in
)
<
FIRST_PSEUDO_REGISTER
)))
continue
;
continue
;
#if 0 /* No longer needed for correct operation.
#if 0 /* No longer needed for correct operation.
...
@@ -5829,13 +5827,13 @@ choose_reload_regs (chain)
...
@@ -5829,13 +5827,13 @@ choose_reload_regs (chain)
until we are sure that any non-optional reloads have been allocated.
until we are sure that any non-optional reloads have been allocated.
The following code takes advantage of the fact that optional reloads
The following code takes advantage of the fact that optional reloads
are at the end of reload_order. */
are at the end of reload_order. */
if (r
eload_optional[r]
!= 0)
if (r
ld[r].optional
!= 0)
for (i = 0; i < j; i++)
for (i = 0; i < j; i++)
if ((r
eload_out[reload_order[i]]
!= 0
if ((r
ld[reload_order[i]].out
!= 0
|| r
eload_in[reload_order[i]]
!= 0
|| r
ld[reload_order[i]].in
!= 0
|| r
eload_secondary_p[reload_order[i]]
)
|| r
ld[reload_order[i]].secondary_p
)
&& ! r
eload_optional[reload_order[i]]
&& ! r
ld[reload_order[i]].optional
&& r
eload_reg_rtx[reload_order[i]]
== 0)
&& r
ld[reload_order[i]].reg_rtx
== 0)
allocate_reload_reg (chain, reload_order[i], 0, inheritance);
allocate_reload_reg (chain, reload_order[i], 0, inheritance);
#endif
#endif
...
@@ -5859,51 +5857,51 @@ choose_reload_regs (chain)
...
@@ -5859,51 +5857,51 @@ choose_reload_regs (chain)
register
int
regno
=
-
1
;
register
int
regno
=
-
1
;
enum
machine_mode
mode
=
VOIDmode
;
enum
machine_mode
mode
=
VOIDmode
;
if
(
r
eload_in
[
r
]
==
0
)
if
(
r
ld
[
r
].
in
==
0
)
;
;
else
if
(
GET_CODE
(
r
eload_in
[
r
]
)
==
REG
)
else
if
(
GET_CODE
(
r
ld
[
r
].
in
)
==
REG
)
{
{
regno
=
REGNO
(
r
eload_in
[
r
]
);
regno
=
REGNO
(
r
ld
[
r
].
in
);
mode
=
GET_MODE
(
r
eload_in
[
r
]
);
mode
=
GET_MODE
(
r
ld
[
r
].
in
);
}
}
else
if
(
GET_CODE
(
r
eload_in_reg
[
r
]
)
==
REG
)
else
if
(
GET_CODE
(
r
ld
[
r
].
in_reg
)
==
REG
)
{
{
regno
=
REGNO
(
r
eload_in_reg
[
r
]
);
regno
=
REGNO
(
r
ld
[
r
].
in_reg
);
mode
=
GET_MODE
(
r
eload_in_reg
[
r
]
);
mode
=
GET_MODE
(
r
ld
[
r
].
in_reg
);
}
}
else
if
(
GET_CODE
(
r
eload_in_reg
[
r
]
)
==
SUBREG
else
if
(
GET_CODE
(
r
ld
[
r
].
in_reg
)
==
SUBREG
&&
GET_CODE
(
SUBREG_REG
(
r
eload_in_reg
[
r
]
))
==
REG
)
&&
GET_CODE
(
SUBREG_REG
(
r
ld
[
r
].
in_reg
))
==
REG
)
{
{
word
=
SUBREG_WORD
(
r
eload_in_reg
[
r
]
);
word
=
SUBREG_WORD
(
r
ld
[
r
].
in_reg
);
regno
=
REGNO
(
SUBREG_REG
(
r
eload_in_reg
[
r
]
));
regno
=
REGNO
(
SUBREG_REG
(
r
ld
[
r
].
in_reg
));
if
(
regno
<
FIRST_PSEUDO_REGISTER
)
if
(
regno
<
FIRST_PSEUDO_REGISTER
)
regno
+=
word
;
regno
+=
word
;
mode
=
GET_MODE
(
r
eload_in_reg
[
r
]
);
mode
=
GET_MODE
(
r
ld
[
r
].
in_reg
);
}
}
#ifdef AUTO_INC_DEC
#ifdef AUTO_INC_DEC
else
if
((
GET_CODE
(
r
eload_in_reg
[
r
]
)
==
PRE_INC
else
if
((
GET_CODE
(
r
ld
[
r
].
in_reg
)
==
PRE_INC
||
GET_CODE
(
r
eload_in_reg
[
r
]
)
==
PRE_DEC
||
GET_CODE
(
r
ld
[
r
].
in_reg
)
==
PRE_DEC
||
GET_CODE
(
r
eload_in_reg
[
r
]
)
==
POST_INC
||
GET_CODE
(
r
ld
[
r
].
in_reg
)
==
POST_INC
||
GET_CODE
(
r
eload_in_reg
[
r
]
)
==
POST_DEC
)
||
GET_CODE
(
r
ld
[
r
].
in_reg
)
==
POST_DEC
)
&&
GET_CODE
(
XEXP
(
r
eload_in_reg
[
r
]
,
0
))
==
REG
)
&&
GET_CODE
(
XEXP
(
r
ld
[
r
].
in_reg
,
0
))
==
REG
)
{
{
regno
=
REGNO
(
XEXP
(
r
eload_in_reg
[
r
]
,
0
));
regno
=
REGNO
(
XEXP
(
r
ld
[
r
].
in_reg
,
0
));
mode
=
GET_MODE
(
XEXP
(
r
eload_in_reg
[
r
]
,
0
));
mode
=
GET_MODE
(
XEXP
(
r
ld
[
r
].
in_reg
,
0
));
r
eload_out
[
r
]
=
reload_in
[
r
]
;
r
ld
[
r
].
out
=
rld
[
r
].
in
;
}
}
#endif
#endif
#if 0
#if 0
/* This won't work, since REGNO can be a pseudo reg number.
/* This won't work, since REGNO can be a pseudo reg number.
Also, it takes much more hair to keep track of all the things
Also, it takes much more hair to keep track of all the things
that can invalidate an inherited reload of part of a pseudoreg. */
that can invalidate an inherited reload of part of a pseudoreg. */
else if (GET_CODE (r
eload_in[r]
) == SUBREG
else if (GET_CODE (r
ld[r].in
) == SUBREG
&& GET_CODE (SUBREG_REG (r
eload_in[r]
)) == REG)
&& GET_CODE (SUBREG_REG (r
ld[r].in
)) == REG)
regno = REGNO (SUBREG_REG (r
eload_in[r])) + SUBREG_WORD (reload_in[r]
);
regno = REGNO (SUBREG_REG (r
ld[r].in)) + SUBREG_WORD (rld[r].in
);
#endif
#endif
if
(
regno
>=
0
&&
reg_last_reload_reg
[
regno
]
!=
0
)
if
(
regno
>=
0
&&
reg_last_reload_reg
[
regno
]
!=
0
)
{
{
enum
reg_class
class
=
r
eload_reg_class
[
r
]
,
last_class
;
enum
reg_class
class
=
r
ld
[
r
].
class
,
last_class
;
rtx
last_reg
=
reg_last_reload_reg
[
regno
];
rtx
last_reg
=
reg_last_reload_reg
[
regno
];
i
=
REGNO
(
last_reg
)
+
word
;
i
=
REGNO
(
last_reg
)
+
word
;
...
@@ -5934,9 +5932,9 @@ choose_reload_regs (chain)
...
@@ -5934,9 +5932,9 @@ choose_reload_regs (chain)
&&
(
reload_nregs
[
r
]
==
max_group_size
&&
(
reload_nregs
[
r
]
==
max_group_size
||
!
TEST_HARD_REG_BIT
(
reg_class_contents
[(
int
)
group_class
],
||
!
TEST_HARD_REG_BIT
(
reg_class_contents
[(
int
)
group_class
],
i
))
i
))
&&
reload_reg_free_for_value_p
(
i
,
r
eload_opnum
[
r
]
,
&&
reload_reg_free_for_value_p
(
i
,
r
ld
[
r
].
opnum
,
r
eload_when_needed
[
r
]
,
r
ld
[
r
].
when_needed
,
r
eload_in
[
r
]
,
r
ld
[
r
].
in
,
const0_rtx
,
r
,
1
))
const0_rtx
,
r
,
1
))
{
{
/* If a group is needed, verify that all the subsequent
/* If a group is needed, verify that all the subsequent
...
@@ -5972,28 +5970,28 @@ choose_reload_regs (chain)
...
@@ -5972,28 +5970,28 @@ choose_reload_regs (chain)
if
(
i1
!=
n_earlyclobbers
if
(
i1
!=
n_earlyclobbers
||
!
(
reload_reg_free_for_value_p
||
!
(
reload_reg_free_for_value_p
(
i
,
r
eload_opnum
[
r
],
reload_when_needed
[
r
]
,
(
i
,
r
ld
[
r
].
opnum
,
rld
[
r
].
when_needed
,
r
eload_in
[
r
],
reload_out
[
r
]
,
r
,
1
))
r
ld
[
r
].
in
,
rld
[
r
].
out
,
r
,
1
))
/* Don't use it if we'd clobber a pseudo reg. */
/* Don't use it if we'd clobber a pseudo reg. */
||
(
TEST_HARD_REG_BIT
(
reg_used_in_insn
,
i
)
||
(
TEST_HARD_REG_BIT
(
reg_used_in_insn
,
i
)
&&
r
eload_out
[
r
]
&&
r
ld
[
r
].
out
&&
!
TEST_HARD_REG_BIT
(
reg_reloaded_dead
,
i
))
&&
!
TEST_HARD_REG_BIT
(
reg_reloaded_dead
,
i
))
/* Don't clobber the frame pointer. */
/* Don't clobber the frame pointer. */
||
(
i
==
HARD_FRAME_POINTER_REGNUM
||
(
i
==
HARD_FRAME_POINTER_REGNUM
&&
r
eload_out
[
r
]
)
&&
r
ld
[
r
].
out
)
/* Don't really use the inherited spill reg
/* Don't really use the inherited spill reg
if we need it wider than we've got it. */
if we need it wider than we've got it. */
||
(
GET_MODE_SIZE
(
reload_mode
[
r
])
||
(
GET_MODE_SIZE
(
reload_mode
[
r
])
>
GET_MODE_SIZE
(
mode
))
>
GET_MODE_SIZE
(
mode
))
||
!
TEST_HARD_REG_BIT
(
reg_class_contents
[(
int
)
r
eload_reg_class
[
r
]
],
||
!
TEST_HARD_REG_BIT
(
reg_class_contents
[(
int
)
r
ld
[
r
].
class
],
i
)
i
)
/* If find_reloads chose reload_out as reload
/* If find_reloads chose reload_out as reload
register, stay with it - that leaves the
register, stay with it - that leaves the
inherited register for subsequent reloads. */
inherited register for subsequent reloads. */
||
(
r
eload_out
[
r
]
&&
reload_reg_rtx
[
r
]
||
(
r
ld
[
r
].
out
&&
rld
[
r
].
reg_rtx
&&
rtx_equal_p
(
r
eload_out
[
r
]
,
&&
rtx_equal_p
(
r
ld
[
r
].
out
,
r
eload_reg_rtx
[
r
]
)))
r
ld
[
r
].
reg_rtx
)))
{
{
reload_override_in
[
r
]
=
last_reg
;
reload_override_in
[
r
]
=
last_reg
;
reload_inheritance_insn
[
r
]
reload_inheritance_insn
[
r
]
...
@@ -6006,10 +6004,10 @@ choose_reload_regs (chain)
...
@@ -6006,10 +6004,10 @@ choose_reload_regs (chain)
/* Mark the register as in use for this part of
/* Mark the register as in use for this part of
the insn. */
the insn. */
mark_reload_reg_in_use
(
i
,
mark_reload_reg_in_use
(
i
,
r
eload_opnum
[
r
]
,
r
ld
[
r
].
opnum
,
r
eload_when_needed
[
r
]
,
r
ld
[
r
].
when_needed
,
reload_mode
[
r
]);
reload_mode
[
r
]);
r
eload_reg_rtx
[
r
]
=
last_reg
;
r
ld
[
r
].
reg_rtx
=
last_reg
;
reload_inherited
[
r
]
=
1
;
reload_inherited
[
r
]
=
1
;
reload_inheritance_insn
[
r
]
reload_inheritance_insn
[
r
]
=
reg_reloaded_insn
[
i
];
=
reg_reloaded_insn
[
i
];
...
@@ -6025,24 +6023,24 @@ choose_reload_regs (chain)
...
@@ -6025,24 +6023,24 @@ choose_reload_regs (chain)
/* Here's another way to see if the value is already lying around. */
/* Here's another way to see if the value is already lying around. */
if
(
inheritance
if
(
inheritance
&&
r
eload_in
[
r
]
!=
0
&&
r
ld
[
r
].
in
!=
0
&&
!
reload_inherited
[
r
]
&&
!
reload_inherited
[
r
]
&&
r
eload_out
[
r
]
==
0
&&
r
ld
[
r
].
out
==
0
&&
(
CONSTANT_P
(
r
eload_in
[
r
]
)
&&
(
CONSTANT_P
(
r
ld
[
r
].
in
)
||
GET_CODE
(
r
eload_in
[
r
]
)
==
PLUS
||
GET_CODE
(
r
ld
[
r
].
in
)
==
PLUS
||
GET_CODE
(
r
eload_in
[
r
]
)
==
REG
||
GET_CODE
(
r
ld
[
r
].
in
)
==
REG
||
GET_CODE
(
r
eload_in
[
r
]
)
==
MEM
)
||
GET_CODE
(
r
ld
[
r
].
in
)
==
MEM
)
&&
(
reload_nregs
[
r
]
==
max_group_size
&&
(
reload_nregs
[
r
]
==
max_group_size
||
!
reg_classes_intersect_p
(
r
eload_reg_class
[
r
]
,
group_class
)))
||
!
reg_classes_intersect_p
(
r
ld
[
r
].
class
,
group_class
)))
search_equiv
=
r
eload_in
[
r
]
;
search_equiv
=
r
ld
[
r
].
in
;
/* If this is an output reload from a simple move insn, look
/* If this is an output reload from a simple move insn, look
if an equivalence for the input is available. */
if an equivalence for the input is available. */
else
if
(
inheritance
&&
r
eload_in
[
r
]
==
0
&&
reload_out
[
r
]
!=
0
)
else
if
(
inheritance
&&
r
ld
[
r
].
in
==
0
&&
rld
[
r
].
out
!=
0
)
{
{
rtx
set
=
single_set
(
insn
);
rtx
set
=
single_set
(
insn
);
if
(
set
if
(
set
&&
rtx_equal_p
(
r
eload_out
[
r
]
,
SET_DEST
(
set
))
&&
rtx_equal_p
(
r
ld
[
r
].
out
,
SET_DEST
(
set
))
&&
CONSTANT_P
(
SET_SRC
(
set
)))
&&
CONSTANT_P
(
SET_SRC
(
set
)))
search_equiv
=
SET_SRC
(
set
);
search_equiv
=
SET_SRC
(
set
);
}
}
...
@@ -6050,7 +6048,7 @@ choose_reload_regs (chain)
...
@@ -6050,7 +6048,7 @@ choose_reload_regs (chain)
if
(
search_equiv
)
if
(
search_equiv
)
{
{
register
rtx
equiv
register
rtx
equiv
=
find_equiv_reg
(
search_equiv
,
insn
,
r
eload_reg_class
[
r
]
,
=
find_equiv_reg
(
search_equiv
,
insn
,
r
ld
[
r
].
class
,
-
1
,
NULL_PTR
,
0
,
reload_mode
[
r
]);
-
1
,
NULL_PTR
,
0
,
reload_mode
[
r
]);
int
regno
;
int
regno
;
...
@@ -6075,11 +6073,11 @@ choose_reload_regs (chain)
...
@@ -6075,11 +6073,11 @@ choose_reload_regs (chain)
and of the desired class. */
and of the desired class. */
if
(
equiv
!=
0
if
(
equiv
!=
0
&&
((
TEST_HARD_REG_BIT
(
reload_reg_used_at_all
,
regno
)
&&
((
TEST_HARD_REG_BIT
(
reload_reg_used_at_all
,
regno
)
&&
!
reload_reg_free_for_value_p
(
regno
,
r
eload_opnum
[
r
]
,
&&
!
reload_reg_free_for_value_p
(
regno
,
r
ld
[
r
].
opnum
,
r
eload_when_needed
[
r
]
,
r
ld
[
r
].
when_needed
,
r
eload_in
[
r
]
,
r
ld
[
r
].
in
,
r
eload_out
[
r
]
,
r
,
1
))
r
ld
[
r
].
out
,
r
,
1
))
||
!
TEST_HARD_REG_BIT
(
reg_class_contents
[(
int
)
r
eload_reg_class
[
r
]
],
||
!
TEST_HARD_REG_BIT
(
reg_class_contents
[(
int
)
r
ld
[
r
].
class
],
regno
)))
regno
)))
equiv
=
0
;
equiv
=
0
;
...
@@ -6109,7 +6107,7 @@ choose_reload_regs (chain)
...
@@ -6109,7 +6107,7 @@ choose_reload_regs (chain)
if
(
equiv
!=
0
&&
regno_clobbered_p
(
regno
,
insn
))
if
(
equiv
!=
0
&&
regno_clobbered_p
(
regno
,
insn
))
{
{
switch
(
r
eload_when_needed
[
r
]
)
switch
(
r
ld
[
r
].
when_needed
)
{
{
case
RELOAD_FOR_OTHER_ADDRESS
:
case
RELOAD_FOR_OTHER_ADDRESS
:
case
RELOAD_FOR_INPADDR_ADDRESS
:
case
RELOAD_FOR_INPADDR_ADDRESS
:
...
@@ -6133,7 +6131,7 @@ choose_reload_regs (chain)
...
@@ -6133,7 +6131,7 @@ choose_reload_regs (chain)
{
{
int
nr
=
HARD_REGNO_NREGS
(
regno
,
reload_mode
[
r
]);
int
nr
=
HARD_REGNO_NREGS
(
regno
,
reload_mode
[
r
]);
int
k
;
int
k
;
r
eload_reg_rtx
[
r
]
=
equiv
;
r
ld
[
r
].
reg_rtx
=
equiv
;
reload_inherited
[
r
]
=
1
;
reload_inherited
[
r
]
=
1
;
/* If reg_reloaded_valid is not set for this register,
/* If reg_reloaded_valid is not set for this register,
...
@@ -6149,8 +6147,8 @@ choose_reload_regs (chain)
...
@@ -6149,8 +6147,8 @@ choose_reload_regs (chain)
i
=
spill_reg_order
[
regno
+
k
];
i
=
spill_reg_order
[
regno
+
k
];
if
(
i
>=
0
)
if
(
i
>=
0
)
{
{
mark_reload_reg_in_use
(
regno
,
r
eload_opnum
[
r
]
,
mark_reload_reg_in_use
(
regno
,
r
ld
[
r
].
opnum
,
r
eload_when_needed
[
r
]
,
r
ld
[
r
].
when_needed
,
reload_mode
[
r
]);
reload_mode
[
r
]);
SET_HARD_REG_BIT
(
reload_reg_used_for_inherit
,
SET_HARD_REG_BIT
(
reload_reg_used_for_inherit
,
regno
+
k
);
regno
+
k
);
...
@@ -6161,7 +6159,7 @@ choose_reload_regs (chain)
...
@@ -6161,7 +6159,7 @@ choose_reload_regs (chain)
/* If we found a register to use already, or if this is an optional
/* If we found a register to use already, or if this is an optional
reload, we are done. */
reload, we are done. */
if
(
r
eload_reg_rtx
[
r
]
!=
0
||
reload_optional
[
r
]
!=
0
)
if
(
r
ld
[
r
].
reg_rtx
!=
0
||
rld
[
r
].
optional
!=
0
)
continue
;
continue
;
#if 0 /* No longer needed for correct operation. Might or might not
#if 0 /* No longer needed for correct operation. Might or might not
...
@@ -6180,14 +6178,14 @@ choose_reload_regs (chain)
...
@@ -6180,14 +6178,14 @@ choose_reload_regs (chain)
{
{
int s = reload_order[i];
int s = reload_order[i];
if ((r
eload_in[s] == 0 && reload_out[s]
== 0
if ((r
ld[s].in == 0 && rld[s].out
== 0
&& ! r
eload_secondary_p[s]
)
&& ! r
ld[s].secondary_p
)
|| r
eload_optional[s]
)
|| r
ld[s].optional
)
continue;
continue;
if ((r
eload_reg_class[s] != reload_reg_class[r]
if ((r
ld[s].class != rld[r].class
&& reg_classes_intersect_p (r
eload_reg_class[r]
,
&& reg_classes_intersect_p (r
ld[r].class
,
r
eload_reg_class[s]
))
r
ld[s].class
))
|| reload_nregs[s] < reload_nregs[r])
|| reload_nregs[s] < reload_nregs[r])
break;
break;
}
}
...
@@ -6206,12 +6204,12 @@ choose_reload_regs (chain)
...
@@ -6206,12 +6204,12 @@ choose_reload_regs (chain)
register
int
r
=
reload_order
[
j
];
register
int
r
=
reload_order
[
j
];
/* Ignore reloads that got marked inoperative. */
/* Ignore reloads that got marked inoperative. */
if
(
r
eload_out
[
r
]
==
0
&&
reload_in
[
r
]
==
0
&&
!
reload_secondary_p
[
r
]
)
if
(
r
ld
[
r
].
out
==
0
&&
rld
[
r
].
in
==
0
&&
!
rld
[
r
].
secondary_p
)
continue
;
continue
;
/* Skip reloads that already have a register allocated or are
/* Skip reloads that already have a register allocated or are
optional. */
optional. */
if
(
r
eload_reg_rtx
[
r
]
!=
0
||
reload_optional
[
r
]
)
if
(
r
ld
[
r
].
reg_rtx
!=
0
||
rld
[
r
].
optional
)
continue
;
continue
;
if
(
!
allocate_reload_reg
(
chain
,
r
,
j
==
n_reloads
-
1
,
inheritance
))
if
(
!
allocate_reload_reg
(
chain
,
r
,
j
==
n_reloads
-
1
,
inheritance
))
...
@@ -6225,8 +6223,8 @@ choose_reload_regs (chain)
...
@@ -6225,8 +6223,8 @@ choose_reload_regs (chain)
/* Loop around and try without any inheritance. */
/* Loop around and try without any inheritance. */
/* First undo everything done by the failed attempt
/* First undo everything done by the failed attempt
to allocate with inheritance. */
to allocate with inheritance. */
bcopy
((
char
*
)
save_reload_reg_rtx
,
(
char
*
)
reload_reg_rtx
,
for
(
i
=
0
;
i
<
n_reloads
;
i
++
)
sizeof
reload_reg_rtx
)
;
rld
[
i
].
reg_rtx
=
save_reload_reg_rtx
[
i
]
;
bcopy
((
char
*
)
save_reload_inherited
,
(
char
*
)
reload_inherited
,
bcopy
((
char
*
)
save_reload_inherited
,
(
char
*
)
reload_inherited
,
sizeof
reload_inherited
);
sizeof
reload_inherited
);
bcopy
((
char
*
)
save_reload_inheritance_insn
,
bcopy
((
char
*
)
save_reload_inheritance_insn
,
...
@@ -6278,8 +6276,8 @@ choose_reload_regs (chain)
...
@@ -6278,8 +6276,8 @@ choose_reload_regs (chain)
{
{
register
int
r
=
reload_order
[
j
];
register
int
r
=
reload_order
[
j
];
rtx
check_reg
;
rtx
check_reg
;
if
(
reload_inherited
[
r
]
&&
r
eload_reg_rtx
[
r
]
)
if
(
reload_inherited
[
r
]
&&
r
ld
[
r
].
reg_rtx
)
check_reg
=
r
eload_reg_rtx
[
r
]
;
check_reg
=
r
ld
[
r
].
reg_rtx
;
else
if
(
reload_override_in
[
r
]
else
if
(
reload_override_in
[
r
]
&&
(
GET_CODE
(
reload_override_in
[
r
])
==
REG
&&
(
GET_CODE
(
reload_override_in
[
r
])
==
REG
||
GET_CODE
(
reload_override_in
[
r
])
==
SUBREG
))
||
GET_CODE
(
reload_override_in
[
r
])
==
SUBREG
))
...
@@ -6287,11 +6285,11 @@ choose_reload_regs (chain)
...
@@ -6287,11 +6285,11 @@ choose_reload_regs (chain)
else
else
continue
;
continue
;
if
(
!
reload_reg_free_for_value_p
(
true_regnum
(
check_reg
),
if
(
!
reload_reg_free_for_value_p
(
true_regnum
(
check_reg
),
r
eload_opnum
[
r
]
,
r
ld
[
r
].
opnum
,
r
eload_when_needed
[
r
]
,
r
ld
[
r
].
when_needed
,
r
eload_in
[
r
]
,
r
ld
[
r
].
in
,
(
reload_inherited
[
r
]
(
reload_inherited
[
r
]
?
r
eload_out
[
r
]
:
const0_rtx
),
?
r
ld
[
r
].
out
:
const0_rtx
),
r
,
1
))
r
,
1
))
{
{
if
(
pass
)
if
(
pass
)
...
@@ -6311,9 +6309,9 @@ choose_reload_regs (chain)
...
@@ -6311,9 +6309,9 @@ choose_reload_regs (chain)
If we suceeded removing some reload and we are doing a preliminary
If we suceeded removing some reload and we are doing a preliminary
pass just to remove such reloads, make another pass, since the
pass just to remove such reloads, make another pass, since the
removal of one reload might allow us to inherit another one. */
removal of one reload might allow us to inherit another one. */
else
if
(
r
eload_in
[
r
]
else
if
(
r
ld
[
r
].
in
&&
r
eload_out
[
r
]
!=
reload_in
[
r
]
&&
r
ld
[
r
].
out
!=
rld
[
r
].
in
&&
remove_address_replacements
(
r
eload_in
[
r
]
)
&&
pass
)
&&
remove_address_replacements
(
r
ld
[
r
].
in
)
&&
pass
)
pass
=
2
;
pass
=
2
;
}
}
}
}
...
@@ -6322,23 +6320,23 @@ choose_reload_regs (chain)
...
@@ -6322,23 +6320,23 @@ choose_reload_regs (chain)
actually override reload_in. */
actually override reload_in. */
for
(
j
=
0
;
j
<
n_reloads
;
j
++
)
for
(
j
=
0
;
j
<
n_reloads
;
j
++
)
if
(
reload_override_in
[
j
])
if
(
reload_override_in
[
j
])
r
eload_in
[
j
]
=
reload_override_in
[
j
];
r
ld
[
j
].
in
=
reload_override_in
[
j
];
/* If this reload won't be done because it has been cancelled or is
/* If this reload won't be done because it has been cancelled or is
optional and not inherited, clear reload_reg_rtx so other
optional and not inherited, clear reload_reg_rtx so other
routines (such as subst_reloads) don't get confused. */
routines (such as subst_reloads) don't get confused. */
for
(
j
=
0
;
j
<
n_reloads
;
j
++
)
for
(
j
=
0
;
j
<
n_reloads
;
j
++
)
if
(
r
eload_reg_rtx
[
j
]
!=
0
if
(
r
ld
[
j
].
reg_rtx
!=
0
&&
((
r
eload_optional
[
j
]
&&
!
reload_inherited
[
j
])
&&
((
r
ld
[
j
].
optional
&&
!
reload_inherited
[
j
])
||
(
r
eload_in
[
j
]
==
0
&&
reload_out
[
j
]
==
0
||
(
r
ld
[
j
].
in
==
0
&&
rld
[
j
].
out
==
0
&&
!
r
eload_secondary_p
[
j
]
)))
&&
!
r
ld
[
j
].
secondary_p
)))
{
{
int
regno
=
true_regnum
(
r
eload_reg_rtx
[
j
]
);
int
regno
=
true_regnum
(
r
ld
[
j
].
reg_rtx
);
if
(
spill_reg_order
[
regno
]
>=
0
)
if
(
spill_reg_order
[
regno
]
>=
0
)
clear_reload_reg_in_use
(
regno
,
r
eload_opnum
[
j
]
,
clear_reload_reg_in_use
(
regno
,
r
ld
[
j
].
opnum
,
r
eload_when_needed
[
j
]
,
reload_mode
[
j
]);
r
ld
[
j
].
when_needed
,
reload_mode
[
j
]);
r
eload_reg_rtx
[
j
]
=
0
;
r
ld
[
j
].
reg_rtx
=
0
;
}
}
/* Record which pseudos and which spill regs have output reloads. */
/* Record which pseudos and which spill regs have output reloads. */
...
@@ -6349,12 +6347,12 @@ choose_reload_regs (chain)
...
@@ -6349,12 +6347,12 @@ choose_reload_regs (chain)
i
=
reload_spill_index
[
r
];
i
=
reload_spill_index
[
r
];
/* I is nonneg if this reload uses a register.
/* I is nonneg if this reload uses a register.
If r
eload_reg_rtx[r]
is 0, this is an optional reload
If r
ld[r].reg_rtx
is 0, this is an optional reload
that we opted to ignore. */
that we opted to ignore. */
if
(
r
eload_out_reg
[
r
]
!=
0
&&
GET_CODE
(
reload_out_reg
[
r
]
)
==
REG
if
(
r
ld
[
r
].
out_reg
!=
0
&&
GET_CODE
(
rld
[
r
].
out_reg
)
==
REG
&&
r
eload_reg_rtx
[
r
]
!=
0
)
&&
r
ld
[
r
].
reg_rtx
!=
0
)
{
{
register
int
nregno
=
REGNO
(
r
eload_out_reg
[
r
]
);
register
int
nregno
=
REGNO
(
r
ld
[
r
].
out_reg
);
int
nr
=
1
;
int
nr
=
1
;
if
(
nregno
<
FIRST_PSEUDO_REGISTER
)
if
(
nregno
<
FIRST_PSEUDO_REGISTER
)
...
@@ -6370,9 +6368,9 @@ choose_reload_regs (chain)
...
@@ -6370,9 +6368,9 @@ choose_reload_regs (chain)
SET_HARD_REG_BIT
(
reg_is_output_reload
,
i
+
nr
);
SET_HARD_REG_BIT
(
reg_is_output_reload
,
i
+
nr
);
}
}
if
(
r
eload_when_needed
[
r
]
!=
RELOAD_OTHER
if
(
r
ld
[
r
].
when_needed
!=
RELOAD_OTHER
&&
r
eload_when_needed
[
r
]
!=
RELOAD_FOR_OUTPUT
&&
r
ld
[
r
].
when_needed
!=
RELOAD_FOR_OUTPUT
&&
r
eload_when_needed
[
r
]
!=
RELOAD_FOR_INSN
)
&&
r
ld
[
r
].
when_needed
!=
RELOAD_FOR_INSN
)
abort
();
abort
();
}
}
}
}
...
@@ -6386,12 +6384,12 @@ deallocate_reload_reg (r)
...
@@ -6386,12 +6384,12 @@ deallocate_reload_reg (r)
{
{
int
regno
;
int
regno
;
if
(
!
r
eload_reg_rtx
[
r
]
)
if
(
!
r
ld
[
r
].
reg_rtx
)
return
;
return
;
regno
=
true_regnum
(
r
eload_reg_rtx
[
r
]
);
regno
=
true_regnum
(
r
ld
[
r
].
reg_rtx
);
r
eload_reg_rtx
[
r
]
=
0
;
r
ld
[
r
].
reg_rtx
=
0
;
if
(
spill_reg_order
[
regno
]
>=
0
)
if
(
spill_reg_order
[
regno
]
>=
0
)
clear_reload_reg_in_use
(
regno
,
r
eload_opnum
[
r
],
reload_when_needed
[
r
]
,
clear_reload_reg_in_use
(
regno
,
r
ld
[
r
].
opnum
,
rld
[
r
].
when_needed
,
reload_mode
[
r
]);
reload_mode
[
r
]);
reload_spill_index
[
r
]
=
-
1
;
reload_spill_index
[
r
]
=
-
1
;
}
}
...
@@ -6425,9 +6423,9 @@ merge_assigned_reloads (insn)
...
@@ -6425,9 +6423,9 @@ merge_assigned_reloads (insn)
int
max_input_address_opnum
=
-
1
;
int
max_input_address_opnum
=
-
1
;
int
min_conflicting_input_opnum
=
MAX_RECOG_OPERANDS
;
int
min_conflicting_input_opnum
=
MAX_RECOG_OPERANDS
;
if
(
r
eload_in
[
i
]
==
0
||
reload_when_needed
[
i
]
==
RELOAD_OTHER
if
(
r
ld
[
i
].
in
==
0
||
rld
[
i
].
when_needed
==
RELOAD_OTHER
||
r
eload_out
[
i
]
!=
0
||
reload_reg_rtx
[
i
]
==
0
||
r
ld
[
i
].
out
!=
0
||
rld
[
i
].
reg_rtx
==
0
||
reg_set_p
(
r
eload_reg_rtx
[
i
]
,
insn
))
||
reg_set_p
(
r
ld
[
i
].
reg_rtx
,
insn
))
continue
;
continue
;
/* Look at all other reloads. Ensure that the only use of this
/* Look at all other reloads. Ensure that the only use of this
...
@@ -6438,32 +6436,32 @@ merge_assigned_reloads (insn)
...
@@ -6438,32 +6436,32 @@ merge_assigned_reloads (insn)
for
(
j
=
0
;
j
<
n_reloads
;
j
++
)
for
(
j
=
0
;
j
<
n_reloads
;
j
++
)
{
{
if
(
i
==
j
||
r
eload_reg_rtx
[
j
]
==
0
if
(
i
==
j
||
r
ld
[
j
].
reg_rtx
==
0
||
!
reg_overlap_mentioned_p
(
r
eload_reg_rtx
[
j
]
,
||
!
reg_overlap_mentioned_p
(
r
ld
[
j
].
reg_rtx
,
r
eload_reg_rtx
[
i
]
))
r
ld
[
i
].
reg_rtx
))
continue
;
continue
;
if
(
r
eload_when_needed
[
j
]
==
RELOAD_FOR_INPUT_ADDRESS
if
(
r
ld
[
j
].
when_needed
==
RELOAD_FOR_INPUT_ADDRESS
&&
r
eload_opnum
[
j
]
>
max_input_address_opnum
)
&&
r
ld
[
j
].
opnum
>
max_input_address_opnum
)
max_input_address_opnum
=
r
eload_opnum
[
j
]
;
max_input_address_opnum
=
r
ld
[
j
].
opnum
;
/* If the reload regs aren't exactly the same (e.g, different modes)
/* If the reload regs aren't exactly the same (e.g, different modes)
or if the values are different, we can't merge this reload.
or if the values are different, we can't merge this reload.
But if it is an input reload, we might still merge
But if it is an input reload, we might still merge
RELOAD_FOR_INPUT_ADDRESS and RELOAD_FOR_OTHER_ADDRESS reloads. */
RELOAD_FOR_INPUT_ADDRESS and RELOAD_FOR_OTHER_ADDRESS reloads. */
if
(
!
rtx_equal_p
(
r
eload_reg_rtx
[
i
],
reload_reg_rtx
[
j
]
)
if
(
!
rtx_equal_p
(
r
ld
[
i
].
reg_rtx
,
rld
[
j
].
reg_rtx
)
||
r
eload_out
[
j
]
!=
0
||
reload_in
[
j
]
==
0
||
r
ld
[
j
].
out
!=
0
||
rld
[
j
].
in
==
0
||
!
rtx_equal_p
(
r
eload_in
[
i
],
reload_in
[
j
]
))
||
!
rtx_equal_p
(
r
ld
[
i
].
in
,
rld
[
j
].
in
))
{
{
if
(
r
eload_when_needed
[
j
]
!=
RELOAD_FOR_INPUT
if
(
r
ld
[
j
].
when_needed
!=
RELOAD_FOR_INPUT
||
((
r
eload_when_needed
[
i
]
!=
RELOAD_FOR_INPUT_ADDRESS
||
((
r
ld
[
i
].
when_needed
!=
RELOAD_FOR_INPUT_ADDRESS
||
r
eload_opnum
[
i
]
>
reload_opnum
[
j
]
)
||
r
ld
[
i
].
opnum
>
rld
[
j
].
opnum
)
&&
r
eload_when_needed
[
i
]
!=
RELOAD_FOR_OTHER_ADDRESS
))
&&
r
ld
[
i
].
when_needed
!=
RELOAD_FOR_OTHER_ADDRESS
))
break
;
break
;
conflicting_input
=
1
;
conflicting_input
=
1
;
if
(
min_conflicting_input_opnum
>
r
eload_opnum
[
j
]
)
if
(
min_conflicting_input_opnum
>
r
ld
[
j
].
opnum
)
min_conflicting_input_opnum
=
r
eload_opnum
[
j
]
;
min_conflicting_input_opnum
=
r
ld
[
j
].
opnum
;
}
}
}
}
...
@@ -6474,14 +6472,14 @@ merge_assigned_reloads (insn)
...
@@ -6474,14 +6472,14 @@ merge_assigned_reloads (insn)
&&
max_input_address_opnum
<=
min_conflicting_input_opnum
)
&&
max_input_address_opnum
<=
min_conflicting_input_opnum
)
{
{
for
(
j
=
0
;
j
<
n_reloads
;
j
++
)
for
(
j
=
0
;
j
<
n_reloads
;
j
++
)
if
(
i
!=
j
&&
r
eload_reg_rtx
[
j
]
!=
0
if
(
i
!=
j
&&
r
ld
[
j
].
reg_rtx
!=
0
&&
rtx_equal_p
(
r
eload_reg_rtx
[
i
],
reload_reg_rtx
[
j
]
)
&&
rtx_equal_p
(
r
ld
[
i
].
reg_rtx
,
rld
[
j
].
reg_rtx
)
&&
(
!
conflicting_input
&&
(
!
conflicting_input
||
r
eload_when_needed
[
j
]
==
RELOAD_FOR_INPUT_ADDRESS
||
r
ld
[
j
].
when_needed
==
RELOAD_FOR_INPUT_ADDRESS
||
r
eload_when_needed
[
j
]
==
RELOAD_FOR_OTHER_ADDRESS
))
||
r
ld
[
j
].
when_needed
==
RELOAD_FOR_OTHER_ADDRESS
))
{
{
r
eload_when_needed
[
i
]
=
RELOAD_OTHER
;
r
ld
[
i
].
when_needed
=
RELOAD_OTHER
;
r
eload_in
[
j
]
=
0
;
r
ld
[
j
].
in
=
0
;
reload_spill_index
[
j
]
=
-
1
;
reload_spill_index
[
j
]
=
-
1
;
transfer_replacements
(
i
,
j
);
transfer_replacements
(
i
,
j
);
}
}
...
@@ -6492,15 +6490,15 @@ merge_assigned_reloads (insn)
...
@@ -6492,15 +6490,15 @@ merge_assigned_reloads (insn)
this test is equivalent to looking for reloads for this operand
this test is equivalent to looking for reloads for this operand
number. */
number. */
if
(
r
eload_when_needed
[
i
]
==
RELOAD_OTHER
)
if
(
r
ld
[
i
].
when_needed
==
RELOAD_OTHER
)
for
(
j
=
0
;
j
<
n_reloads
;
j
++
)
for
(
j
=
0
;
j
<
n_reloads
;
j
++
)
if
(
r
eload_in
[
j
]
!=
0
if
(
r
ld
[
j
].
in
!=
0
&&
r
eload_when_needed
[
i
]
!=
RELOAD_OTHER
&&
r
ld
[
i
].
when_needed
!=
RELOAD_OTHER
&&
reg_overlap_mentioned_for_reload_p
(
r
eload_in
[
j
]
,
&&
reg_overlap_mentioned_for_reload_p
(
r
ld
[
j
].
in
,
r
eload_in
[
i
]
))
r
ld
[
i
].
in
))
r
eload_when_needed
[
j
]
r
ld
[
j
].
when_needed
=
((
r
eload_when_needed
[
i
]
==
RELOAD_FOR_INPUT_ADDRESS
=
((
r
ld
[
i
].
when_needed
==
RELOAD_FOR_INPUT_ADDRESS
||
r
eload_when_needed
[
i
]
==
RELOAD_FOR_INPADDR_ADDRESS
)
||
r
ld
[
i
].
when_needed
==
RELOAD_FOR_INPADDR_ADDRESS
)
?
RELOAD_FOR_OTHER_ADDRESS
:
RELOAD_OTHER
);
?
RELOAD_FOR_OTHER_ADDRESS
:
RELOAD_OTHER
);
}
}
}
}
...
@@ -6555,28 +6553,28 @@ emit_reload_insns (chain)
...
@@ -6555,28 +6553,28 @@ emit_reload_insns (chain)
rtx
this_reload_insn
=
0
;
rtx
this_reload_insn
=
0
;
int
expect_occurrences
=
1
;
int
expect_occurrences
=
1
;
if
(
r
eload_reg_rtx
[
j
]
if
(
r
ld
[
j
].
reg_rtx
&&
REGNO
(
r
eload_reg_rtx
[
j
]
)
<
FIRST_PSEUDO_REGISTER
)
&&
REGNO
(
r
ld
[
j
].
reg_rtx
)
<
FIRST_PSEUDO_REGISTER
)
new_spill_reg_store
[
REGNO
(
r
eload_reg_rtx
[
j
]
)]
=
0
;
new_spill_reg_store
[
REGNO
(
r
ld
[
j
].
reg_rtx
)]
=
0
;
old
=
(
r
eload_in
[
j
]
&&
GET_CODE
(
reload_in
[
j
]
)
==
MEM
old
=
(
r
ld
[
j
].
in
&&
GET_CODE
(
rld
[
j
].
in
)
==
MEM
?
r
eload_in_reg
[
j
]
:
reload_in
[
j
]
);
?
r
ld
[
j
].
in_reg
:
rld
[
j
].
in
);
if
(
old
!=
0
if
(
old
!=
0
/* AUTO_INC reloads need to be handled even if inherited. We got an
/* AUTO_INC reloads need to be handled even if inherited. We got an
AUTO_INC reload if reload_out is set but reload_out_reg isn't. */
AUTO_INC reload if reload_out is set but reload_out_reg isn't. */
&&
(
!
reload_inherited
[
j
]
||
(
r
eload_out
[
j
]
&&
!
reload_out_reg
[
j
]
))
&&
(
!
reload_inherited
[
j
]
||
(
r
ld
[
j
].
out
&&
!
rld
[
j
].
out_reg
))
&&
!
rtx_equal_p
(
r
eload_reg_rtx
[
j
]
,
old
)
&&
!
rtx_equal_p
(
r
ld
[
j
].
reg_rtx
,
old
)
&&
r
eload_reg_rtx
[
j
]
!=
0
)
&&
r
ld
[
j
].
reg_rtx
!=
0
)
{
{
register
rtx
reloadreg
=
r
eload_reg_rtx
[
j
]
;
register
rtx
reloadreg
=
r
ld
[
j
].
reg_rtx
;
rtx
oldequiv
=
0
;
rtx
oldequiv
=
0
;
enum
machine_mode
mode
;
enum
machine_mode
mode
;
rtx
*
where
;
rtx
*
where
;
/* Determine the mode to reload in.
/* Determine the mode to reload in.
This is very tricky because we have three to choose from.
This is very tricky because we have three to choose from.
There is the mode the insn operand wants (r
eload_inmode[J]
).
There is the mode the insn operand wants (r
ld[J].inmode
).
There is the mode of the reload register RELOADREG.
There is the mode of the reload register RELOADREG.
There is the intrinsic mode of the operand, which we could find
There is the intrinsic mode of the operand, which we could find
by stripping some SUBREGs.
by stripping some SUBREGs.
...
@@ -6608,7 +6606,7 @@ emit_reload_insns (chain)
...
@@ -6608,7 +6606,7 @@ emit_reload_insns (chain)
mode
=
GET_MODE
(
old
);
mode
=
GET_MODE
(
old
);
if
(
mode
==
VOIDmode
)
if
(
mode
==
VOIDmode
)
mode
=
r
eload_inmode
[
j
]
;
mode
=
r
ld
[
j
].
inmode
;
#ifdef SECONDARY_INPUT_RELOAD_CLASS
#ifdef SECONDARY_INPUT_RELOAD_CLASS
/* If we need a secondary register for this operation, see if
/* If we need a secondary register for this operation, see if
...
@@ -6616,12 +6614,12 @@ emit_reload_insns (chain)
...
@@ -6616,12 +6614,12 @@ emit_reload_insns (chain)
do this if the secondary register will be used as a scratch
do this if the secondary register will be used as a scratch
register. */
register. */
if
(
r
eload_secondary_in_reload
[
j
]
>=
0
if
(
r
ld
[
j
].
secondary_in_reload
>=
0
&&
r
eload_secondary_in_icode
[
j
]
==
CODE_FOR_nothing
&&
r
ld
[
j
].
secondary_in_icode
==
CODE_FOR_nothing
&&
optimize
)
&&
optimize
)
oldequiv
oldequiv
=
find_equiv_reg
(
old
,
insn
,
=
find_equiv_reg
(
old
,
insn
,
r
eload_reg_class
[
reload_secondary_in_reload
[
j
]]
,
r
ld
[
rld
[
j
].
secondary_in_reload
].
class
,
-
1
,
NULL_PTR
,
0
,
mode
);
-
1
,
NULL_PTR
,
0
,
mode
);
#endif
#endif
...
@@ -6647,9 +6645,9 @@ emit_reload_insns (chain)
...
@@ -6647,9 +6645,9 @@ emit_reload_insns (chain)
/* Don't use OLDEQUIV if any other reload changes it at an
/* Don't use OLDEQUIV if any other reload changes it at an
earlier stage of this insn or at this stage. */
earlier stage of this insn or at this stage. */
if
(
!
reload_reg_free_for_value_p
(
regno
,
r
eload_opnum
[
j
]
,
if
(
!
reload_reg_free_for_value_p
(
regno
,
r
ld
[
j
].
opnum
,
r
eload_when_needed
[
j
]
,
r
ld
[
j
].
when_needed
,
r
eload_in
[
j
]
,
const0_rtx
,
j
,
r
ld
[
j
].
in
,
const0_rtx
,
j
,
0
))
0
))
oldequiv
=
0
;
oldequiv
=
0
;
...
@@ -6659,18 +6657,18 @@ emit_reload_insns (chain)
...
@@ -6659,18 +6657,18 @@ emit_reload_insns (chain)
or memory. */
or memory. */
if
(
oldequiv
!=
0
if
(
oldequiv
!=
0
&&
((
REGNO_REG_CLASS
(
regno
)
!=
r
eload_reg_class
[
j
]
&&
((
REGNO_REG_CLASS
(
regno
)
!=
r
ld
[
j
].
class
&&
(
REGISTER_MOVE_COST
(
REGNO_REG_CLASS
(
regno
),
&&
(
REGISTER_MOVE_COST
(
REGNO_REG_CLASS
(
regno
),
r
eload_reg_class
[
j
]
)
r
ld
[
j
].
class
)
>=
MEMORY_MOVE_COST
(
mode
,
r
eload_reg_class
[
j
]
,
1
)))
>=
MEMORY_MOVE_COST
(
mode
,
r
ld
[
j
].
class
,
1
)))
#ifdef SECONDARY_INPUT_RELOAD_CLASS
#ifdef SECONDARY_INPUT_RELOAD_CLASS
||
(
SECONDARY_INPUT_RELOAD_CLASS
(
r
eload_reg_class
[
j
]
,
||
(
SECONDARY_INPUT_RELOAD_CLASS
(
r
ld
[
j
].
class
,
mode
,
oldequiv
)
mode
,
oldequiv
)
!=
NO_REGS
)
!=
NO_REGS
)
#endif
#endif
#ifdef SECONDARY_MEMORY_NEEDED
#ifdef SECONDARY_MEMORY_NEEDED
||
SECONDARY_MEMORY_NEEDED
(
REGNO_REG_CLASS
(
regno
),
||
SECONDARY_MEMORY_NEEDED
(
REGNO_REG_CLASS
(
regno
),
r
eload_reg_class
[
j
]
,
r
ld
[
j
].
class
,
mode
)
mode
)
#endif
#endif
))
))
...
@@ -6683,10 +6681,10 @@ emit_reload_insns (chain)
...
@@ -6683,10 +6681,10 @@ emit_reload_insns (chain)
find the pseudo in RELOAD_IN_REG. */
find the pseudo in RELOAD_IN_REG. */
if
(
oldequiv
==
0
if
(
oldequiv
==
0
&&
reload_override_in
[
j
]
&&
reload_override_in
[
j
]
&&
GET_CODE
(
r
eload_in_reg
[
j
]
)
==
REG
)
&&
GET_CODE
(
r
ld
[
j
].
in_reg
)
==
REG
)
{
{
oldequiv
=
old
;
oldequiv
=
old
;
old
=
r
eload_in_reg
[
j
]
;
old
=
r
ld
[
j
].
in_reg
;
}
}
if
(
oldequiv
==
0
)
if
(
oldequiv
==
0
)
oldequiv
=
old
;
oldequiv
=
old
;
...
@@ -6705,7 +6703,7 @@ emit_reload_insns (chain)
...
@@ -6705,7 +6703,7 @@ emit_reload_insns (chain)
&&
GET_CODE
(
old
)
==
REG
&&
GET_CODE
(
old
)
==
REG
&&
(
dead_or_set_p
(
insn
,
spill_reg_stored_to
[
REGNO
(
oldequiv
)])
&&
(
dead_or_set_p
(
insn
,
spill_reg_stored_to
[
REGNO
(
oldequiv
)])
||
rtx_equal_p
(
spill_reg_stored_to
[
REGNO
(
oldequiv
)],
||
rtx_equal_p
(
spill_reg_stored_to
[
REGNO
(
oldequiv
)],
r
eload_out_reg
[
j
]
)))
r
ld
[
j
].
out_reg
)))
delete_output_reload
(
insn
,
j
,
REGNO
(
oldequiv
));
delete_output_reload
(
insn
,
j
,
REGNO
(
oldequiv
));
/* Encapsulate both RELOADREG and OLDEQUIV into that mode,
/* Encapsulate both RELOADREG and OLDEQUIV into that mode,
...
@@ -6723,25 +6721,25 @@ emit_reload_insns (chain)
...
@@ -6723,25 +6721,25 @@ emit_reload_insns (chain)
oldequiv
=
gen_rtx_SUBREG
(
mode
,
oldequiv
,
0
);
oldequiv
=
gen_rtx_SUBREG
(
mode
,
oldequiv
,
0
);
/* Switch to the right place to emit the reload insns. */
/* Switch to the right place to emit the reload insns. */
switch
(
r
eload_when_needed
[
j
]
)
switch
(
r
ld
[
j
].
when_needed
)
{
{
case
RELOAD_OTHER
:
case
RELOAD_OTHER
:
where
=
&
other_input_reload_insns
;
where
=
&
other_input_reload_insns
;
break
;
break
;
case
RELOAD_FOR_INPUT
:
case
RELOAD_FOR_INPUT
:
where
=
&
input_reload_insns
[
r
eload_opnum
[
j
]
];
where
=
&
input_reload_insns
[
r
ld
[
j
].
opnum
];
break
;
break
;
case
RELOAD_FOR_INPUT_ADDRESS
:
case
RELOAD_FOR_INPUT_ADDRESS
:
where
=
&
input_address_reload_insns
[
r
eload_opnum
[
j
]
];
where
=
&
input_address_reload_insns
[
r
ld
[
j
].
opnum
];
break
;
break
;
case
RELOAD_FOR_INPADDR_ADDRESS
:
case
RELOAD_FOR_INPADDR_ADDRESS
:
where
=
&
inpaddr_address_reload_insns
[
r
eload_opnum
[
j
]
];
where
=
&
inpaddr_address_reload_insns
[
r
ld
[
j
].
opnum
];
break
;
break
;
case
RELOAD_FOR_OUTPUT_ADDRESS
:
case
RELOAD_FOR_OUTPUT_ADDRESS
:
where
=
&
output_address_reload_insns
[
r
eload_opnum
[
j
]
];
where
=
&
output_address_reload_insns
[
r
ld
[
j
].
opnum
];
break
;
break
;
case
RELOAD_FOR_OUTADDR_ADDRESS
:
case
RELOAD_FOR_OUTADDR_ADDRESS
:
where
=
&
outaddr_address_reload_insns
[
r
eload_opnum
[
j
]
];
where
=
&
outaddr_address_reload_insns
[
r
ld
[
j
].
opnum
];
break
;
break
;
case
RELOAD_FOR_OPERAND_ADDRESS
:
case
RELOAD_FOR_OPERAND_ADDRESS
:
where
=
&
operand_reload_insns
;
where
=
&
operand_reload_insns
;
...
@@ -6760,18 +6758,18 @@ emit_reload_insns (chain)
...
@@ -6760,18 +6758,18 @@ emit_reload_insns (chain)
special
=
0
;
special
=
0
;
/* Auto-increment addresses must be reloaded in a special way. */
/* Auto-increment addresses must be reloaded in a special way. */
if
(
r
eload_out
[
j
]
&&
!
reload_out_reg
[
j
]
)
if
(
r
ld
[
j
].
out
&&
!
rld
[
j
].
out_reg
)
{
{
/* We are not going to bother supporting the case where a
/* We are not going to bother supporting the case where a
incremented register can't be copied directly from
incremented register can't be copied directly from
OLDEQUIV since this seems highly unlikely. */
OLDEQUIV since this seems highly unlikely. */
if
(
r
eload_secondary_in_reload
[
j
]
>=
0
)
if
(
r
ld
[
j
].
secondary_in_reload
>=
0
)
abort
();
abort
();
if
(
reload_inherited
[
j
])
if
(
reload_inherited
[
j
])
oldequiv
=
reloadreg
;
oldequiv
=
reloadreg
;
old
=
XEXP
(
r
eload_in_reg
[
j
]
,
0
);
old
=
XEXP
(
r
ld
[
j
].
in_reg
,
0
);
if
(
optimize
&&
GET_CODE
(
oldequiv
)
==
REG
if
(
optimize
&&
GET_CODE
(
oldequiv
)
==
REG
&&
REGNO
(
oldequiv
)
<
FIRST_PSEUDO_REGISTER
&&
REGNO
(
oldequiv
)
<
FIRST_PSEUDO_REGISTER
...
@@ -6787,8 +6785,8 @@ emit_reload_insns (chain)
...
@@ -6787,8 +6785,8 @@ emit_reload_insns (chain)
special
=
1
;
special
=
1
;
/* Output a special code sequence for this case. */
/* Output a special code sequence for this case. */
new_spill_reg_store
[
REGNO
(
reloadreg
)]
new_spill_reg_store
[
REGNO
(
reloadreg
)]
=
inc_for_reload
(
reloadreg
,
oldequiv
,
r
eload_out
[
j
]
,
=
inc_for_reload
(
reloadreg
,
oldequiv
,
r
ld
[
j
].
out
,
r
eload_inc
[
j
]
);
r
ld
[
j
].
inc
);
}
}
/* If we are reloading a pseudo-register that was set by the previous
/* If we are reloading a pseudo-register that was set by the previous
...
@@ -6801,9 +6799,9 @@ emit_reload_insns (chain)
...
@@ -6801,9 +6799,9 @@ emit_reload_insns (chain)
/* This is unsafe if some other reload
/* This is unsafe if some other reload
uses the same reg first. */
uses the same reg first. */
&&
reload_reg_free_for_value_p
(
REGNO
(
reloadreg
),
&&
reload_reg_free_for_value_p
(
REGNO
(
reloadreg
),
r
eload_opnum
[
j
]
,
r
ld
[
j
].
opnum
,
r
eload_when_needed
[
j
]
,
r
ld
[
j
].
when_needed
,
old
,
r
eload_out
[
j
]
,
old
,
r
ld
[
j
].
out
,
j
,
0
))
j
,
0
))
{
{
rtx
temp
=
PREV_INSN
(
insn
);
rtx
temp
=
PREV_INSN
(
insn
);
...
@@ -6843,7 +6841,7 @@ emit_reload_insns (chain)
...
@@ -6843,7 +6841,7 @@ emit_reload_insns (chain)
if
(
REG_N_DEATHS
(
REGNO
(
old
))
==
1
if
(
REG_N_DEATHS
(
REGNO
(
old
))
==
1
&&
REG_N_SETS
(
REGNO
(
old
))
==
1
)
&&
REG_N_SETS
(
REGNO
(
old
))
==
1
)
{
{
reg_renumber
[
REGNO
(
old
)]
=
REGNO
(
r
eload_reg_rtx
[
j
]
);
reg_renumber
[
REGNO
(
old
)]
=
REGNO
(
r
ld
[
j
].
reg_rtx
);
alter_reg
(
REGNO
(
old
),
-
1
);
alter_reg
(
REGNO
(
old
),
-
1
);
}
}
special
=
1
;
special
=
1
;
...
@@ -6869,9 +6867,9 @@ emit_reload_insns (chain)
...
@@ -6869,9 +6867,9 @@ emit_reload_insns (chain)
because we don't make such reloads when both the input and
because we don't make such reloads when both the input and
output need secondary reload registers. */
output need secondary reload registers. */
if
(
r
eload_secondary_in_reload
[
j
]
>=
0
)
if
(
r
ld
[
j
].
secondary_in_reload
>=
0
)
{
{
int
secondary_reload
=
r
eload_secondary_in_reload
[
j
]
;
int
secondary_reload
=
r
ld
[
j
].
secondary_in_reload
;
rtx
real_oldequiv
=
oldequiv
;
rtx
real_oldequiv
=
oldequiv
;
rtx
real_old
=
old
;
rtx
real_old
=
old
;
rtx
tmp
;
rtx
tmp
;
...
@@ -6900,7 +6898,7 @@ emit_reload_insns (chain)
...
@@ -6900,7 +6898,7 @@ emit_reload_insns (chain)
if
(
!
reg_equiv_mem
[
REGNO
(
tmp
)]
if
(
!
reg_equiv_mem
[
REGNO
(
tmp
)]
||
num_not_at_initial_offset
||
num_not_at_initial_offset
||
GET_CODE
(
oldequiv
)
==
SUBREG
)
||
GET_CODE
(
oldequiv
)
==
SUBREG
)
real_oldequiv
=
r
eload_in
[
j
]
;
real_oldequiv
=
r
ld
[
j
].
in
;
else
else
real_oldequiv
=
reg_equiv_mem
[
REGNO
(
tmp
)];
real_oldequiv
=
reg_equiv_mem
[
REGNO
(
tmp
)];
}
}
...
@@ -6916,19 +6914,19 @@ emit_reload_insns (chain)
...
@@ -6916,19 +6914,19 @@ emit_reload_insns (chain)
if
(
!
reg_equiv_mem
[
REGNO
(
tmp
)]
if
(
!
reg_equiv_mem
[
REGNO
(
tmp
)]
||
num_not_at_initial_offset
||
num_not_at_initial_offset
||
GET_CODE
(
old
)
==
SUBREG
)
||
GET_CODE
(
old
)
==
SUBREG
)
real_old
=
r
eload_in
[
j
]
;
real_old
=
r
ld
[
j
].
in
;
else
else
real_old
=
reg_equiv_mem
[
REGNO
(
tmp
)];
real_old
=
reg_equiv_mem
[
REGNO
(
tmp
)];
}
}
second_reload_reg
=
r
eload_reg_rtx
[
secondary_reload
]
;
second_reload_reg
=
r
ld
[
secondary_reload
].
reg_rtx
;
icode
=
r
eload_secondary_in_icode
[
j
]
;
icode
=
r
ld
[
j
].
secondary_in_icode
;
if
((
old
!=
oldequiv
&&
!
rtx_equal_p
(
old
,
oldequiv
))
if
((
old
!=
oldequiv
&&
!
rtx_equal_p
(
old
,
oldequiv
))
||
(
r
eload_in
[
j
]
!=
0
&&
reload_out
[
j
]
!=
0
))
||
(
r
ld
[
j
].
in
!=
0
&&
rld
[
j
].
out
!=
0
))
{
{
enum
reg_class
new_class
enum
reg_class
new_class
=
SECONDARY_INPUT_RELOAD_CLASS
(
r
eload_reg_class
[
j
]
,
=
SECONDARY_INPUT_RELOAD_CLASS
(
r
ld
[
j
].
class
,
mode
,
real_oldequiv
);
mode
,
real_oldequiv
);
if
(
new_class
==
NO_REGS
)
if
(
new_class
==
NO_REGS
)
...
@@ -6992,12 +6990,12 @@ emit_reload_insns (chain)
...
@@ -6992,12 +6990,12 @@ emit_reload_insns (chain)
/* See if we need a scratch register to load the
/* See if we need a scratch register to load the
intermediate register (a tertiary reload). */
intermediate register (a tertiary reload). */
enum
insn_code
tertiary_icode
enum
insn_code
tertiary_icode
=
r
eload_secondary_in_icode
[
secondary_reload
]
;
=
r
ld
[
secondary_reload
].
secondary_in_icode
;
if
(
tertiary_icode
!=
CODE_FOR_nothing
)
if
(
tertiary_icode
!=
CODE_FOR_nothing
)
{
{
rtx
third_reload_reg
rtx
third_reload_reg
=
r
eload_reg_rtx
[
reload_secondary_in_reload
[
secondary_reload
]]
;
=
r
ld
[
rld
[
secondary_reload
].
secondary_in_reload
].
reg_rtx
;
emit_insn
((
GEN_FCN
(
tertiary_icode
)
emit_insn
((
GEN_FCN
(
tertiary_icode
)
(
second_reload_reg
,
real_oldequiv
,
(
second_reload_reg
,
real_oldequiv
,
...
@@ -7005,8 +7003,8 @@ emit_reload_insns (chain)
...
@@ -7005,8 +7003,8 @@ emit_reload_insns (chain)
}
}
else
else
gen_reload
(
second_reload_reg
,
real_oldequiv
,
gen_reload
(
second_reload_reg
,
real_oldequiv
,
r
eload_opnum
[
j
]
,
r
ld
[
j
].
opnum
,
r
eload_when_needed
[
j
]
);
r
ld
[
j
].
when_needed
);
oldequiv
=
second_reload_reg
;
oldequiv
=
second_reload_reg
;
}
}
...
@@ -7030,9 +7028,9 @@ emit_reload_insns (chain)
...
@@ -7030,9 +7028,9 @@ emit_reload_insns (chain)
[
REGNO
(
SUBREG_REG
(
oldequiv
))]
!=
0
)
[
REGNO
(
SUBREG_REG
(
oldequiv
))]
!=
0
)
||
(
reg_equiv_constant
||
(
reg_equiv_constant
[
REGNO
(
SUBREG_REG
(
oldequiv
))]
!=
0
))))
[
REGNO
(
SUBREG_REG
(
oldequiv
))]
!=
0
))))
real_oldequiv
=
r
eload_in
[
j
]
;
real_oldequiv
=
r
ld
[
j
].
in
;
gen_reload
(
reloadreg
,
real_oldequiv
,
r
eload_opnum
[
j
]
,
gen_reload
(
reloadreg
,
real_oldequiv
,
r
ld
[
j
].
opnum
,
r
eload_when_needed
[
j
]
);
r
ld
[
j
].
when_needed
);
}
}
}
}
...
@@ -7048,18 +7046,18 @@ emit_reload_insns (chain)
...
@@ -7048,18 +7046,18 @@ emit_reload_insns (chain)
reload_override_in
[
j
]
=
oldequiv
;
reload_override_in
[
j
]
=
oldequiv
;
}
}
/* When inheriting a wider reload, we have a MEM in r
eload_in[j]
,
/* When inheriting a wider reload, we have a MEM in r
ld[j].in
,
e.g. inheriting a SImode output reload for
e.g. inheriting a SImode output reload for
(mem:HI (plus:SI (reg:SI 14 fp) (const_int 10))) */
(mem:HI (plus:SI (reg:SI 14 fp) (const_int 10))) */
if
(
optimize
&&
reload_inherited
[
j
]
&&
r
eload_in
[
j
]
if
(
optimize
&&
reload_inherited
[
j
]
&&
r
ld
[
j
].
in
&&
GET_CODE
(
r
eload_in
[
j
]
)
==
MEM
&&
GET_CODE
(
r
ld
[
j
].
in
)
==
MEM
&&
GET_CODE
(
r
eload_in_reg
[
j
]
)
==
MEM
&&
GET_CODE
(
r
ld
[
j
].
in_reg
)
==
MEM
&&
reload_spill_index
[
j
]
>=
0
&&
reload_spill_index
[
j
]
>=
0
&&
TEST_HARD_REG_BIT
(
reg_reloaded_valid
,
reload_spill_index
[
j
]))
&&
TEST_HARD_REG_BIT
(
reg_reloaded_valid
,
reload_spill_index
[
j
]))
{
{
expect_occurrences
expect_occurrences
=
count_occurrences
(
PATTERN
(
insn
),
r
eload_in
[
j
]
)
==
1
?
0
:
-
1
;
=
count_occurrences
(
PATTERN
(
insn
),
r
ld
[
j
].
in
)
==
1
?
0
:
-
1
;
r
eload_in
[
j
]
r
ld
[
j
].
in
=
regno_reg_rtx
[
reg_reloaded_contents
[
reload_spill_index
[
j
]]];
=
regno_reg_rtx
[
reg_reloaded_contents
[
reload_spill_index
[
j
]]];
}
}
...
@@ -7069,28 +7067,28 @@ emit_reload_insns (chain)
...
@@ -7069,28 +7067,28 @@ emit_reload_insns (chain)
if
(
optimize
if
(
optimize
&&
(
reload_inherited
[
j
]
||
reload_override_in
[
j
])
&&
(
reload_inherited
[
j
]
||
reload_override_in
[
j
])
&&
r
eload_reg_rtx
[
j
]
&&
r
ld
[
j
].
reg_rtx
&&
GET_CODE
(
r
eload_reg_rtx
[
j
]
)
==
REG
&&
GET_CODE
(
r
ld
[
j
].
reg_rtx
)
==
REG
&&
spill_reg_store
[
REGNO
(
r
eload_reg_rtx
[
j
]
)]
!=
0
&&
spill_reg_store
[
REGNO
(
r
ld
[
j
].
reg_rtx
)]
!=
0
#if 0
#if 0
/* There doesn't seem to be any reason to restrict this to pseudos
/* There doesn't seem to be any reason to restrict this to pseudos
and doing so loses in the case where we are copying from a
and doing so loses in the case where we are copying from a
register of the wrong class. */
register of the wrong class. */
&& (REGNO (spill_reg_stored_to[REGNO (r
eload_reg_rtx[j]
)])
&& (REGNO (spill_reg_stored_to[REGNO (r
ld[j].reg_rtx
)])
>= FIRST_PSEUDO_REGISTER)
>= FIRST_PSEUDO_REGISTER)
#endif
#endif
/* The insn might have already some references to stackslots
/* The insn might have already some references to stackslots
replaced by MEMs, while reload_out_reg still names the
replaced by MEMs, while reload_out_reg still names the
original pseudo. */
original pseudo. */
&&
(
dead_or_set_p
(
insn
,
&&
(
dead_or_set_p
(
insn
,
spill_reg_stored_to
[
REGNO
(
r
eload_reg_rtx
[
j
]
)])
spill_reg_stored_to
[
REGNO
(
r
ld
[
j
].
reg_rtx
)])
||
rtx_equal_p
(
spill_reg_stored_to
[
REGNO
(
r
eload_reg_rtx
[
j
]
)],
||
rtx_equal_p
(
spill_reg_stored_to
[
REGNO
(
r
ld
[
j
].
reg_rtx
)],
r
eload_out_reg
[
j
]
)))
r
ld
[
j
].
out_reg
)))
delete_output_reload
(
insn
,
j
,
REGNO
(
r
eload_reg_rtx
[
j
]
));
delete_output_reload
(
insn
,
j
,
REGNO
(
r
ld
[
j
].
reg_rtx
));
/* Input-reloading is done. Now do output-reloading,
/* Input-reloading is done. Now do output-reloading,
storing the value from the reload-register after the main insn
storing the value from the reload-register after the main insn
if r
eload_out[j]
is nonzero.
if r
ld[j].out
is nonzero.
??? At some point we need to support handling output reloads of
??? At some point we need to support handling output reloads of
JUMP_INSNs or insns that set cc0. */
JUMP_INSNs or insns that set cc0. */
...
@@ -7099,11 +7097,11 @@ emit_reload_insns (chain)
...
@@ -7099,11 +7097,11 @@ emit_reload_insns (chain)
not loaded in this same reload, see if we can eliminate a previous
not loaded in this same reload, see if we can eliminate a previous
store. */
store. */
{
{
rtx
pseudo
=
r
eload_out_reg
[
j
]
;
rtx
pseudo
=
r
ld
[
j
].
out_reg
;
if
(
pseudo
if
(
pseudo
&&
GET_CODE
(
pseudo
)
==
REG
&&
GET_CODE
(
pseudo
)
==
REG
&&
!
rtx_equal_p
(
r
eload_in_reg
[
j
]
,
pseudo
)
&&
!
rtx_equal_p
(
r
ld
[
j
].
in_reg
,
pseudo
)
&&
REGNO
(
pseudo
)
>=
FIRST_PSEUDO_REGISTER
&&
REGNO
(
pseudo
)
>=
FIRST_PSEUDO_REGISTER
&&
reg_last_reload_reg
[
REGNO
(
pseudo
)])
&&
reg_last_reload_reg
[
REGNO
(
pseudo
)])
{
{
...
@@ -7120,12 +7118,12 @@ emit_reload_insns (chain)
...
@@ -7120,12 +7118,12 @@ emit_reload_insns (chain)
}
}
}
}
old
=
r
eload_out_reg
[
j
]
;
old
=
r
ld
[
j
].
out_reg
;
if
(
old
!=
0
if
(
old
!=
0
&&
r
eload_reg_rtx
[
j
]
!=
old
&&
r
ld
[
j
].
reg_rtx
!=
old
&&
r
eload_reg_rtx
[
j
]
!=
0
)
&&
r
ld
[
j
].
reg_rtx
!=
0
)
{
{
register
rtx
reloadreg
=
r
eload_reg_rtx
[
j
]
;
register
rtx
reloadreg
=
r
ld
[
j
].
reg_rtx
;
#ifdef SECONDARY_OUTPUT_RELOAD_CLASS
#ifdef SECONDARY_OUTPUT_RELOAD_CLASS
register
rtx
second_reloadreg
=
0
;
register
rtx
second_reloadreg
=
0
;
#endif
#endif
...
@@ -7139,7 +7137,7 @@ emit_reload_insns (chain)
...
@@ -7139,7 +7137,7 @@ emit_reload_insns (chain)
if
((
GET_CODE
(
old
)
==
REG
||
GET_CODE
(
old
)
==
SCRATCH
)
if
((
GET_CODE
(
old
)
==
REG
||
GET_CODE
(
old
)
==
SCRATCH
)
&&
(
note
=
find_reg_note
(
insn
,
REG_UNUSED
,
old
))
!=
0
)
&&
(
note
=
find_reg_note
(
insn
,
REG_UNUSED
,
old
))
!=
0
)
{
{
XEXP
(
note
,
0
)
=
r
eload_reg_rtx
[
j
]
;
XEXP
(
note
,
0
)
=
r
ld
[
j
].
reg_rtx
;
continue
;
continue
;
}
}
/* Likewise for a SUBREG of an operand that dies. */
/* Likewise for a SUBREG of an operand that dies. */
...
@@ -7149,7 +7147,7 @@ emit_reload_insns (chain)
...
@@ -7149,7 +7147,7 @@ emit_reload_insns (chain)
SUBREG_REG
(
old
))))
SUBREG_REG
(
old
))))
{
{
XEXP
(
note
,
0
)
=
gen_lowpart_common
(
GET_MODE
(
old
),
XEXP
(
note
,
0
)
=
gen_lowpart_common
(
GET_MODE
(
old
),
r
eload_reg_rtx
[
j
]
);
r
ld
[
j
].
reg_rtx
);
continue
;
continue
;
}
}
else
if
(
GET_CODE
(
old
)
==
SCRATCH
)
else
if
(
GET_CODE
(
old
)
==
SCRATCH
)
...
@@ -7171,12 +7169,12 @@ emit_reload_insns (chain)
...
@@ -7171,12 +7169,12 @@ emit_reload_insns (chain)
if
(
GET_CODE
(
insn
)
==
JUMP_INSN
)
if
(
GET_CODE
(
insn
)
==
JUMP_INSN
)
abort
();
abort
();
if
(
r
eload_when_needed
[
j
]
==
RELOAD_OTHER
)
if
(
r
ld
[
j
].
when_needed
==
RELOAD_OTHER
)
start_sequence
();
start_sequence
();
else
else
push_to_sequence
(
output_reload_insns
[
r
eload_opnum
[
j
]
]);
push_to_sequence
(
output_reload_insns
[
r
ld
[
j
].
opnum
]);
old
=
r
eload_out
[
j
]
;
old
=
r
ld
[
j
].
out
;
/* Determine the mode to reload in.
/* Determine the mode to reload in.
See comments above (for input reloading). */
See comments above (for input reloading). */
...
@@ -7203,7 +7201,7 @@ emit_reload_insns (chain)
...
@@ -7203,7 +7201,7 @@ emit_reload_insns (chain)
one, since it will be stored into OLD. We might need a secondary
one, since it will be stored into OLD. We might need a secondary
register only for an input reload, so check again here. */
register only for an input reload, so check again here. */
if
(
r
eload_secondary_out_reload
[
j
]
>=
0
)
if
(
r
ld
[
j
].
secondary_out_reload
>=
0
)
{
{
rtx
real_old
=
old
;
rtx
real_old
=
old
;
...
@@ -7211,18 +7209,18 @@ emit_reload_insns (chain)
...
@@ -7211,18 +7209,18 @@ emit_reload_insns (chain)
&&
reg_equiv_mem
[
REGNO
(
old
)]
!=
0
)
&&
reg_equiv_mem
[
REGNO
(
old
)]
!=
0
)
real_old
=
reg_equiv_mem
[
REGNO
(
old
)];
real_old
=
reg_equiv_mem
[
REGNO
(
old
)];
if
((
SECONDARY_OUTPUT_RELOAD_CLASS
(
r
eload_reg_class
[
j
]
,
if
((
SECONDARY_OUTPUT_RELOAD_CLASS
(
r
ld
[
j
].
class
,
mode
,
real_old
)
mode
,
real_old
)
!=
NO_REGS
))
!=
NO_REGS
))
{
{
second_reloadreg
=
reloadreg
;
second_reloadreg
=
reloadreg
;
reloadreg
=
r
eload_reg_rtx
[
reload_secondary_out_reload
[
j
]]
;
reloadreg
=
r
ld
[
rld
[
j
].
secondary_out_reload
].
reg_rtx
;
/* See if RELOADREG is to be used as a scratch register
/* See if RELOADREG is to be used as a scratch register
or as an intermediate register. */
or as an intermediate register. */
if
(
r
eload_secondary_out_icode
[
j
]
!=
CODE_FOR_nothing
)
if
(
r
ld
[
j
].
secondary_out_icode
!=
CODE_FOR_nothing
)
{
{
emit_insn
((
GEN_FCN
(
r
eload_secondary_out_icode
[
j
]
)
emit_insn
((
GEN_FCN
(
r
ld
[
j
].
secondary_out_icode
)
(
real_old
,
second_reloadreg
,
reloadreg
)));
(
real_old
,
second_reloadreg
,
reloadreg
)));
special
=
1
;
special
=
1
;
}
}
...
@@ -7231,9 +7229,9 @@ emit_reload_insns (chain)
...
@@ -7231,9 +7229,9 @@ emit_reload_insns (chain)
/* See if we need both a scratch and intermediate reload
/* See if we need both a scratch and intermediate reload
register. */
register. */
int
secondary_reload
=
r
eload_secondary_out_reload
[
j
]
;
int
secondary_reload
=
r
ld
[
j
].
secondary_out_reload
;
enum
insn_code
tertiary_icode
enum
insn_code
tertiary_icode
=
r
eload_secondary_out_icode
[
secondary_reload
]
;
=
r
ld
[
secondary_reload
].
secondary_out_icode
;
if
(
GET_MODE
(
reloadreg
)
!=
mode
)
if
(
GET_MODE
(
reloadreg
)
!=
mode
)
reloadreg
=
gen_rtx_REG
(
mode
,
REGNO
(
reloadreg
));
reloadreg
=
gen_rtx_REG
(
mode
,
REGNO
(
reloadreg
));
...
@@ -7241,7 +7239,7 @@ emit_reload_insns (chain)
...
@@ -7241,7 +7239,7 @@ emit_reload_insns (chain)
if
(
tertiary_icode
!=
CODE_FOR_nothing
)
if
(
tertiary_icode
!=
CODE_FOR_nothing
)
{
{
rtx
third_reloadreg
rtx
third_reloadreg
=
r
eload_reg_rtx
[
reload_secondary_out_reload
[
secondary_reload
]]
;
=
r
ld
[
rld
[
secondary_reload
].
secondary_out_reload
].
reg_rtx
;
rtx
tem
;
rtx
tem
;
/* Copy primary reload reg to secondary reload reg.
/* Copy primary reload reg to secondary reload reg.
...
@@ -7260,7 +7258,7 @@ emit_reload_insns (chain)
...
@@ -7260,7 +7258,7 @@ emit_reload_insns (chain)
real_old
=
SUBREG_REG
(
real_old
),
reloadreg
=
tem
;
real_old
=
SUBREG_REG
(
real_old
),
reloadreg
=
tem
;
gen_reload
(
reloadreg
,
second_reloadreg
,
gen_reload
(
reloadreg
,
second_reloadreg
,
r
eload_opnum
[
j
],
reload_when_needed
[
j
]
);
r
ld
[
j
].
opnum
,
rld
[
j
].
when_needed
);
emit_insn
((
GEN_FCN
(
tertiary_icode
)
emit_insn
((
GEN_FCN
(
tertiary_icode
)
(
real_old
,
reloadreg
,
third_reloadreg
)));
(
real_old
,
reloadreg
,
third_reloadreg
)));
special
=
1
;
special
=
1
;
...
@@ -7271,7 +7269,7 @@ emit_reload_insns (chain)
...
@@ -7271,7 +7269,7 @@ emit_reload_insns (chain)
OUT later. */
OUT later. */
gen_reload
(
reloadreg
,
second_reloadreg
,
gen_reload
(
reloadreg
,
second_reloadreg
,
r
eload_opnum
[
j
],
reload_when_needed
[
j
]
);
r
ld
[
j
].
opnum
,
rld
[
j
].
when_needed
);
}
}
}
}
}
}
...
@@ -7290,8 +7288,8 @@ emit_reload_insns (chain)
...
@@ -7290,8 +7288,8 @@ emit_reload_insns (chain)
||
rtx_equal_p
(
old
,
SET_DEST
(
set
))
||
rtx_equal_p
(
old
,
SET_DEST
(
set
))
||
!
reg_mentioned_p
(
old
,
SET_SRC
(
set
))
||
!
reg_mentioned_p
(
old
,
SET_SRC
(
set
))
||
!
regno_clobbered_p
(
REGNO
(
old
),
insn
))
||
!
regno_clobbered_p
(
REGNO
(
old
),
insn
))
gen_reload
(
old
,
reloadreg
,
r
eload_opnum
[
j
]
,
gen_reload
(
old
,
reloadreg
,
r
ld
[
j
].
opnum
,
r
eload_when_needed
[
j
]
);
r
ld
[
j
].
when_needed
);
}
}
/* Look at all insns we emitted, just to be safe. */
/* Look at all insns we emitted, just to be safe. */
...
@@ -7306,12 +7304,12 @@ emit_reload_insns (chain)
...
@@ -7306,12 +7304,12 @@ emit_reload_insns (chain)
reg_has_output_reload will make this do nothing. */
reg_has_output_reload will make this do nothing. */
note_stores
(
pat
,
forget_old_reloads_1
);
note_stores
(
pat
,
forget_old_reloads_1
);
if
(
reg_mentioned_p
(
r
eload_reg_rtx
[
j
]
,
pat
))
if
(
reg_mentioned_p
(
r
ld
[
j
].
reg_rtx
,
pat
))
{
{
rtx
set
=
single_set
(
insn
);
rtx
set
=
single_set
(
insn
);
if
(
reload_spill_index
[
j
]
<
0
if
(
reload_spill_index
[
j
]
<
0
&&
set
&&
set
&&
SET_SRC
(
set
)
==
r
eload_reg_rtx
[
j
]
)
&&
SET_SRC
(
set
)
==
r
ld
[
j
].
reg_rtx
)
{
{
int
src
=
REGNO
(
SET_SRC
(
set
));
int
src
=
REGNO
(
SET_SRC
(
set
));
...
@@ -7320,9 +7318,9 @@ emit_reload_insns (chain)
...
@@ -7320,9 +7318,9 @@ emit_reload_insns (chain)
if
(
find_regno_note
(
insn
,
REG_DEAD
,
src
))
if
(
find_regno_note
(
insn
,
REG_DEAD
,
src
))
SET_HARD_REG_BIT
(
reg_reloaded_died
,
src
);
SET_HARD_REG_BIT
(
reg_reloaded_died
,
src
);
}
}
if
(
REGNO
(
r
eload_reg_rtx
[
j
]
)
<
FIRST_PSEUDO_REGISTER
)
if
(
REGNO
(
r
ld
[
j
].
reg_rtx
)
<
FIRST_PSEUDO_REGISTER
)
{
{
int
s
=
r
eload_secondary_out_reload
[
j
]
;
int
s
=
r
ld
[
j
].
secondary_out_reload
;
set
=
single_set
(
p
);
set
=
single_set
(
p
);
/* If this reload copies only to the secondary reload
/* If this reload copies only to the secondary reload
register, the secondary reload does the actual
register, the secondary reload does the actual
...
@@ -7332,17 +7330,17 @@ emit_reload_insns (chain)
...
@@ -7332,17 +7330,17 @@ emit_reload_insns (chain)
has and where the actual store to the pseudo is
has and where the actual store to the pseudo is
made; leave new_spill_reg_store alone. */
made; leave new_spill_reg_store alone. */
else
if
(
s
>=
0
else
if
(
s
>=
0
&&
SET_SRC
(
set
)
==
r
eload_reg_rtx
[
j
]
&&
SET_SRC
(
set
)
==
r
ld
[
j
].
reg_rtx
&&
SET_DEST
(
set
)
==
r
eload_reg_rtx
[
s
]
)
&&
SET_DEST
(
set
)
==
r
ld
[
s
].
reg_rtx
)
{
{
/* Usually the next instruction will be the
/* Usually the next instruction will be the
secondary reload insn; if we can confirm
secondary reload insn; if we can confirm
that it is, setting new_spill_reg_store to
that it is, setting new_spill_reg_store to
that insn will allow an extra optimization. */
that insn will allow an extra optimization. */
rtx
s_reg
=
r
eload_reg_rtx
[
s
]
;
rtx
s_reg
=
r
ld
[
s
].
reg_rtx
;
rtx
next
=
NEXT_INSN
(
p
);
rtx
next
=
NEXT_INSN
(
p
);
r
eload_out
[
s
]
=
reload_out
[
j
]
;
r
ld
[
s
].
out
=
rld
[
j
].
out
;
r
eload_out_reg
[
s
]
=
reload_out_reg
[
j
]
;
r
ld
[
s
].
out_reg
=
rld
[
j
].
out_reg
;
set
=
single_set
(
next
);
set
=
single_set
(
next
);
if
(
set
&&
SET_SRC
(
set
)
==
s_reg
if
(
set
&&
SET_SRC
(
set
)
==
s_reg
&&
!
new_spill_reg_store
[
REGNO
(
s_reg
)])
&&
!
new_spill_reg_store
[
REGNO
(
s_reg
)])
...
@@ -7353,18 +7351,18 @@ emit_reload_insns (chain)
...
@@ -7353,18 +7351,18 @@ emit_reload_insns (chain)
}
}
}
}
else
else
new_spill_reg_store
[
REGNO
(
r
eload_reg_rtx
[
j
]
)]
=
p
;
new_spill_reg_store
[
REGNO
(
r
ld
[
j
].
reg_rtx
)]
=
p
;
}
}
}
}
}
}
if
(
r
eload_when_needed
[
j
]
==
RELOAD_OTHER
)
if
(
r
ld
[
j
].
when_needed
==
RELOAD_OTHER
)
{
{
emit_insns
(
other_output_reload_insns
[
r
eload_opnum
[
j
]
]);
emit_insns
(
other_output_reload_insns
[
r
ld
[
j
].
opnum
]);
other_output_reload_insns
[
r
eload_opnum
[
j
]
]
=
get_insns
();
other_output_reload_insns
[
r
ld
[
j
].
opnum
]
=
get_insns
();
}
}
else
else
output_reload_insns
[
r
eload_opnum
[
j
]
]
=
get_insns
();
output_reload_insns
[
r
ld
[
j
].
opnum
]
=
get_insns
();
end_sequence
();
end_sequence
();
}
}
...
@@ -7440,10 +7438,10 @@ emit_reload_insns (chain)
...
@@ -7440,10 +7438,10 @@ emit_reload_insns (chain)
clear any memory of a previous store to the same pseudo. Only do
clear any memory of a previous store to the same pseudo. Only do
something if there will not be an output reload for the pseudo
something if there will not be an output reload for the pseudo
being reloaded. */
being reloaded. */
if
(
r
eload_in_reg
[
r
]
!=
0
if
(
r
ld
[
r
].
in_reg
!=
0
&&
!
(
reload_inherited
[
r
]
||
reload_override_in
[
r
]))
&&
!
(
reload_inherited
[
r
]
||
reload_override_in
[
r
]))
{
{
rtx
reg
=
r
eload_in_reg
[
r
]
;
rtx
reg
=
r
ld
[
r
].
in_reg
;
if
(
GET_CODE
(
reg
)
==
SUBREG
)
if
(
GET_CODE
(
reg
)
==
SUBREG
)
reg
=
SUBREG_REG
(
reg
);
reg
=
SUBREG_REG
(
reg
);
...
@@ -7465,13 +7463,13 @@ emit_reload_insns (chain)
...
@@ -7465,13 +7463,13 @@ emit_reload_insns (chain)
}
}
/* I is nonneg if this reload used a register.
/* I is nonneg if this reload used a register.
If r
eload_reg_rtx[r]
is 0, this is an optional reload
If r
ld[r].reg_rtx
is 0, this is an optional reload
that we opted to ignore. */
that we opted to ignore. */
if
(
i
>=
0
&&
r
eload_reg_rtx
[
r
]
!=
0
)
if
(
i
>=
0
&&
r
ld
[
r
].
reg_rtx
!=
0
)
{
{
int
nr
int
nr
=
HARD_REGNO_NREGS
(
i
,
GET_MODE
(
r
eload_reg_rtx
[
r
]
));
=
HARD_REGNO_NREGS
(
i
,
GET_MODE
(
r
ld
[
r
].
reg_rtx
));
int
k
;
int
k
;
int
part_reaches_end
=
0
;
int
part_reaches_end
=
0
;
int
all_reaches_end
=
1
;
int
all_reaches_end
=
1
;
...
@@ -7480,8 +7478,8 @@ emit_reload_insns (chain)
...
@@ -7480,8 +7478,8 @@ emit_reload_insns (chain)
of the value lives to the end. */
of the value lives to the end. */
for
(
k
=
0
;
k
<
nr
;
k
++
)
for
(
k
=
0
;
k
<
nr
;
k
++
)
{
{
if
(
reload_reg_reaches_end_p
(
i
+
k
,
r
eload_opnum
[
r
]
,
if
(
reload_reg_reaches_end_p
(
i
+
k
,
r
ld
[
r
].
opnum
,
r
eload_when_needed
[
r
]
))
r
ld
[
r
].
when_needed
))
part_reaches_end
=
1
;
part_reaches_end
=
1
;
else
else
all_reaches_end
=
0
;
all_reaches_end
=
0
;
...
@@ -7498,26 +7496,26 @@ emit_reload_insns (chain)
...
@@ -7498,26 +7496,26 @@ emit_reload_insns (chain)
CLEAR_HARD_REG_BIT
(
reg_reloaded_valid
,
i
+
k
);
CLEAR_HARD_REG_BIT
(
reg_reloaded_valid
,
i
+
k
);
/* Maybe the spill reg contains a copy of reload_out. */
/* Maybe the spill reg contains a copy of reload_out. */
if
(
r
eload_out
[
r
]
!=
0
if
(
r
ld
[
r
].
out
!=
0
&&
(
GET_CODE
(
r
eload_out
[
r
]
)
==
REG
&&
(
GET_CODE
(
r
ld
[
r
].
out
)
==
REG
#ifdef AUTO_INC_DEC
#ifdef AUTO_INC_DEC
||
!
r
eload_out_reg
[
r
]
||
!
r
ld
[
r
].
out_reg
#endif
#endif
||
GET_CODE
(
r
eload_out_reg
[
r
]
)
==
REG
))
||
GET_CODE
(
r
ld
[
r
].
out_reg
)
==
REG
))
{
{
rtx
out
=
(
GET_CODE
(
r
eload_out
[
r
]
)
==
REG
rtx
out
=
(
GET_CODE
(
r
ld
[
r
].
out
)
==
REG
?
r
eload_out
[
r
]
?
r
ld
[
r
].
out
:
r
eload_out_reg
[
r
]
:
r
ld
[
r
].
out_reg
?
r
eload_out_reg
[
r
]
?
r
ld
[
r
].
out_reg
/* AUTO_INC */
:
XEXP
(
r
eload_in_reg
[
r
]
,
0
));
/* AUTO_INC */
:
XEXP
(
r
ld
[
r
].
in_reg
,
0
));
register
int
nregno
=
REGNO
(
out
);
register
int
nregno
=
REGNO
(
out
);
int
nnr
=
(
nregno
>=
FIRST_PSEUDO_REGISTER
?
1
int
nnr
=
(
nregno
>=
FIRST_PSEUDO_REGISTER
?
1
:
HARD_REGNO_NREGS
(
nregno
,
:
HARD_REGNO_NREGS
(
nregno
,
GET_MODE
(
r
eload_reg_rtx
[
r
]
)));
GET_MODE
(
r
ld
[
r
].
reg_rtx
)));
spill_reg_store
[
i
]
=
new_spill_reg_store
[
i
];
spill_reg_store
[
i
]
=
new_spill_reg_store
[
i
];
spill_reg_stored_to
[
i
]
=
out
;
spill_reg_stored_to
[
i
]
=
out
;
reg_last_reload_reg
[
nregno
]
=
r
eload_reg_rtx
[
r
]
;
reg_last_reload_reg
[
nregno
]
=
r
ld
[
r
].
reg_rtx
;
/* If NREGNO is a hard register, it may occupy more than
/* If NREGNO is a hard register, it may occupy more than
one register. If it does, say what is in the
one register. If it does, say what is in the
...
@@ -7529,8 +7527,8 @@ emit_reload_insns (chain)
...
@@ -7529,8 +7527,8 @@ emit_reload_insns (chain)
for
(
k
=
1
;
k
<
nnr
;
k
++
)
for
(
k
=
1
;
k
<
nnr
;
k
++
)
reg_last_reload_reg
[
nregno
+
k
]
reg_last_reload_reg
[
nregno
+
k
]
=
(
nr
==
nnr
=
(
nr
==
nnr
?
gen_rtx_REG
(
reg_raw_mode
[
REGNO
(
r
eload_reg_rtx
[
r
]
)
+
k
],
?
gen_rtx_REG
(
reg_raw_mode
[
REGNO
(
r
ld
[
r
].
reg_rtx
)
+
k
],
REGNO
(
r
eload_reg_rtx
[
r
]
)
+
k
)
REGNO
(
r
ld
[
r
].
reg_rtx
)
+
k
)
:
0
);
:
0
);
/* Now do the inverse operation. */
/* Now do the inverse operation. */
...
@@ -7549,38 +7547,38 @@ emit_reload_insns (chain)
...
@@ -7549,38 +7547,38 @@ emit_reload_insns (chain)
/* Maybe the spill reg contains a copy of reload_in. Only do
/* Maybe the spill reg contains a copy of reload_in. Only do
something if there will not be an output reload for
something if there will not be an output reload for
the register being reloaded. */
the register being reloaded. */
else
if
(
r
eload_out_reg
[
r
]
==
0
else
if
(
r
ld
[
r
].
out_reg
==
0
&&
r
eload_in
[
r
]
!=
0
&&
r
ld
[
r
].
in
!=
0
&&
((
GET_CODE
(
r
eload_in
[
r
]
)
==
REG
&&
((
GET_CODE
(
r
ld
[
r
].
in
)
==
REG
&&
REGNO
(
r
eload_in
[
r
]
)
>=
FIRST_PSEUDO_REGISTER
&&
REGNO
(
r
ld
[
r
].
in
)
>=
FIRST_PSEUDO_REGISTER
&&
!
reg_has_output_reload
[
REGNO
(
r
eload_in
[
r
]
)])
&&
!
reg_has_output_reload
[
REGNO
(
r
ld
[
r
].
in
)])
||
(
GET_CODE
(
r
eload_in_reg
[
r
]
)
==
REG
||
(
GET_CODE
(
r
ld
[
r
].
in_reg
)
==
REG
&&
!
reg_has_output_reload
[
REGNO
(
r
eload_in_reg
[
r
]
)]))
&&
!
reg_has_output_reload
[
REGNO
(
r
ld
[
r
].
in_reg
)]))
&&
!
reg_set_p
(
r
eload_reg_rtx
[
r
]
,
PATTERN
(
insn
)))
&&
!
reg_set_p
(
r
ld
[
r
].
reg_rtx
,
PATTERN
(
insn
)))
{
{
register
int
nregno
;
register
int
nregno
;
int
nnr
;
int
nnr
;
if
(
GET_CODE
(
r
eload_in
[
r
]
)
==
REG
if
(
GET_CODE
(
r
ld
[
r
].
in
)
==
REG
&&
REGNO
(
r
eload_in
[
r
]
)
>=
FIRST_PSEUDO_REGISTER
)
&&
REGNO
(
r
ld
[
r
].
in
)
>=
FIRST_PSEUDO_REGISTER
)
nregno
=
REGNO
(
r
eload_in
[
r
]
);
nregno
=
REGNO
(
r
ld
[
r
].
in
);
else
if
(
GET_CODE
(
r
eload_in_reg
[
r
]
)
==
REG
)
else
if
(
GET_CODE
(
r
ld
[
r
].
in_reg
)
==
REG
)
nregno
=
REGNO
(
r
eload_in_reg
[
r
]
);
nregno
=
REGNO
(
r
ld
[
r
].
in_reg
);
else
else
nregno
=
REGNO
(
XEXP
(
r
eload_in_reg
[
r
]
,
0
));
nregno
=
REGNO
(
XEXP
(
r
ld
[
r
].
in_reg
,
0
));
nnr
=
(
nregno
>=
FIRST_PSEUDO_REGISTER
?
1
nnr
=
(
nregno
>=
FIRST_PSEUDO_REGISTER
?
1
:
HARD_REGNO_NREGS
(
nregno
,
:
HARD_REGNO_NREGS
(
nregno
,
GET_MODE
(
r
eload_reg_rtx
[
r
]
)));
GET_MODE
(
r
ld
[
r
].
reg_rtx
)));
reg_last_reload_reg
[
nregno
]
=
r
eload_reg_rtx
[
r
]
;
reg_last_reload_reg
[
nregno
]
=
r
ld
[
r
].
reg_rtx
;
if
(
nregno
<
FIRST_PSEUDO_REGISTER
)
if
(
nregno
<
FIRST_PSEUDO_REGISTER
)
for
(
k
=
1
;
k
<
nnr
;
k
++
)
for
(
k
=
1
;
k
<
nnr
;
k
++
)
reg_last_reload_reg
[
nregno
+
k
]
reg_last_reload_reg
[
nregno
+
k
]
=
(
nr
==
nnr
=
(
nr
==
nnr
?
gen_rtx_REG
(
reg_raw_mode
[
REGNO
(
r
eload_reg_rtx
[
r
]
)
+
k
],
?
gen_rtx_REG
(
reg_raw_mode
[
REGNO
(
r
ld
[
r
].
reg_rtx
)
+
k
],
REGNO
(
r
eload_reg_rtx
[
r
]
)
+
k
)
REGNO
(
r
ld
[
r
].
reg_rtx
)
+
k
)
:
0
);
:
0
);
/* Unless we inherited this reload, show we haven't
/* Unless we inherited this reload, show we haven't
...
@@ -7588,7 +7586,7 @@ emit_reload_insns (chain)
...
@@ -7588,7 +7586,7 @@ emit_reload_insns (chain)
Previous stores of inherited auto_inc expressions
Previous stores of inherited auto_inc expressions
also have to be discarded. */
also have to be discarded. */
if
(
!
reload_inherited
[
r
]
if
(
!
reload_inherited
[
r
]
||
(
r
eload_out
[
r
]
&&
!
reload_out_reg
[
r
]
))
||
(
r
ld
[
r
].
out
&&
!
rld
[
r
].
out_reg
))
spill_reg_store
[
i
]
=
0
;
spill_reg_store
[
i
]
=
0
;
for
(
k
=
0
;
k
<
nr
;
k
++
)
for
(
k
=
0
;
k
<
nr
;
k
++
)
...
@@ -7610,8 +7608,8 @@ emit_reload_insns (chain)
...
@@ -7610,8 +7608,8 @@ emit_reload_insns (chain)
{
{
for
(
k
=
0
;
k
<
nr
;
k
++
)
for
(
k
=
0
;
k
<
nr
;
k
++
)
if
(
reload_reg_reaches_end_p
(
i
+
k
,
if
(
reload_reg_reaches_end_p
(
i
+
k
,
r
eload_opnum
[
r
]
,
r
ld
[
r
].
opnum
,
r
eload_when_needed
[
r
]
))
r
ld
[
r
].
when_needed
))
CLEAR_HARD_REG_BIT
(
reg_reloaded_valid
,
i
+
k
);
CLEAR_HARD_REG_BIT
(
reg_reloaded_valid
,
i
+
k
);
}
}
}
}
...
@@ -7624,13 +7622,13 @@ emit_reload_insns (chain)
...
@@ -7624,13 +7622,13 @@ emit_reload_insns (chain)
that invalidates any previous reloaded copy of it.
that invalidates any previous reloaded copy of it.
But forget_old_reloads_1 won't get to see it, because
But forget_old_reloads_1 won't get to see it, because
it thinks only about the original insn. So invalidate it here. */
it thinks only about the original insn. So invalidate it here. */
if
(
i
<
0
&&
r
eload_out
[
r
]
!=
0
if
(
i
<
0
&&
r
ld
[
r
].
out
!=
0
&&
(
GET_CODE
(
r
eload_out
[
r
]
)
==
REG
&&
(
GET_CODE
(
r
ld
[
r
].
out
)
==
REG
||
(
GET_CODE
(
r
eload_out
[
r
]
)
==
MEM
||
(
GET_CODE
(
r
ld
[
r
].
out
)
==
MEM
&&
GET_CODE
(
r
eload_out_reg
[
r
]
)
==
REG
)))
&&
GET_CODE
(
r
ld
[
r
].
out_reg
)
==
REG
)))
{
{
rtx
out
=
(
GET_CODE
(
r
eload_out
[
r
]
)
==
REG
rtx
out
=
(
GET_CODE
(
r
ld
[
r
].
out
)
==
REG
?
r
eload_out
[
r
]
:
reload_out_reg
[
r
]
);
?
r
ld
[
r
].
out
:
rld
[
r
].
out_reg
);
register
int
nregno
=
REGNO
(
out
);
register
int
nregno
=
REGNO
(
out
);
if
(
nregno
>=
FIRST_PSEUDO_REGISTER
)
if
(
nregno
>=
FIRST_PSEUDO_REGISTER
)
{
{
...
@@ -7641,14 +7639,14 @@ emit_reload_insns (chain)
...
@@ -7641,14 +7639,14 @@ emit_reload_insns (chain)
/* If we can find a hard register that is stored, record
/* If we can find a hard register that is stored, record
the storing insn so that we may delete this insn with
the storing insn so that we may delete this insn with
delete_output_reload. */
delete_output_reload. */
src_reg
=
r
eload_reg_rtx
[
r
]
;
src_reg
=
r
ld
[
r
].
reg_rtx
;
/* If this is an optional reload, try to find the source reg
/* If this is an optional reload, try to find the source reg
from an input reload. */
from an input reload. */
if
(
!
src_reg
)
if
(
!
src_reg
)
{
{
rtx
set
=
single_set
(
insn
);
rtx
set
=
single_set
(
insn
);
if
(
set
&&
SET_DEST
(
set
)
==
r
eload_out
[
r
]
)
if
(
set
&&
SET_DEST
(
set
)
==
r
ld
[
r
].
out
)
{
{
int
k
;
int
k
;
...
@@ -7656,9 +7654,9 @@ emit_reload_insns (chain)
...
@@ -7656,9 +7654,9 @@ emit_reload_insns (chain)
store_insn
=
insn
;
store_insn
=
insn
;
for
(
k
=
0
;
k
<
n_reloads
;
k
++
)
for
(
k
=
0
;
k
<
n_reloads
;
k
++
)
{
{
if
(
r
eload_in
[
k
]
==
src_reg
)
if
(
r
ld
[
k
].
in
==
src_reg
)
{
{
src_reg
=
r
eload_reg_rtx
[
k
]
;
src_reg
=
r
ld
[
k
].
reg_rtx
;
break
;
break
;
}
}
}
}
...
@@ -7697,7 +7695,7 @@ emit_reload_insns (chain)
...
@@ -7697,7 +7695,7 @@ emit_reload_insns (chain)
}
}
else
else
{
{
int
num_regs
=
HARD_REGNO_NREGS
(
nregno
,
GET_MODE
(
r
eload_out
[
r
]
));
int
num_regs
=
HARD_REGNO_NREGS
(
nregno
,
GET_MODE
(
r
ld
[
r
].
out
));
while
(
num_regs
--
>
0
)
while
(
num_regs
--
>
0
)
reg_last_reload_reg
[
nregno
+
num_regs
]
=
0
;
reg_last_reload_reg
[
nregno
+
num_regs
]
=
0
;
...
@@ -7731,9 +7729,9 @@ gen_reload (out, in, opnum, type)
...
@@ -7731,9 +7729,9 @@ gen_reload (out, in, opnum, type)
&&
(
tem
=
gen_lowpart_common
(
GET_MODE
(
SUBREG_REG
(
in
)),
out
))
!=
0
)
&&
(
tem
=
gen_lowpart_common
(
GET_MODE
(
SUBREG_REG
(
in
)),
out
))
!=
0
)
in
=
SUBREG_REG
(
in
),
out
=
tem
;
in
=
SUBREG_REG
(
in
),
out
=
tem
;
else
if
(
GET_CODE
(
out
)
==
SUBREG
else
if
(
GET_CODE
(
out
)
==
SUBREG
&&
(
GET_MODE_SIZE
(
GET_MODE
(
out
))
&&
(
GET_MODE_SIZE
(
GET_MODE
(
out
))
>
GET_MODE_SIZE
(
GET_MODE
(
SUBREG_REG
(
out
))))
>
GET_MODE_SIZE
(
GET_MODE
(
SUBREG_REG
(
out
))))
&&
(
tem
=
gen_lowpart_common
(
GET_MODE
(
SUBREG_REG
(
out
)),
in
))
!=
0
)
&&
(
tem
=
gen_lowpart_common
(
GET_MODE
(
SUBREG_REG
(
out
)),
in
))
!=
0
)
out
=
SUBREG_REG
(
out
),
in
=
tem
;
out
=
SUBREG_REG
(
out
),
in
=
tem
;
/* How to do this reload can get quite tricky. Normally, we are being
/* How to do this reload can get quite tricky. Normally, we are being
...
@@ -7960,14 +7958,14 @@ delete_output_reload (insn, j, last_reload_reg)
...
@@ -7960,14 +7958,14 @@ delete_output_reload (insn, j, last_reload_reg)
insn than it is inherited. */
insn than it is inherited. */
for
(
k
=
n_reloads
-
1
;
k
>=
0
;
k
--
)
for
(
k
=
n_reloads
-
1
;
k
>=
0
;
k
--
)
{
{
rtx
reg2
=
r
eload_in
[
k
]
;
rtx
reg2
=
r
ld
[
k
].
in
;
if
(
!
reg2
)
if
(
!
reg2
)
continue
;
continue
;
if
(
GET_CODE
(
reg2
)
==
MEM
||
reload_override_in
[
k
])
if
(
GET_CODE
(
reg2
)
==
MEM
||
reload_override_in
[
k
])
reg2
=
r
eload_in_reg
[
k
]
;
reg2
=
r
ld
[
k
].
in_reg
;
#ifdef AUTO_INC_DEC
#ifdef AUTO_INC_DEC
if
(
r
eload_out
[
k
]
&&
!
reload_out_reg
[
k
]
)
if
(
r
ld
[
k
].
out
&&
!
rld
[
k
].
out_reg
)
reg2
=
XEXP
(
r
eload_in_reg
[
k
]
,
0
);
reg2
=
XEXP
(
r
ld
[
k
].
in_reg
,
0
);
#endif
#endif
while
(
GET_CODE
(
reg2
)
==
SUBREG
)
while
(
GET_CODE
(
reg2
)
==
SUBREG
)
reg2
=
SUBREG_REG
(
reg2
);
reg2
=
SUBREG_REG
(
reg2
);
...
@@ -7976,7 +7974,7 @@ delete_output_reload (insn, j, last_reload_reg)
...
@@ -7976,7 +7974,7 @@ delete_output_reload (insn, j, last_reload_reg)
if
(
reload_inherited
[
k
]
||
reload_override_in
[
k
]
||
k
==
j
)
if
(
reload_inherited
[
k
]
||
reload_override_in
[
k
]
||
k
==
j
)
{
{
n_inherited
++
;
n_inherited
++
;
reg2
=
r
eload_out_reg
[
k
]
;
reg2
=
r
ld
[
k
].
out_reg
;
if
(
!
reg2
)
if
(
!
reg2
)
continue
;
continue
;
while
(
GET_CODE
(
reg2
)
==
SUBREG
)
while
(
GET_CODE
(
reg2
)
==
SUBREG
)
...
@@ -8029,7 +8027,7 @@ delete_output_reload (insn, j, last_reload_reg)
...
@@ -8029,7 +8027,7 @@ delete_output_reload (insn, j, last_reload_reg)
See if the pseudo reg has been completely replaced
See if the pseudo reg has been completely replaced
with reload regs. If so, delete the store insn
with reload regs. If so, delete the store insn
and forget we had a stack slot for the pseudo. */
and forget we had a stack slot for the pseudo. */
if
(
r
eload_out
[
j
]
!=
reload_in
[
j
]
if
(
r
ld
[
j
].
out
!=
rld
[
j
].
in
&&
REG_N_DEATHS
(
REGNO
(
reg
))
==
1
&&
REG_N_DEATHS
(
REGNO
(
reg
))
==
1
&&
REG_N_SETS
(
REGNO
(
reg
))
==
1
&&
REG_N_SETS
(
REGNO
(
reg
))
==
1
&&
REG_BASIC_BLOCK
(
REGNO
(
reg
))
>=
0
&&
REG_BASIC_BLOCK
(
REGNO
(
reg
))
>=
0
...
@@ -8087,7 +8085,7 @@ delete_output_reload (insn, j, last_reload_reg)
...
@@ -8087,7 +8085,7 @@ delete_output_reload (insn, j, last_reload_reg)
/* For the debugging info,
/* For the debugging info,
say the pseudo lives in this reload reg. */
say the pseudo lives in this reload reg. */
reg_renumber
[
REGNO
(
reg
)]
=
REGNO
(
r
eload_reg_rtx
[
j
]
);
reg_renumber
[
REGNO
(
reg
)]
=
REGNO
(
r
ld
[
j
].
reg_rtx
);
alter_reg
(
REGNO
(
reg
),
-
1
);
alter_reg
(
REGNO
(
reg
),
-
1
);
}
}
delete_address_reloads
(
output_reload_insn
,
insn
);
delete_address_reloads
(
output_reload_insn
,
insn
);
...
@@ -8208,11 +8206,11 @@ delete_address_reloads_1 (dead_insn, x, current_insn)
...
@@ -8208,11 +8206,11 @@ delete_address_reloads_1 (dead_insn, x, current_insn)
if
(
i2
==
current_insn
)
if
(
i2
==
current_insn
)
{
{
for
(
j
=
n_reloads
-
1
;
j
>=
0
;
j
--
)
for
(
j
=
n_reloads
-
1
;
j
>=
0
;
j
--
)
if
((
r
eload_reg_rtx
[
j
]
==
dst
&&
reload_inherited
[
j
])
if
((
r
ld
[
j
].
reg_rtx
==
dst
&&
reload_inherited
[
j
])
||
reload_override_in
[
j
]
==
dst
)
||
reload_override_in
[
j
]
==
dst
)
return
;
return
;
for
(
j
=
n_reloads
-
1
;
j
>=
0
;
j
--
)
for
(
j
=
n_reloads
-
1
;
j
>=
0
;
j
--
)
if
(
r
eload_in
[
j
]
&&
reload_reg_rtx
[
j
]
==
dst
)
if
(
r
ld
[
j
].
in
&&
rld
[
j
].
reg_rtx
==
dst
)
break
;
break
;
if
(
j
>=
0
)
if
(
j
>=
0
)
break
;
break
;
...
@@ -8227,7 +8225,7 @@ delete_address_reloads_1 (dead_insn, x, current_insn)
...
@@ -8227,7 +8225,7 @@ delete_address_reloads_1 (dead_insn, x, current_insn)
if
(
i2
==
current_insn
)
if
(
i2
==
current_insn
)
{
{
for
(
j
=
n_reloads
-
1
;
j
>=
0
;
j
--
)
for
(
j
=
n_reloads
-
1
;
j
>=
0
;
j
--
)
if
((
r
eload_reg_rtx
[
j
]
==
dst
&&
reload_inherited
[
j
])
if
((
r
ld
[
j
].
reg_rtx
==
dst
&&
reload_inherited
[
j
])
||
reload_override_in
[
j
]
==
dst
)
||
reload_override_in
[
j
]
==
dst
)
return
;
return
;
/* ??? We can't finish the loop here, because dst might be
/* ??? We can't finish the loop here, because dst might be
...
@@ -9638,13 +9636,13 @@ reload_combine ()
...
@@ -9638,13 +9636,13 @@ reload_combine ()
reload_combine_ruid
++
;
reload_combine_ruid
++
;
/* Look for (set (REGX) (CONST_INT))
/* Look for (set (REGX) (CONST_INT))
(set (REGX) (PLUS (REGX) (REGY)))
(set (REGX) (PLUS (REGX) (REGY)))
...
...
... (MEM (REGX)) ...
... (MEM (REGX)) ...
and convert it to
and convert it to
(set (REGZ) (CONST_INT))
(set (REGZ) (CONST_INT))
...
...
... (MEM (PLUS (REGZ) (REGY)))... .
... (MEM (PLUS (REGZ) (REGY)))... .
First, check that we have (set (REGX) (PLUS (REGX) (REGY)))
First, check that we have (set (REGX) (PLUS (REGX) (REGY)))
and that we know all uses of REGX before it dies. */
and that we know all uses of REGX before it dies. */
...
...
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