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
2f1b0141
Commit
2f1b0141
authored
Nov 06, 2014
by
Eric Botcazou
Committed by
Eric Botcazou
Nov 06, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* tree-cfgcleanup.c (fixup_noreturn_call): Do not perform DCE here.
From-SVN: r217201
parent
45d898e4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
34 deletions
+41
-34
gcc/ChangeLog
+4
-0
gcc/testsuite/ChangeLog
+4
-0
gcc/testsuite/gnat.dg/opt43.adb
+21
-0
gcc/tree-cfgcleanup.c
+12
-34
No files found.
gcc/ChangeLog
View file @
2f1b0141
2014
-
11
-
06
Eric
Botcazou
<
ebotcazou
@
adacore
.
com
>
*
tree
-
cfgcleanup
.
c
(
fixup_noreturn_call
):
Do
not
perform
DCE
here
.
2014
-
11
-
06
DJ
Delorie
<
dj
@
redhat
.
com
>
*
config
/
m32c
/
cond
.
md
(
movqicc_
<
code
>
_
<
mode
>):
Remove
mode
of
gcc/testsuite/ChangeLog
View file @
2f1b0141
2014
-
11
-
06
Eric
Botcazou
<
ebotcazou
@
adacore
.
com
>
*
gnat
.
dg
/
opt43
.
adb
:
New
test
.
2014
-
11
-
06
Marek
Polacek
<
polacek
@
redhat
.
com
>
*
c
-
c
++-
common
/
ubsan
/
align
-
2.
c
:
Add
dg
-
output
.
...
...
gcc/testsuite/gnat.dg/opt43.adb
0 → 100644
View file @
2f1b0141
-- { dg-do compile }
-- { dg-options "-O -gnatws" }
procedure Opt43 is
function Func return Integer is
begin
if False then
return 0;
end if;
end;
begin
if Func = Func then
raise Program_Error;
end if;
exception
when Program_Error => null;
end;
gcc/tree-cfgcleanup.c
View file @
2f1b0141
...
...
@@ -568,7 +568,6 @@ bool
fixup_noreturn_call
(
gimple
stmt
)
{
basic_block
bb
=
gimple_bb
(
stmt
);
bool
changed
=
false
;
if
(
gimple_call_builtin_p
(
stmt
,
BUILT_IN_RETURN
))
return
false
;
...
...
@@ -590,46 +589,25 @@ fixup_noreturn_call (gimple stmt)
split_block
(
bb
,
stmt
);
}
changed
|=
remove_fallthru_edge
(
bb
->
succs
);
/* If there is LHS, remove it. */
if
(
gimple_call_lhs
(
stmt
))
/* If there is an LHS, remove it. */
tree
lhs
=
gimple_call_lhs
(
stmt
);
if
(
lhs
)
{
tree
op
=
gimple_call_lhs
(
stmt
);
gimple_call_set_lhs
(
stmt
,
NULL_TREE
);
/* We need to remove SSA name to avoid checking errors.
All uses are dominated by the noreturn and thus will
be removed afterwards.
We proactively remove affected non-PHI statements to avoid
fixup_cfg from trying to update them and crashing. */
if
(
TREE_CODE
(
op
)
==
SSA_NAME
)
/* We need to fix up the SSA name to avoid checking errors. */
if
(
TREE_CODE
(
lhs
)
==
SSA_NAME
)
{
use_operand_p
use_p
;
imm_use_iterator
iter
;
gimple
use_stmt
;
bitmap_iterator
bi
;
unsigned
int
bb_index
;
bitmap
blocks
=
BITMAP_ALLOC
(
NULL
);
FOR_EACH_IMM_USE_STMT
(
use_stmt
,
iter
,
op
)
{
if
(
gimple_code
(
use_stmt
)
!=
GIMPLE_PHI
)
bitmap_set_bit
(
blocks
,
gimple_bb
(
use_stmt
)
->
index
);
else
FOR_EACH_IMM_USE_ON_STMT
(
use_p
,
iter
)
SET_USE
(
use_p
,
error_mark_node
);
}
EXECUTE_IF_SET_IN_BITMAP
(
blocks
,
0
,
bb_index
,
bi
)
delete_basic_block
(
BASIC_BLOCK_FOR_FN
(
cfun
,
bb_index
));
BITMAP_FREE
(
blocks
);
release_ssa_name
(
op
);
tree
new_var
=
create_tmp_reg
(
TREE_TYPE
(
lhs
),
NULL
);
SET_SSA_NAME_VAR_OR_IDENTIFIER
(
lhs
,
new_var
);
SSA_NAME_DEF_STMT
(
lhs
)
=
gimple_build_nop
();
set_ssa_default_def
(
cfun
,
new_var
,
lhs
);
}
update_stmt
(
stmt
);
changed
=
true
;
}
return
changed
;
return
remove_fallthru_edge
(
bb
->
succs
);
}
...
...
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