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
625f802c
Commit
625f802c
authored
Oct 08, 2009
by
Jan Hubicka
Committed by
Michael Meissner
Oct 08, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix 41626 from Jan Hubicka
From-SVN: r152569
parent
007a178c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
11 deletions
+26
-11
gcc/ChangeLog
+11
-0
gcc/cgraph.h
+1
-1
gcc/cgraphbuild.c
+11
-6
gcc/varasm.c
+1
-1
gcc/varpool.c
+2
-3
No files found.
gcc/ChangeLog
View file @
625f802c
2009
-
10
-
08
Jan
Hubicka
<
jh
@
suse
.
cz
>
PR
middle
-
end
/
41626
*
cgraphbuild
.
c
(
record_reference
):
When
parameter
DATA
is
NULL
,
do
not
mark
cgraph
nodes
as
needed
.
(
record_references_in_initializer
):
Add
new
only_vars
parameter
.
*
cgraph
.
h
(
record_references_in_initializer
):
New
parameter
.
*
varasm
.
c
(
assemble_variable
):
Update
call
.
*
varpool
.
c
(
varpool_analyze_pending_decls
):
Always
look
for
referenced
vars
.
2009
-
10
-
08
Anatoly
Sokolov
<
aesok
@
post
.
ru
>
*
config
/
avr
/
avr
.
c
(
last_insn_address
)
Remove
variable
.
gcc/cgraph.h
View file @
625f802c
...
...
@@ -459,7 +459,7 @@ struct cgraph_node *cgraph_function_versioning (struct cgraph_node *,
bitmap
);
void
tree_function_versioning
(
tree
,
tree
,
VEC
(
ipa_replace_map_p
,
gc
)
*
,
bool
,
bitmap
);
struct
cgraph_node
*
save_inline_function_body
(
struct
cgraph_node
*
);
void
record_references_in_initializer
(
tree
);
void
record_references_in_initializer
(
tree
,
bool
);
bool
cgraph_process_new_functions
(
void
);
bool
cgraph_decide_is_function_needed
(
struct
cgraph_node
*
,
tree
);
...
...
gcc/cgraphbuild.c
View file @
625f802c
...
...
@@ -33,13 +33,16 @@ along with GCC; see the file COPYING3. If not see
#include "tree-pass.h"
/* Walk tree and record all calls and references to functions/variables.
Called via walk_tree: TP is pointer to tree to be examined. */
Called via walk_tree: TP is pointer to tree to be examined.
When DATA is non-null, record references to callgraph.
*/
static
tree
record_reference
(
tree
*
tp
,
int
*
walk_subtrees
,
void
*
data
ATTRIBUTE_UNUSED
)
record_reference
(
tree
*
tp
,
int
*
walk_subtrees
,
void
*
data
)
{
tree
t
=
*
tp
;
tree
decl
;
bool
do_callgraph
=
data
!=
NULL
;
switch
(
TREE_CODE
(
t
))
{
...
...
@@ -57,7 +60,7 @@ record_reference (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
/* Record dereferences to the functions. This makes the
functions reachable unconditionally. */
decl
=
TREE_OPERAND
(
*
tp
,
0
);
if
(
TREE_CODE
(
decl
)
==
FUNCTION_DECL
)
if
(
TREE_CODE
(
decl
)
==
FUNCTION_DECL
&&
do_callgraph
)
cgraph_mark_address_taken_node
(
cgraph_node
(
decl
));
break
;
...
...
@@ -218,13 +221,15 @@ struct gimple_opt_pass pass_build_cgraph_edges =
};
/* Record references to functions and other variables present in the
initial value of DECL, a variable. */
initial value of DECL, a variable.
When ONLY_VARS is true, we mark needed only variables, not functions. */
void
record_references_in_initializer
(
tree
decl
)
record_references_in_initializer
(
tree
decl
,
bool
only_vars
)
{
struct
pointer_set_t
*
visited_nodes
=
pointer_set_create
();
walk_tree
(
&
DECL_INITIAL
(
decl
),
record_reference
,
NULL
,
visited_nodes
);
walk_tree
(
&
DECL_INITIAL
(
decl
),
record_reference
,
only_vars
?
NULL
:
decl
,
visited_nodes
);
pointer_set_destroy
(
visited_nodes
);
}
...
...
gcc/varasm.c
View file @
625f802c
...
...
@@ -2082,7 +2082,7 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED,
Without this, if the variable is placed in a
section-anchored block, the template will only be marked
when it's too late. */
record_references_in_initializer
(
to
);
record_references_in_initializer
(
to
,
false
);
}
decl
=
to
;
...
...
gcc/varpool.c
View file @
625f802c
...
...
@@ -364,10 +364,9 @@ varpool_analyze_pending_decls (void)
/* Compute the alignment early so function body expanders are
already informed about increased alignment. */
align_variable
(
decl
,
0
);
if
(
DECL_INITIAL
(
decl
))
record_references_in_initializer
(
decl
);
}
if
(
DECL_INITIAL
(
decl
))
record_references_in_initializer
(
decl
,
analyzed
);
changed
=
true
;
}
timevar_pop
(
TV_CGRAPH
);
...
...
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