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
48b881a3
Commit
48b881a3
authored
Aug 03, 2000
by
Kazu Hirata
Committed by
Jeff Law
Aug 03, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* jump.c: Fix formatting.
From-SVN: r35453
parent
2e71ae82
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
114 additions
and
99 deletions
+114
-99
gcc/ChangeLog
+2
-0
gcc/jump.c
+112
-99
No files found.
gcc/ChangeLog
View file @
48b881a3
...
@@ -10,6 +10,8 @@ Thu Aug 3 15:53:03 2000 J"orn Rennecke <amylaar@cygnus.co.uk>
...
@@ -10,6 +10,8 @@ Thu Aug 3 15:53:03 2000 J"orn Rennecke <amylaar@cygnus.co.uk>
2000-08-03 Kazu Hirata <kazu@hxi.com>
2000-08-03 Kazu Hirata <kazu@hxi.com>
* jump.c: Fix formatting.
* toplev.c: Fix formatting.
* toplev.c: Fix formatting.
Thu Aug 3 01:05:32 2000 Jeffrey A Law (law@cygnus.com)
Thu Aug 3 01:05:32 2000 Jeffrey A Law (law@cygnus.com)
...
...
gcc/jump.c
View file @
48b881a3
...
@@ -19,7 +19,6 @@ along with GNU CC; see the file COPYING. If not, write to
...
@@ -19,7 +19,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
Boston, MA 02111-1307, USA. */
/* This is the jump-optimization pass of the compiler.
/* This is the jump-optimization pass of the compiler.
It is run two or three times: once before cse, sometimes once after cse,
It is run two or three times: once before cse, sometimes once after cse,
and once after reload (before final).
and once after reload (before final).
...
@@ -156,6 +155,7 @@ rebuild_jump_labels (f)
...
@@ -156,6 +155,7 @@ rebuild_jump_labels (f)
}
}
/* Alternate entry into the jump optimizer. Do only trivial optimizations. */
/* Alternate entry into the jump optimizer. Do only trivial optimizations. */
void
void
jump_optimize_minimal
(
f
)
jump_optimize_minimal
(
f
)
rtx
f
;
rtx
f
;
...
@@ -280,7 +280,7 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan,
...
@@ -280,7 +280,7 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan,
&&
REGNO_FIRST_UID
(
REGNO
(
SET_DEST
(
set
)))
==
INSN_UID
(
insn
)
&&
REGNO_FIRST_UID
(
REGNO
(
SET_DEST
(
set
)))
==
INSN_UID
(
insn
)
/* We use regno_last_note_uid so as not to delete the setting
/* We use regno_last_note_uid so as not to delete the setting
of a reg that's used in notes. A subsequent optimization
of a reg that's used in notes. A subsequent optimization
might arrange to use that reg for real. */
might arrange to use that reg for real. */
&&
REGNO_LAST_NOTE_UID
(
REGNO
(
SET_DEST
(
set
)))
==
INSN_UID
(
insn
)
&&
REGNO_LAST_NOTE_UID
(
REGNO
(
SET_DEST
(
set
)))
==
INSN_UID
(
insn
)
&&
!
side_effects_p
(
SET_SRC
(
set
))
&&
!
side_effects_p
(
SET_SRC
(
set
))
&&
!
find_reg_note
(
insn
,
REG_RETVAL
,
0
)
&&
!
find_reg_note
(
insn
,
REG_RETVAL
,
0
)
...
@@ -374,7 +374,7 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan,
...
@@ -374,7 +374,7 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan,
&&
dispatch
!=
0
&&
dispatch
!=
0
&&
GET_CODE
(
dispatch
)
==
JUMP_INSN
&&
GET_CODE
(
dispatch
)
==
JUMP_INSN
&&
JUMP_LABEL
(
dispatch
)
!=
0
&&
JUMP_LABEL
(
dispatch
)
!=
0
/* Don't mess with a casesi insn.
/* Don't mess with a casesi insn.
XXX according to the comment before computed_jump_p(),
XXX according to the comment before computed_jump_p(),
all casesi insns should be a parallel of the jump
all casesi insns should be a parallel of the jump
and a USE of a LABEL_REF. */
and a USE of a LABEL_REF. */
...
@@ -422,7 +422,7 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan,
...
@@ -422,7 +422,7 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan,
for
(
temp2
=
insn
;
temp2
!=
temp
;
temp2
=
NEXT_INSN
(
temp2
))
for
(
temp2
=
insn
;
temp2
!=
temp
;
temp2
=
NEXT_INSN
(
temp2
))
if
(
GET_CODE
(
temp2
)
==
NOTE
&&
NOTE_LINE_NUMBER
(
temp2
)
>
0
)
if
(
GET_CODE
(
temp2
)
==
NOTE
&&
NOTE_LINE_NUMBER
(
temp2
)
>
0
)
break
;
break
;
if
(
temp2
==
temp
)
if
(
temp2
==
temp
)
{
{
delete_jump
(
insn
);
delete_jump
(
insn
);
...
@@ -791,7 +791,7 @@ init_label_info (f)
...
@@ -791,7 +791,7 @@ init_label_info (f)
return
largest_uid
;
return
largest_uid
;
}
}
/* Delete insns following barriers, up to next label.
/* Delete insns following barriers, up to next label.
Also delete no-op jumps created by gcse. */
Also delete no-op jumps created by gcse. */
...
@@ -865,7 +865,7 @@ mark_all_labels (f, cross_jump)
...
@@ -865,7 +865,7 @@ mark_all_labels (f, cross_jump)
mark_all_labels
(
XEXP
(
PATTERN
(
insn
),
2
),
cross_jump
);
mark_all_labels
(
XEXP
(
PATTERN
(
insn
),
2
),
cross_jump
);
continue
;
continue
;
}
}
mark_jump_label
(
PATTERN
(
insn
),
insn
,
cross_jump
,
0
);
mark_jump_label
(
PATTERN
(
insn
),
insn
,
cross_jump
,
0
);
if
(
!
INSN_DELETED_P
(
insn
)
&&
GET_CODE
(
insn
)
==
JUMP_INSN
)
if
(
!
INSN_DELETED_P
(
insn
)
&&
GET_CODE
(
insn
)
==
JUMP_INSN
)
{
{
...
@@ -894,11 +894,11 @@ delete_unreferenced_labels (f)
...
@@ -894,11 +894,11 @@ delete_unreferenced_labels (f)
rtx
final
=
NULL_RTX
;
rtx
final
=
NULL_RTX
;
rtx
insn
;
rtx
insn
;
for
(
insn
=
f
;
insn
;
)
for
(
insn
=
f
;
insn
;)
{
{
if
(
GET_CODE
(
insn
)
==
CODE_LABEL
if
(
GET_CODE
(
insn
)
==
CODE_LABEL
&&
LABEL_NUSES
(
insn
)
==
0
&&
LABEL_NUSES
(
insn
)
==
0
&&
LABEL_ALTERNATE_NAME
(
insn
)
==
NULL
)
&&
LABEL_ALTERNATE_NAME
(
insn
)
==
NULL
)
insn
=
delete_insn
(
insn
);
insn
=
delete_insn
(
insn
);
else
else
{
{
...
@@ -919,7 +919,7 @@ delete_noop_moves (f)
...
@@ -919,7 +919,7 @@ delete_noop_moves (f)
{
{
rtx
insn
,
next
;
rtx
insn
,
next
;
for
(
insn
=
f
;
insn
;
)
for
(
insn
=
f
;
insn
;)
{
{
next
=
NEXT_INSN
(
insn
);
next
=
NEXT_INSN
(
insn
);
...
@@ -1043,7 +1043,7 @@ delete_noop_moves (f)
...
@@ -1043,7 +1043,7 @@ delete_noop_moves (f)
||
dreg
!=
sreg
)
||
dreg
!=
sreg
)
break
;
break
;
}
}
if
(
i
<
0
)
if
(
i
<
0
)
delete_insn
(
insn
);
delete_insn
(
insn
);
}
}
...
@@ -1261,14 +1261,14 @@ duplicate_loop_exit_test (loop_start)
...
@@ -1261,14 +1261,14 @@ duplicate_loop_exit_test (loop_start)
NOTE_SOURCE_FILE
(
copy
)
=
NOTE_SOURCE_FILE
(
insn
);
NOTE_SOURCE_FILE
(
copy
)
=
NOTE_SOURCE_FILE
(
insn
);
}
}
break
;
break
;
case
INSN
:
case
INSN
:
copy
=
emit_insn_before
(
copy_insn
(
PATTERN
(
insn
)),
loop_start
);
copy
=
emit_insn_before
(
copy_insn
(
PATTERN
(
insn
)),
loop_start
);
if
(
reg_map
)
if
(
reg_map
)
replace_regs
(
PATTERN
(
copy
),
reg_map
,
max_reg
,
1
);
replace_regs
(
PATTERN
(
copy
),
reg_map
,
max_reg
,
1
);
mark_jump_label
(
PATTERN
(
copy
),
copy
,
0
,
0
);
mark_jump_label
(
PATTERN
(
copy
),
copy
,
0
,
0
);
/* Copy all REG_NOTES except REG_LABEL since mark_jump_label will
/* Copy all REG_NOTES except REG_LABEL since mark_jump_label will
make them. */
make them. */
for
(
link
=
REG_NOTES
(
insn
);
link
;
link
=
XEXP
(
link
,
1
))
for
(
link
=
REG_NOTES
(
insn
);
link
;
link
=
XEXP
(
link
,
1
))
...
@@ -1289,9 +1289,10 @@ duplicate_loop_exit_test (loop_start)
...
@@ -1289,9 +1289,10 @@ duplicate_loop_exit_test (loop_start)
if
(
reg_map
&&
REG_NOTES
(
copy
))
if
(
reg_map
&&
REG_NOTES
(
copy
))
replace_regs
(
REG_NOTES
(
copy
),
reg_map
,
max_reg
,
1
);
replace_regs
(
REG_NOTES
(
copy
),
reg_map
,
max_reg
,
1
);
break
;
break
;
case
JUMP_INSN
:
case
JUMP_INSN
:
copy
=
emit_jump_insn_before
(
copy_insn
(
PATTERN
(
insn
)),
loop_start
);
copy
=
emit_jump_insn_before
(
copy_insn
(
PATTERN
(
insn
)),
loop_start
);
if
(
reg_map
)
if
(
reg_map
)
replace_regs
(
PATTERN
(
copy
),
reg_map
,
max_reg
,
1
);
replace_regs
(
PATTERN
(
copy
),
reg_map
,
max_reg
,
1
);
mark_jump_label
(
PATTERN
(
copy
),
copy
,
0
,
0
);
mark_jump_label
(
PATTERN
(
copy
),
copy
,
0
,
0
);
...
@@ -1301,9 +1302,9 @@ duplicate_loop_exit_test (loop_start)
...
@@ -1301,9 +1302,9 @@ duplicate_loop_exit_test (loop_start)
if
(
reg_map
)
if
(
reg_map
)
replace_regs
(
REG_NOTES
(
copy
),
reg_map
,
max_reg
,
1
);
replace_regs
(
REG_NOTES
(
copy
),
reg_map
,
max_reg
,
1
);
}
}
/* If this is a simple jump, add it to the jump chain. */
/* If this is a simple jump, add it to the jump chain. */
if
(
INSN_UID
(
copy
)
<
max_jump_chain
&&
JUMP_LABEL
(
copy
)
if
(
INSN_UID
(
copy
)
<
max_jump_chain
&&
JUMP_LABEL
(
copy
)
&&
simplejump_p
(
copy
))
&&
simplejump_p
(
copy
))
{
{
...
@@ -1312,7 +1313,7 @@ duplicate_loop_exit_test (loop_start)
...
@@ -1312,7 +1313,7 @@ duplicate_loop_exit_test (loop_start)
jump_chain
[
INSN_UID
(
JUMP_LABEL
(
copy
))]
=
copy
;
jump_chain
[
INSN_UID
(
JUMP_LABEL
(
copy
))]
=
copy
;
}
}
break
;
break
;
default
:
default
:
abort
();
abort
();
}
}
...
@@ -1357,7 +1358,7 @@ duplicate_loop_exit_test (loop_start)
...
@@ -1357,7 +1358,7 @@ duplicate_loop_exit_test (loop_start)
emit_note_before
(
NOTE_INSN_LOOP_VTOP
,
exitcode
);
emit_note_before
(
NOTE_INSN_LOOP_VTOP
,
exitcode
);
delete_insn
(
next_nonnote_insn
(
loop_start
));
delete_insn
(
next_nonnote_insn
(
loop_start
));
/* Clean up. */
/* Clean up. */
if
(
reg_map
)
if
(
reg_map
)
free
(
reg_map
);
free
(
reg_map
);
...
@@ -1477,7 +1478,7 @@ find_cross_jump (e1, e2, minimum, f1, f2)
...
@@ -1477,7 +1478,7 @@ find_cross_jump (e1, e2, minimum, f1, f2)
p1
=
PATTERN
(
i1
);
p1
=
PATTERN
(
i1
);
p2
=
PATTERN
(
i2
);
p2
=
PATTERN
(
i2
);
/* If this is a CALL_INSN, compare register usage information.
/* If this is a CALL_INSN, compare register usage information.
If we don't check this on stack register machines, the two
If we don't check this on stack register machines, the two
CALL_INSNs might be merged leaving reg-stack.c with mismatching
CALL_INSNs might be merged leaving reg-stack.c with mismatching
...
@@ -1775,7 +1776,7 @@ can_reverse_comparison_p (comparison, insn)
...
@@ -1775,7 +1776,7 @@ can_reverse_comparison_p (comparison, insn)
arg0
=
XEXP
(
comparison
,
0
);
arg0
=
XEXP
(
comparison
,
0
);
/* Make sure ARG0 is one of the actual objects being compared. If we
/* Make sure ARG0 is one of the actual objects being compared. If we
can't do this, we can't be sure the comparison can be reversed.
can't do this, we can't be sure the comparison can be reversed.
Handle cc0 and a MODE_CC register. */
Handle cc0 and a MODE_CC register. */
if
((
GET_CODE
(
arg0
)
==
REG
&&
GET_MODE_CLASS
(
GET_MODE
(
arg0
))
==
MODE_CC
)
if
((
GET_CODE
(
arg0
)
==
REG
&&
GET_MODE_CLASS
(
GET_MODE
(
arg0
))
==
MODE_CC
)
...
@@ -1799,7 +1800,7 @@ can_reverse_comparison_p (comparison, insn)
...
@@ -1799,7 +1800,7 @@ can_reverse_comparison_p (comparison, insn)
if
(
!
insn
)
if
(
!
insn
)
return
0
;
return
0
;
for
(
prev
=
prev_nonnote_insn
(
insn
);
for
(
prev
=
prev_nonnote_insn
(
insn
);
prev
!=
0
&&
GET_CODE
(
prev
)
!=
CODE_LABEL
;
prev
!=
0
&&
GET_CODE
(
prev
)
!=
CODE_LABEL
;
prev
=
prev_nonnote_insn
(
prev
))
prev
=
prev_nonnote_insn
(
prev
))
...
@@ -1827,7 +1828,7 @@ can_reverse_comparison_p (comparison, insn)
...
@@ -1827,7 +1828,7 @@ can_reverse_comparison_p (comparison, insn)
WATCH OUT! reverse_condition is not safe to use on a jump that might
WATCH OUT! reverse_condition is not safe to use on a jump that might
be acting on the results of an IEEE floating point comparison, because
be acting on the results of an IEEE floating point comparison, because
of the special treatment of non-signaling nans in comparisons.
of the special treatment of non-signaling nans in comparisons.
Use can_reverse_comparison_p to be sure. */
Use can_reverse_comparison_p to be sure. */
enum
rtx_code
enum
rtx_code
...
@@ -2092,7 +2093,7 @@ comparison_dominates_p (code1, code2)
...
@@ -2092,7 +2093,7 @@ comparison_dominates_p (code1, code2)
if
(
code2
==
NE
)
if
(
code2
==
NE
)
return
1
;
return
1
;
break
;
break
;
default
:
default
:
break
;
break
;
}
}
...
@@ -2113,8 +2114,8 @@ simplejump_p (insn)
...
@@ -2113,8 +2114,8 @@ simplejump_p (insn)
}
}
/* Return nonzero if INSN is a (possibly) conditional jump
/* Return nonzero if INSN is a (possibly) conditional jump
and nothing more.
and nothing more.
Use this function is deprecated, since we need to support combined
Use this function is deprecated, since we need to support combined
branch and compare insns. Use any_condjump_p instead whenever possible. */
branch and compare insns. Use any_condjump_p instead whenever possible. */
...
@@ -2131,20 +2132,21 @@ condjump_p (insn)
...
@@ -2131,20 +2132,21 @@ condjump_p (insn)
x
=
SET_SRC
(
x
);
x
=
SET_SRC
(
x
);
if
(
GET_CODE
(
x
)
==
LABEL_REF
)
if
(
GET_CODE
(
x
)
==
LABEL_REF
)
return
1
;
return
1
;
else
return
(
GET_CODE
(
x
)
==
IF_THEN_ELSE
else
&&
((
GET_CODE
(
XEXP
(
x
,
2
))
==
PC
return
(
GET_CODE
(
x
)
==
IF_THEN_ELSE
&&
(
GET_CODE
(
XEXP
(
x
,
1
))
==
LABEL_REF
&&
((
GET_CODE
(
XEXP
(
x
,
2
))
==
PC
||
GET_CODE
(
XEXP
(
x
,
1
))
==
RETURN
))
&&
(
GET_CODE
(
XEXP
(
x
,
1
))
==
LABEL_REF
||
(
GET_CODE
(
XEXP
(
x
,
1
))
==
PC
||
GET_CODE
(
XEXP
(
x
,
1
))
==
RETURN
))
&&
(
GET_CODE
(
XEXP
(
x
,
2
))
==
LABEL_REF
||
(
GET_CODE
(
XEXP
(
x
,
1
))
==
PC
||
GET_CODE
(
XEXP
(
x
,
2
))
==
RETURN
))));
&&
(
GET_CODE
(
XEXP
(
x
,
2
))
==
LABEL_REF
||
GET_CODE
(
XEXP
(
x
,
2
))
==
RETURN
))));
return
0
;
return
0
;
}
}
/* Return nonzero if INSN is a (possibly) conditional jump inside a
/* Return nonzero if INSN is a (possibly) conditional jump inside a
PARALLEL.
PARALLEL.
Use this function is deprecated, since we need to support combined
Use this function is deprecated, since we need to support combined
branch and compare insns. Use any_condjump_p instead whenever possible. */
branch and compare insns. Use any_condjump_p instead whenever possible. */
...
@@ -2237,7 +2239,7 @@ any_condjump_p (insn)
...
@@ -2237,7 +2239,7 @@ any_condjump_p (insn)
b
=
GET_CODE
(
XEXP
(
SET_SRC
(
x
),
2
));
b
=
GET_CODE
(
XEXP
(
SET_SRC
(
x
),
2
));
return
((
b
==
PC
&&
(
a
==
LABEL_REF
||
a
==
RETURN
))
return
((
b
==
PC
&&
(
a
==
LABEL_REF
||
a
==
RETURN
))
||
(
a
==
PC
&&
(
b
==
LABEL_REF
||
b
==
RETURN
)));
||
(
a
==
PC
&&
(
b
==
LABEL_REF
||
b
==
RETURN
)));
}
}
/* Return the label of a conditional jump. */
/* Return the label of a conditional jump. */
...
@@ -2469,11 +2471,11 @@ mark_jump_label (x, insn, cross_jump, in_mem)
...
@@ -2469,11 +2471,11 @@ mark_jump_label (x, insn, cross_jump, in_mem)
case
SYMBOL_REF
:
case
SYMBOL_REF
:
if
(
!
in_mem
)
if
(
!
in_mem
)
return
;
return
;
/* If this is a constant-pool reference, see if it is a label. */
/* If this is a constant-pool reference, see if it is a label. */
if
(
CONSTANT_POOL_ADDRESS_P
(
x
))
if
(
CONSTANT_POOL_ADDRESS_P
(
x
))
mark_jump_label
(
get_pool_constant
(
x
),
insn
,
cross_jump
,
in_mem
);
mark_jump_label
(
get_pool_constant
(
x
),
insn
,
cross_jump
,
in_mem
);
break
;
break
;
case
LABEL_REF
:
case
LABEL_REF
:
...
@@ -2485,7 +2487,7 @@ mark_jump_label (x, insn, cross_jump, in_mem)
...
@@ -2485,7 +2487,7 @@ mark_jump_label (x, insn, cross_jump, in_mem)
/* Ignore remaining references to unreachable labels that
/* Ignore remaining references to unreachable labels that
have been deleted. */
have been deleted. */
if
(
GET_CODE
(
label
)
==
NOTE
if
(
GET_CODE
(
label
)
==
NOTE
&&
NOTE_LINE_NUMBER
(
label
)
==
NOTE_INSN_DELETED_LABEL
)
&&
NOTE_LINE_NUMBER
(
label
)
==
NOTE_INSN_DELETED_LABEL
)
break
;
break
;
...
@@ -2513,7 +2515,8 @@ mark_jump_label (x, insn, cross_jump, in_mem)
...
@@ -2513,7 +2515,8 @@ mark_jump_label (x, insn, cross_jump, in_mem)
||
NOTE_LINE_NUMBER
(
next
)
==
NOTE_INSN_FUNCTION_END
||
NOTE_LINE_NUMBER
(
next
)
==
NOTE_INSN_FUNCTION_END
/* ??? Optional. Disables some optimizations, but
/* ??? Optional. Disables some optimizations, but
makes gcov output more accurate with -O. */
makes gcov output more accurate with -O. */
||
(
flag_test_coverage
&&
NOTE_LINE_NUMBER
(
next
)
>
0
)))
||
(
flag_test_coverage
&&
NOTE_LINE_NUMBER
(
next
)
>
0
)))
break
;
break
;
}
}
...
@@ -2565,11 +2568,11 @@ mark_jump_label (x, insn, cross_jump, in_mem)
...
@@ -2565,11 +2568,11 @@ mark_jump_label (x, insn, cross_jump, in_mem)
int
eltnum
=
code
==
ADDR_DIFF_VEC
?
1
:
0
;
int
eltnum
=
code
==
ADDR_DIFF_VEC
?
1
:
0
;
for
(
i
=
0
;
i
<
XVECLEN
(
x
,
eltnum
);
i
++
)
for
(
i
=
0
;
i
<
XVECLEN
(
x
,
eltnum
);
i
++
)
mark_jump_label
(
XVECEXP
(
x
,
eltnum
,
i
),
NULL_RTX
,
mark_jump_label
(
XVECEXP
(
x
,
eltnum
,
i
),
NULL_RTX
,
cross_jump
,
in_mem
);
cross_jump
,
in_mem
);
}
}
return
;
return
;
default
:
default
:
break
;
break
;
}
}
...
@@ -2680,12 +2683,15 @@ delete_prior_computation (note, insn)
...
@@ -2680,12 +2683,15 @@ delete_prior_computation (note, insn)
{
{
int
dest_regno
=
REGNO
(
SET_DEST
(
pat
));
int
dest_regno
=
REGNO
(
SET_DEST
(
pat
));
int
dest_endregno
int
dest_endregno
=
dest_regno
+
(
dest_regno
<
FIRST_PSEUDO_REGISTER
=
(
dest_regno
+
(
dest_regno
<
FIRST_PSEUDO_REGISTER
?
HARD_REGNO_NREGS
(
dest_regno
,
?
HARD_REGNO_NREGS
(
dest_regno
,
GET_MODE
(
SET_DEST
(
pat
)))
:
1
);
GET_MODE
(
SET_DEST
(
pat
)))
:
1
)
);
int
regno
=
REGNO
(
reg
);
int
regno
=
REGNO
(
reg
);
int
endregno
=
regno
+
(
regno
<
FIRST_PSEUDO_REGISTER
int
endregno
?
HARD_REGNO_NREGS
(
regno
,
GET_MODE
(
reg
))
:
1
);
=
(
regno
+
(
regno
<
FIRST_PSEUDO_REGISTER
?
HARD_REGNO_NREGS
(
regno
,
GET_MODE
(
reg
))
:
1
));
if
(
dest_regno
>=
regno
if
(
dest_regno
>=
regno
&&
dest_endregno
<=
endregno
)
&&
dest_endregno
<=
endregno
)
...
@@ -2701,7 +2707,8 @@ delete_prior_computation (note, insn)
...
@@ -2701,7 +2707,8 @@ delete_prior_computation (note, insn)
int
i
;
int
i
;
REG_NOTES
(
our_prev
)
REG_NOTES
(
our_prev
)
=
gen_rtx_EXPR_LIST
(
REG_UNUSED
,
reg
,
REG_NOTES
(
our_prev
));
=
gen_rtx_EXPR_LIST
(
REG_UNUSED
,
reg
,
REG_NOTES
(
our_prev
));
for
(
i
=
dest_regno
;
i
<
dest_endregno
;
i
++
)
for
(
i
=
dest_regno
;
i
<
dest_endregno
;
i
++
)
if
(
!
find_regno_note
(
our_prev
,
REG_UNUSED
,
i
))
if
(
!
find_regno_note
(
our_prev
,
REG_UNUSED
,
i
))
...
@@ -2787,24 +2794,25 @@ delete_computation (insn)
...
@@ -2787,24 +2794,25 @@ delete_computation (insn)
set
=
single_set
(
insn
);
set
=
single_set
(
insn
);
if
(
set
&&
GET_CODE
(
SET_DEST
(
set
))
==
REG
)
if
(
set
&&
GET_CODE
(
SET_DEST
(
set
))
==
REG
)
{
{
int
dest_regno
=
REGNO
(
SET_DEST
(
set
));
int
dest_regno
=
REGNO
(
SET_DEST
(
set
));
int
dest_endregno
int
dest_endregno
=
dest_regno
+
(
dest_regno
<
FIRST_PSEUDO_REGISTER
=
dest_regno
+
(
dest_regno
<
FIRST_PSEUDO_REGISTER
?
HARD_REGNO_NREGS
(
dest_regno
,
?
HARD_REGNO_NREGS
(
dest_regno
,
GET_MODE
(
SET_DEST
(
set
)))
:
1
);
GET_MODE
(
SET_DEST
(
set
)))
:
1
);
int
i
;
int
i
;
for
(
i
=
dest_regno
;
i
<
dest_endregno
;
i
++
)
for
(
i
=
dest_regno
;
i
<
dest_endregno
;
i
++
)
{
{
if
(
!
refers_to_regno_p
(
i
,
i
+
1
,
SET_SRC
(
set
),
NULL_PTR
)
if
(
!
refers_to_regno_p
(
i
,
i
+
1
,
SET_SRC
(
set
),
NULL_PTR
)
||
find_regno_note
(
insn
,
REG_DEAD
,
i
))
||
find_regno_note
(
insn
,
REG_DEAD
,
i
))
continue
;
continue
;
note
=
gen_rtx_EXPR_LIST
(
REG_DEAD
,
(
i
<
FIRST_PSEUDO_REGISTER
note
=
gen_rtx_EXPR_LIST
(
REG_DEAD
,
?
gen_rtx_REG
(
reg_raw_mode
[
i
],
i
)
(
i
<
FIRST_PSEUDO_REGISTER
:
SET_DEST
(
set
)),
NULL_RTX
);
?
gen_rtx_REG
(
reg_raw_mode
[
i
],
i
)
delete_prior_computation
(
note
,
insn
);
:
SET_DEST
(
set
)),
NULL_RTX
);
}
delete_prior_computation
(
note
,
insn
);
}
}
}
for
(
note
=
REG_NOTES
(
insn
);
note
;
note
=
next
)
for
(
note
=
REG_NOTES
(
insn
);
note
;
note
=
next
)
...
@@ -3067,19 +3075,19 @@ never_reached_warning (avoided_insn)
...
@@ -3067,19 +3075,19 @@ never_reached_warning (avoided_insn)
rtx
a_line_note
=
NULL
;
rtx
a_line_note
=
NULL
;
int
two_avoided_lines
=
0
;
int
two_avoided_lines
=
0
;
int
contains_insn
=
0
;
int
contains_insn
=
0
;
if
(
!
warn_notreached
)
if
(
!
warn_notreached
)
return
;
return
;
/* Scan forwards, looking at LINE_NUMBER notes, until
/* Scan forwards, looking at LINE_NUMBER notes, until
we hit a LABEL or we run out of insns. */
we hit a LABEL or we run out of insns. */
for
(
insn
=
avoided_insn
;
insn
!=
NULL
;
insn
=
NEXT_INSN
(
insn
))
for
(
insn
=
avoided_insn
;
insn
!=
NULL
;
insn
=
NEXT_INSN
(
insn
))
{
{
if
(
GET_CODE
(
insn
)
==
CODE_LABEL
)
if
(
GET_CODE
(
insn
)
==
CODE_LABEL
)
break
;
break
;
else
if
(
GET_CODE
(
insn
)
==
NOTE
/* A line number note? */
else
if
(
GET_CODE
(
insn
)
==
NOTE
/* A line number note? */
&&
NOTE_LINE_NUMBER
(
insn
)
>=
0
)
&&
NOTE_LINE_NUMBER
(
insn
)
>=
0
)
{
{
if
(
a_line_note
==
NULL
)
if
(
a_line_note
==
NULL
)
a_line_note
=
insn
;
a_line_note
=
insn
;
...
@@ -3087,8 +3095,8 @@ never_reached_warning (avoided_insn)
...
@@ -3087,8 +3095,8 @@ never_reached_warning (avoided_insn)
two_avoided_lines
|=
(
NOTE_LINE_NUMBER
(
a_line_note
)
two_avoided_lines
|=
(
NOTE_LINE_NUMBER
(
a_line_note
)
!=
NOTE_LINE_NUMBER
(
insn
));
!=
NOTE_LINE_NUMBER
(
insn
));
}
}
else
if
(
GET_RTX_CLASS
(
GET_CODE
(
insn
))
==
'i'
)
else
if
(
GET_RTX_CLASS
(
GET_CODE
(
insn
))
==
'i'
)
contains_insn
=
1
;
contains_insn
=
1
;
}
}
if
(
two_avoided_lines
&&
contains_insn
)
if
(
two_avoided_lines
&&
contains_insn
)
warning_with_file_and_line
(
NOTE_SOURCE_FILE
(
a_line_note
),
warning_with_file_and_line
(
NOTE_SOURCE_FILE
(
a_line_note
),
...
@@ -3118,7 +3126,7 @@ redirect_exp_1 (loc, olabel, nlabel, insn)
...
@@ -3118,7 +3126,7 @@ redirect_exp_1 (loc, olabel, nlabel, insn)
if
(
nlabel
)
if
(
nlabel
)
n
=
gen_rtx_LABEL_REF
(
VOIDmode
,
nlabel
);
n
=
gen_rtx_LABEL_REF
(
VOIDmode
,
nlabel
);
else
else
n
=
gen_rtx_RETURN
(
VOIDmode
);
n
=
gen_rtx_RETURN
(
VOIDmode
);
validate_change
(
insn
,
loc
,
n
,
1
);
validate_change
(
insn
,
loc
,
n
,
1
);
return
;
return
;
...
@@ -3254,7 +3262,7 @@ redirect_jump (jump, nlabel, delete_unused)
...
@@ -3254,7 +3262,7 @@ redirect_jump (jump, nlabel, delete_unused)
return
1
;
return
1
;
}
}
/* Invert the jump condition of rtx X contained in jump insn, INSN.
/* Invert the jump condition of rtx X contained in jump insn, INSN.
Accrue the modifications into the change group. */
Accrue the modifications into the change group. */
static
void
static
void
...
@@ -3265,7 +3273,7 @@ invert_exp_1 (insn)
...
@@ -3265,7 +3273,7 @@ invert_exp_1 (insn)
rtx
x
=
pc_set
(
insn
);
rtx
x
=
pc_set
(
insn
);
if
(
!
x
)
if
(
!
x
)
abort
();
abort
();
x
=
SET_SRC
(
x
);
x
=
SET_SRC
(
x
);
code
=
GET_CODE
(
x
);
code
=
GET_CODE
(
x
);
...
@@ -3289,7 +3297,7 @@ invert_exp_1 (insn)
...
@@ -3289,7 +3297,7 @@ invert_exp_1 (insn)
1
);
1
);
return
;
return
;
}
}
tem
=
XEXP
(
x
,
1
);
tem
=
XEXP
(
x
,
1
);
validate_change
(
insn
,
&
XEXP
(
x
,
1
),
XEXP
(
x
,
2
),
1
);
validate_change
(
insn
,
&
XEXP
(
x
,
1
),
XEXP
(
x
,
2
),
1
);
validate_change
(
insn
,
&
XEXP
(
x
,
2
),
tem
,
1
);
validate_change
(
insn
,
&
XEXP
(
x
,
2
),
tem
,
1
);
...
@@ -3298,7 +3306,7 @@ invert_exp_1 (insn)
...
@@ -3298,7 +3306,7 @@ invert_exp_1 (insn)
abort
();
abort
();
}
}
/* Invert the jump condition of conditional jump insn, INSN.
/* Invert the jump condition of conditional jump insn, INSN.
Return 1 if we can do so, 0 if we cannot find a way to do so that
Return 1 if we can do so, 0 if we cannot find a way to do so that
matches a pattern. */
matches a pattern. */
...
@@ -3386,7 +3394,8 @@ delete_from_jump_chain (jump)
...
@@ -3386,7 +3394,8 @@ delete_from_jump_chain (jump)
/* Handle return insns. */
/* Handle return insns. */
else
if
(
jump_chain
&&
GET_CODE
(
PATTERN
(
jump
))
==
RETURN
)
else
if
(
jump_chain
&&
GET_CODE
(
PATTERN
(
jump
))
==
RETURN
)
index
=
0
;
index
=
0
;
else
return
;
else
return
;
if
(
jump_chain
[
index
]
==
jump
)
if
(
jump_chain
[
index
]
==
jump
)
jump_chain
[
index
]
=
jump_chain
[
INSN_UID
(
jump
)];
jump_chain
[
index
]
=
jump_chain
[
INSN_UID
(
jump
)];
...
@@ -3497,7 +3506,7 @@ rtx_renumbered_equal_p (x, y)
...
@@ -3497,7 +3506,7 @@ rtx_renumbered_equal_p (x, y)
register
int
i
;
register
int
i
;
register
RTX_CODE
code
=
GET_CODE
(
x
);
register
RTX_CODE
code
=
GET_CODE
(
x
);
register
const
char
*
fmt
;
register
const
char
*
fmt
;
if
(
x
==
y
)
if
(
x
==
y
)
return
1
;
return
1
;
...
@@ -3557,7 +3566,7 @@ rtx_renumbered_equal_p (x, y)
...
@@ -3557,7 +3566,7 @@ rtx_renumbered_equal_p (x, y)
return
reg_x
>=
0
&&
reg_x
==
reg_y
&&
word_x
==
word_y
;
return
reg_x
>=
0
&&
reg_x
==
reg_y
&&
word_x
==
word_y
;
}
}
/* Now we have disposed of all the cases
/* Now we have disposed of all the cases
in which different rtx codes can match. */
in which different rtx codes can match. */
if
(
code
!=
GET_CODE
(
y
))
if
(
code
!=
GET_CODE
(
y
))
return
0
;
return
0
;
...
@@ -3711,7 +3720,7 @@ true_regnum (x)
...
@@ -3711,7 +3720,7 @@ true_regnum (x)
In general, if the first test fails, the program can branch
In general, if the first test fails, the program can branch
directly to `foo' and skip the second try which is doomed to fail.
directly to `foo' and skip the second try which is doomed to fail.
We run this after loop optimization and before flow analysis. */
We run this after loop optimization and before flow analysis. */
/* When comparing the insn patterns, we track the fact that different
/* When comparing the insn patterns, we track the fact that different
pseudo-register numbers may have been used in each computation.
pseudo-register numbers may have been used in each computation.
The following array stores an equivalence -- same_regs[I] == J means
The following array stores an equivalence -- same_regs[I] == J means
...
@@ -3733,7 +3742,7 @@ static char *modified_regs;
...
@@ -3733,7 +3742,7 @@ static char *modified_regs;
static
int
modified_mem
;
static
int
modified_mem
;
/* Called via note_stores on each insn between the target of the first
/* Called via note_stores on each insn between the target of the first
branch and the second branch. It marks any changed registers. */
branch and the second branch. It marks any changed registers. */
static
void
static
void
...
@@ -3763,7 +3772,7 @@ mark_modified_reg (dest, x, data)
...
@@ -3763,7 +3772,7 @@ mark_modified_reg (dest, x, data)
}
}
/* F is the first insn in the chain of insns. */
/* F is the first insn in the chain of insns. */
void
void
thread_jumps
(
f
,
max_reg
,
flag_before_loop
)
thread_jumps
(
f
,
max_reg
,
flag_before_loop
)
rtx
f
;
rtx
f
;
...
@@ -3779,7 +3788,7 @@ thread_jumps (f, max_reg, flag_before_loop)
...
@@ -3779,7 +3788,7 @@ thread_jumps (f, max_reg, flag_before_loop)
will either always succeed or always fail depending on the relative
will either always succeed or always fail depending on the relative
senses of the two branches. So adjust the first branch accordingly
senses of the two branches. So adjust the first branch accordingly
in this case. */
in this case. */
rtx
label
,
b1
,
b2
,
t1
,
t2
;
rtx
label
,
b1
,
b2
,
t1
,
t2
;
enum
rtx_code
code1
,
code2
;
enum
rtx_code
code1
,
code2
;
rtx
b1op0
,
b1op1
,
b2op0
,
b2op1
;
rtx
b1op0
,
b1op1
,
b2op0
,
b2op1
;
...
@@ -3793,7 +3802,7 @@ thread_jumps (f, max_reg, flag_before_loop)
...
@@ -3793,7 +3802,7 @@ thread_jumps (f, max_reg, flag_before_loop)
all_reset
=
(
int
*
)
xmalloc
(
max_reg
*
sizeof
(
int
));
all_reset
=
(
int
*
)
xmalloc
(
max_reg
*
sizeof
(
int
));
for
(
i
=
0
;
i
<
max_reg
;
i
++
)
for
(
i
=
0
;
i
<
max_reg
;
i
++
)
all_reset
[
i
]
=
-
1
;
all_reset
[
i
]
=
-
1
;
while
(
changed
)
while
(
changed
)
{
{
changed
=
0
;
changed
=
0
;
...
@@ -3802,6 +3811,7 @@ thread_jumps (f, max_reg, flag_before_loop)
...
@@ -3802,6 +3811,7 @@ thread_jumps (f, max_reg, flag_before_loop)
{
{
rtx
set
;
rtx
set
;
rtx
set2
;
rtx
set2
;
/* Get to a candidate branch insn. */
/* Get to a candidate branch insn. */
if
(
GET_CODE
(
b1
)
!=
JUMP_INSN
if
(
GET_CODE
(
b1
)
!=
JUMP_INSN
||
!
any_condjump_p
(
b1
)
||
JUMP_LABEL
(
b1
)
==
0
)
||
!
any_condjump_p
(
b1
)
||
JUMP_LABEL
(
b1
)
==
0
)
...
@@ -3891,12 +3901,13 @@ thread_jumps (f, max_reg, flag_before_loop)
...
@@ -3891,12 +3901,13 @@ thread_jumps (f, max_reg, flag_before_loop)
&&
rtx_equal_for_thread_p
(
b1op1
,
b2op1
,
b2
)
&&
rtx_equal_for_thread_p
(
b1op1
,
b2op1
,
b2
)
&&
(
comparison_dominates_p
(
code1
,
code2
)
&&
(
comparison_dominates_p
(
code1
,
code2
)
||
(
can_reverse_comparison_p
(
XEXP
(
SET_SRC
(
set
),
0
),
b1
)
||
(
can_reverse_comparison_p
(
XEXP
(
SET_SRC
(
set
),
0
),
b1
)
&&
comparison_dominates_p
(
code1
,
reverse_condition
(
code2
)))))
&&
comparison_dominates_p
(
code1
,
reverse_condition
(
code2
)))))
{
{
t1
=
prev_nonnote_insn
(
b1
);
t1
=
prev_nonnote_insn
(
b1
);
t2
=
prev_nonnote_insn
(
b2
);
t2
=
prev_nonnote_insn
(
b2
);
while
(
t1
!=
0
&&
t2
!=
0
)
while
(
t1
!=
0
&&
t2
!=
0
)
{
{
if
(
t2
==
label
)
if
(
t2
==
label
)
...
@@ -3912,7 +3923,7 @@ thread_jumps (f, max_reg, flag_before_loop)
...
@@ -3912,7 +3923,7 @@ thread_jumps (f, max_reg, flag_before_loop)
break
;
break
;
if
(
comparison_dominates_p
(
code1
,
code2
))
if
(
comparison_dominates_p
(
code1
,
code2
))
new_label
=
JUMP_LABEL
(
b2
);
new_label
=
JUMP_LABEL
(
b2
);
else
else
new_label
=
get_label_after
(
b2
);
new_label
=
get_label_after
(
b2
);
...
@@ -3934,7 +3945,7 @@ thread_jumps (f, max_reg, flag_before_loop)
...
@@ -3934,7 +3945,7 @@ thread_jumps (f, max_reg, flag_before_loop)
}
}
break
;
break
;
}
}
/* If either of these is not a normal insn (it might be
/* If either of these is not a normal insn (it might be
a JUMP_INSN, CALL_INSN, or CODE_LABEL) we fail. (NOTEs
a JUMP_INSN, CALL_INSN, or CODE_LABEL) we fail. (NOTEs
have already been skipped above.) Similarly, fail
have already been skipped above.) Similarly, fail
...
@@ -3944,7 +3955,7 @@ thread_jumps (f, max_reg, flag_before_loop)
...
@@ -3944,7 +3955,7 @@ thread_jumps (f, max_reg, flag_before_loop)
||
!
rtx_equal_for_thread_p
(
PATTERN
(
t1
),
||
!
rtx_equal_for_thread_p
(
PATTERN
(
t1
),
PATTERN
(
t2
),
t2
))
PATTERN
(
t2
),
t2
))
break
;
break
;
t1
=
prev_nonnote_insn
(
t1
);
t1
=
prev_nonnote_insn
(
t1
);
t2
=
prev_nonnote_insn
(
t2
);
t2
=
prev_nonnote_insn
(
t2
);
}
}
...
@@ -3961,7 +3972,7 @@ thread_jumps (f, max_reg, flag_before_loop)
...
@@ -3961,7 +3972,7 @@ thread_jumps (f, max_reg, flag_before_loop)
/* This is like RTX_EQUAL_P except that it knows about our handling of
/* This is like RTX_EQUAL_P except that it knows about our handling of
possibly equivalent registers and knows to consider volatile and
possibly equivalent registers and knows to consider volatile and
modified objects as not equal.
modified objects as not equal.
YINSN is the insn containing Y. */
YINSN is the insn containing Y. */
int
int
...
@@ -4025,7 +4036,7 @@ rtx_equal_for_thread_p (x, y, yinsn)
...
@@ -4025,7 +4036,7 @@ rtx_equal_for_thread_p (x, y, yinsn)
num_same_regs
++
;
num_same_regs
++
;
/* If this is the first time we are seeing a register on the `Y'
/* If this is the first time we are seeing a register on the `Y'
side, see if it is the last use. If not, we can't thread the
side, see if it is the last use. If not, we can't thread the
jump, so mark it as not equivalent. */
jump, so mark it as not equivalent. */
if
(
REGNO_LAST_UID
(
REGNO
(
y
))
!=
INSN_UID
(
yinsn
))
if
(
REGNO_LAST_UID
(
REGNO
(
y
))
!=
INSN_UID
(
yinsn
))
return
0
;
return
0
;
...
@@ -4057,7 +4068,7 @@ rtx_equal_for_thread_p (x, y, yinsn)
...
@@ -4057,7 +4068,7 @@ rtx_equal_for_thread_p (x, y, yinsn)
if
(
GET_CODE
(
SET_DEST
(
x
))
==
REG
if
(
GET_CODE
(
SET_DEST
(
x
))
==
REG
&&
GET_CODE
(
SET_DEST
(
y
))
==
REG
)
&&
GET_CODE
(
SET_DEST
(
y
))
==
REG
)
{
{
if
(
same_regs
[
REGNO
(
SET_DEST
(
x
))]
==
(
int
)
REGNO
(
SET_DEST
(
y
)))
if
(
same_regs
[
REGNO
(
SET_DEST
(
x
))]
==
(
int
)
REGNO
(
SET_DEST
(
y
)))
{
{
same_regs
[
REGNO
(
SET_DEST
(
x
))]
=
-
1
;
same_regs
[
REGNO
(
SET_DEST
(
x
))]
=
-
1
;
num_same_regs
--
;
num_same_regs
--
;
...
@@ -4066,8 +4077,10 @@ rtx_equal_for_thread_p (x, y, yinsn)
...
@@ -4066,8 +4077,10 @@ rtx_equal_for_thread_p (x, y, yinsn)
return
0
;
return
0
;
}
}
else
else
if
(
rtx_equal_for_thread_p
(
SET_DEST
(
x
),
SET_DEST
(
y
),
yinsn
)
==
0
)
{
return
0
;
if
(
rtx_equal_for_thread_p
(
SET_DEST
(
x
),
SET_DEST
(
y
),
yinsn
)
==
0
)
return
0
;
}
return
rtx_equal_for_thread_p
(
SET_SRC
(
x
),
SET_SRC
(
y
),
yinsn
);
return
rtx_equal_for_thread_p
(
SET_SRC
(
x
),
SET_SRC
(
y
),
yinsn
);
...
@@ -4076,7 +4089,7 @@ rtx_equal_for_thread_p (x, y, yinsn)
...
@@ -4076,7 +4089,7 @@ rtx_equal_for_thread_p (x, y, yinsn)
case
SYMBOL_REF
:
case
SYMBOL_REF
:
return
XSTR
(
x
,
0
)
==
XSTR
(
y
,
0
);
return
XSTR
(
x
,
0
)
==
XSTR
(
y
,
0
);
default
:
default
:
break
;
break
;
}
}
...
@@ -4109,7 +4122,7 @@ rtx_equal_for_thread_p (x, y, yinsn)
...
@@ -4109,7 +4122,7 @@ rtx_equal_for_thread_p (x, y, yinsn)
/* And the corresponding elements must match. */
/* And the corresponding elements must match. */
for
(
j
=
0
;
j
<
XVECLEN
(
x
,
i
);
j
++
)
for
(
j
=
0
;
j
<
XVECLEN
(
x
,
i
);
j
++
)
if
(
rtx_equal_for_thread_p
(
XVECEXP
(
x
,
i
,
j
),
if
(
rtx_equal_for_thread_p
(
XVECEXP
(
x
,
i
,
j
),
XVECEXP
(
y
,
i
,
j
),
yinsn
)
==
0
)
XVECEXP
(
y
,
i
,
j
),
yinsn
)
==
0
)
return
0
;
return
0
;
break
;
break
;
...
...
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