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
2aa3da06
Commit
2aa3da06
authored
Aug 26, 2013
by
Jan Hubicka
Committed by
Jan Hubicka
Aug 26, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* gimple-fold.c (gimple_get_virt_method_for_binfo): Use ctor_for_folding.
From-SVN: r202002
parent
0987ffe7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
5 deletions
+19
-5
gcc/ChangeLog
+4
-0
gcc/gimple-fold.c
+15
-5
No files found.
gcc/ChangeLog
View file @
2aa3da06
2013-08-26 Jan Hubicka <jh@suse.cz>
* gimple-fold.c (gimple_get_virt_method_for_binfo): Use ctor_for_folding.
2013-08-26 Jan Hubicka <jh@suse.cz>
* ipa.c (comdat_can_be_unshared_p_1): C++ constructors and destructors
can be unshared.
...
...
gcc/gimple-fold.c
View file @
2aa3da06
...
...
@@ -3097,7 +3097,7 @@ tree
gimple_get_virt_method_for_binfo
(
HOST_WIDE_INT
token
,
tree
known_binfo
)
{
unsigned
HOST_WIDE_INT
offset
,
size
;
tree
v
,
fn
,
vtable
;
tree
v
,
fn
,
vtable
,
init
;
vtable
=
v
=
BINFO_VTABLE
(
known_binfo
);
/* If there is no virtual methods table, leave the OBJ_TYPE_REF alone. */
...
...
@@ -3117,14 +3117,24 @@ gimple_get_virt_method_for_binfo (HOST_WIDE_INT token, tree known_binfo)
v
=
TREE_OPERAND
(
v
,
0
);
if
(
TREE_CODE
(
v
)
!=
VAR_DECL
||
!
DECL_VIRTUAL_P
(
v
)
||
!
DECL_INITIAL
(
v
)
||
DECL_INITIAL
(
v
)
==
error_mark_node
)
||
!
DECL_VIRTUAL_P
(
v
))
return
NULL_TREE
;
init
=
ctor_for_folding
(
v
);
/* The virtual tables should always be born with constructors.
and we always should assume that they are avaialble for
folding. At the moment we do not stream them in all cases,
but it should never happen that ctor seem unreachable. */
gcc_assert
(
init
);
if
(
init
==
error_mark_node
)
{
gcc_assert
(
in_lto_p
);
return
NULL_TREE
;
}
gcc_checking_assert
(
TREE_CODE
(
TREE_TYPE
(
v
))
==
ARRAY_TYPE
);
size
=
tree_low_cst
(
TYPE_SIZE
(
TREE_TYPE
(
TREE_TYPE
(
v
))),
1
);
offset
+=
token
*
size
;
fn
=
fold_ctor_reference
(
TREE_TYPE
(
TREE_TYPE
(
v
)),
DECL_INITIAL
(
v
)
,
fn
=
fold_ctor_reference
(
TREE_TYPE
(
TREE_TYPE
(
v
)),
init
,
offset
,
size
,
vtable
);
if
(
!
fn
||
integer_zerop
(
fn
))
return
NULL_TREE
;
...
...
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