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
f068df3f
Commit
f068df3f
authored
Sep 19, 2001
by
Richard Henderson
Committed by
Richard Henderson
Sep 19, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* cfgbuild.c (find_sub_basic_blocks): Handle insns that can throw.
From-SVN: r45690
parent
e8f92467
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
21 deletions
+47
-21
gcc/ChangeLog
+4
-0
gcc/cfgbuild.c
+43
-21
No files found.
gcc/ChangeLog
View file @
f068df3f
2001
-
09
-
19
Richard
Henderson
<
rth
@redhat
.
com
>
*
cfgbuild
.
c
(
find_sub_basic_blocks
)
:
Handle
insns
that
can
throw
.
2001
-
09
-
18
Catherine
Moore
<
clm
@redhat
.
com
>
2001
-
09
-
18
Catherine
Moore
<
clm
@redhat
.
com
>
*
config
/
stormy16
/
stormy16
.
h
(
DEFAULT_PCC_STRUCT_RETURN
)
:
*
config
/
stormy16
/
stormy16
.
h
(
DEFAULT_PCC_STRUCT_RETURN
)
:
...
...
gcc/cfgbuild.c
View file @
f068df3f
...
@@ -671,8 +671,8 @@ find_sub_basic_blocks (bb)
...
@@ -671,8 +671,8 @@ find_sub_basic_blocks (bb)
{
{
rtx
insn
=
bb
->
head
;
rtx
insn
=
bb
->
head
;
rtx
end
=
bb
->
end
;
rtx
end
=
bb
->
end
;
rtx
jump
_insn
=
NULL_RTX
;
rtx
flow_transfer
_insn
=
NULL_RTX
;
edge
fallt
ru
=
0
;
edge
fallt
hru
=
NULL
;
basic_block
first_bb
=
bb
;
basic_block
first_bb
=
bb
;
int
i
;
int
i
;
...
@@ -686,44 +686,66 @@ find_sub_basic_blocks (bb)
...
@@ -686,44 +686,66 @@ find_sub_basic_blocks (bb)
while
(
1
)
while
(
1
)
{
{
enum
rtx_code
code
=
GET_CODE
(
insn
);
enum
rtx_code
code
=
GET_CODE
(
insn
);
switch
(
code
)
switch
(
code
)
{
{
case
BARRIER
:
case
BARRIER
:
if
(
!
jump
_insn
)
if
(
!
flow_transfer
_insn
)
abort
();
abort
();
break
;
break
;
/* On code label, split current basic block. */
/* On code label, split current basic block. */
case
CODE_LABEL
:
case
CODE_LABEL
:
falltru
=
split_block
(
bb
,
PREV_INSN
(
insn
));
fallt
h
ru
=
split_block
(
bb
,
PREV_INSN
(
insn
));
if
(
jump
_insn
)
if
(
flow_transfer
_insn
)
bb
->
end
=
jump
_insn
;
bb
->
end
=
flow_transfer
_insn
;
bb
=
falltru
->
dest
;
bb
=
fallt
h
ru
->
dest
;
remove_edge
(
falltru
);
remove_edge
(
fallt
h
ru
);
jump_insn
=
0
;
flow_transfer_insn
=
NULL_RTX
;
if
(
LABEL_ALTERNATE_NAME
(
insn
))
if
(
LABEL_ALTERNATE_NAME
(
insn
))
make_edge
(
ENTRY_BLOCK_PTR
,
bb
,
0
);
make_edge
(
ENTRY_BLOCK_PTR
,
bb
,
0
);
break
;
break
;
case
INSN
:
case
INSN
:
case
JUMP_INSN
:
case
JUMP_INSN
:
/* In case we've previously split insn on the JUMP_INSN, move the
case
CALL_INSN
:
block header to proper place. */
/* In case we've previously split an insn that effects a control
if
(
jump_insn
)
flow transfer, move the block header to proper place. */
if
(
flow_transfer_insn
)
{
{
falltru
=
split_block
(
bb
,
PREV_INSN
(
insn
));
fallt
h
ru
=
split_block
(
bb
,
PREV_INSN
(
insn
));
bb
->
end
=
jump
_insn
;
bb
->
end
=
flow_transfer
_insn
;
bb
=
falltru
->
dest
;
bb
=
fallt
h
ru
->
dest
;
remove_edge
(
falltru
);
remove_edge
(
fallt
h
ru
);
jump_insn
=
0
;
flow_transfer_insn
=
NULL_RTX
;
}
}
/* We need some special care for those expressions. */
/* We need some special care for those expressions. */
if
(
GET_CODE
(
insn
)
==
JUMP_INSN
)
if
(
code
==
JUMP_INSN
)
{
{
if
(
GET_CODE
(
PATTERN
(
insn
))
==
ADDR_VEC
if
(
GET_CODE
(
PATTERN
(
insn
))
==
ADDR_VEC
||
GET_CODE
(
PATTERN
(
insn
))
==
ADDR_DIFF_VEC
)
||
GET_CODE
(
PATTERN
(
insn
))
==
ADDR_DIFF_VEC
)
abort
();
abort
();
jump_insn
=
insn
;
flow_transfer_insn
=
insn
;
}
else
if
(
code
==
CALL_INSN
)
{
rtx
note
;
if
(
nonlocal_goto_handler_labels
&&
(
!
(
note
=
find_reg_note
(
insn
,
REG_EH_REGION
,
NULL_RTX
))
||
INTVAL
(
XEXP
(
note
,
0
))
>=
0
))
flow_transfer_insn
=
insn
;
else
if
(
can_throw_internal
(
insn
))
flow_transfer_insn
=
insn
;
else
if
(
SIBLING_CALL_P
(
insn
))
flow_transfer_insn
=
insn
;
else
if
(
find_reg_note
(
insn
,
REG_NORETURN
,
0
))
flow_transfer_insn
=
insn
;
}
}
else
if
(
flag_non_call_exceptions
&&
can_throw_internal
(
insn
))
flow_transfer_insn
=
insn
;
break
;
break
;
default
:
default
:
break
;
break
;
}
}
...
@@ -735,8 +757,8 @@ find_sub_basic_blocks (bb)
...
@@ -735,8 +757,8 @@ find_sub_basic_blocks (bb)
/* In case expander replaced normal insn by sequence terminating by
/* In case expander replaced normal insn by sequence terminating by
return and barrier, or possibly other sequence not behaving like
return and barrier, or possibly other sequence not behaving like
ordinary jump, we need to take care and move basic block boundary. */
ordinary jump, we need to take care and move basic block boundary. */
if
(
jump_insn
&&
GET_CODE
(
bb
->
end
)
!=
JUMP_INSN
)
if
(
flow_transfer_insn
)
bb
->
end
=
jump
_insn
;
bb
->
end
=
flow_transfer
_insn
;
/* We've possibly replaced the conditional jump by conditional jump
/* We've possibly replaced the conditional jump by conditional jump
followed by cleanup at fallthru edge, so the outgoing edges may
followed by cleanup at fallthru edge, so the outgoing edges may
...
...
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