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
07aeab22
Commit
07aeab22
authored
Mar 18, 1994
by
Jim Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(assemble_variable): Likewise.
From-SVN: r6819
parent
bdfd4e31
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
gcc/varasm.c
+17
-0
No files found.
gcc/varasm.c
View file @
07aeab22
...
...
@@ -1142,11 +1142,22 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
named_section
(
TREE_STRING_POINTER
(
DECL_SECTION_NAME
(
decl
)));
else
{
/* C++ can have const variables that get initialized from constructors,
and thus can not be in a readonly section. We prevent this by
verifying that the initial value is constant for objects put in a
readonly section.
error_mark_node is used by the C front end to indicate that the
initializer has not been seen yet. In this case, we assume that
the initializer must be constant. */
#ifdef SELECT_SECTION
SELECT_SECTION
(
decl
,
reloc
);
#else
if
(
TREE_READONLY
(
decl
)
&&
!
TREE_THIS_VOLATILE
(
decl
)
&&
DECL_INITIAL
(
decl
)
&&
(
DECL_INITIAL
(
decl
)
==
error_mark_node
||
TREE_CONSTANT
(
DECL_INITIAL
(
decl
)))
&&
!
(
flag_pic
&&
reloc
))
readonly_data_section
();
else
...
...
@@ -1194,6 +1205,9 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
#else
if
(
TREE_READONLY
(
decl
)
&&
!
TREE_THIS_VOLATILE
(
decl
)
&&
DECL_INITIAL
(
decl
)
&&
(
DECL_INITIAL
(
decl
)
==
error_mark_node
||
TREE_CONSTANT
(
DECL_INITIAL
(
decl
)))
&&
!
(
flag_pic
&&
reloc
))
readonly_data_section
();
else
...
...
@@ -1289,6 +1303,9 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
#else
if
(
TREE_READONLY
(
decl
)
&&
!
TREE_THIS_VOLATILE
(
decl
)
&&
DECL_INITIAL
(
decl
)
&&
(
DECL_INITIAL
(
decl
)
==
error_mark_node
||
TREE_CONSTANT
(
DECL_INITIAL
(
decl
)))
&&
!
(
flag_pic
&&
reloc
))
readonly_data_section
();
else
...
...
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