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
746077ff
Commit
746077ff
authored
Oct 02, 2005
by
Richard Henderson
Committed by
Richard Henderson
Oct 02, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* tree-stdarg.c (execute_optimize_stdarg): Process PHI nodes too.
From-SVN: r104865
parent
e3fe057d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
0 deletions
+49
-0
gcc/ChangeLog
+4
-0
gcc/tree-stdarg.c
+45
-0
No files found.
gcc/ChangeLog
View file @
746077ff
2005
-
10
-
01
Richard
Henderson
<
rth
@redhat
.
com
>
*
tree
-
stdarg
.
c
(
execute_optimize_stdarg
)
:
Process
PHI
nodes
too
.
2005
-
10
-
01
Mark
Mitchell
<
mark
@codesourcery
.
com
>
2005
-
10
-
01
Mark
Mitchell
<
mark
@codesourcery
.
com
>
*
config
/
arm
/
unknown
-
elf
.
h
(
LINK_GCC_C_SEQUENCE_SPEC
)
:
Define
*
config
/
arm
/
unknown
-
elf
.
h
(
LINK_GCC_C_SEQUENCE_SPEC
)
:
Define
...
...
gcc/tree-stdarg.c
View file @
746077ff
...
@@ -624,6 +624,7 @@ execute_optimize_stdarg (void)
...
@@ -624,6 +624,7 @@ execute_optimize_stdarg (void)
va_list_simple_ptr
=
POINTER_TYPE_P
(
va_list_type_node
)
va_list_simple_ptr
=
POINTER_TYPE_P
(
va_list_type_node
)
&&
(
TREE_TYPE
(
va_list_type_node
)
==
void_type_node
&&
(
TREE_TYPE
(
va_list_type_node
)
==
void_type_node
||
TREE_TYPE
(
va_list_type_node
)
==
char_type_node
);
||
TREE_TYPE
(
va_list_type_node
)
==
char_type_node
);
gcc_assert
(
is_gimple_reg_type
(
va_list_type_node
)
==
va_list_simple_ptr
);
FOR_EACH_BB
(
bb
)
FOR_EACH_BB
(
bb
)
{
{
...
@@ -742,6 +743,50 @@ execute_optimize_stdarg (void)
...
@@ -742,6 +743,50 @@ execute_optimize_stdarg (void)
si
.
compute_sizes
=
-
1
;
si
.
compute_sizes
=
-
1
;
si
.
bb
=
bb
;
si
.
bb
=
bb
;
/* For va_list_simple_ptr, we have to check PHI nodes too. We treat
them as assignments for the purpose of escape analysis. This is
not needed for non-simple va_list because virtual phis don't perform
any real data movement. */
if
(
va_list_simple_ptr
)
{
tree
phi
,
lhs
,
rhs
;
use_operand_p
uop
;
ssa_op_iter
soi
;
for
(
phi
=
phi_nodes
(
bb
);
phi
;
phi
=
PHI_CHAIN
(
phi
))
{
lhs
=
PHI_RESULT
(
phi
);
if
(
!
is_gimple_reg
(
lhs
))
continue
;
FOR_EACH_PHI_ARG
(
uop
,
phi
,
soi
,
SSA_OP_USE
)
{
rhs
=
USE_FROM_PTR
(
uop
);
if
(
va_list_ptr_read
(
&
si
,
rhs
,
lhs
))
continue
;
else
if
(
va_list_ptr_write
(
&
si
,
lhs
,
rhs
))
continue
;
else
check_va_list_escapes
(
&
si
,
lhs
,
rhs
);
if
(
si
.
va_list_escapes
||
walk_tree
(
&
phi
,
find_va_list_reference
,
si
.
va_list_vars
,
NULL
))
{
if
(
dump_file
&&
(
dump_flags
&
TDF_DETAILS
))
{
fputs
(
"va_list escapes in "
,
dump_file
);
print_generic_expr
(
dump_file
,
phi
,
dump_flags
);
fputc
(
'\n'
,
dump_file
);
}
va_list_escapes
=
true
;
}
}
}
}
for
(
i
=
bsi_start
(
bb
);
for
(
i
=
bsi_start
(
bb
);
!
bsi_end_p
(
i
)
&&
!
va_list_escapes
;
!
bsi_end_p
(
i
)
&&
!
va_list_escapes
;
bsi_next
(
&
i
))
bsi_next
(
&
i
))
...
...
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