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
b8694195
Commit
b8694195
authored
25 years ago
by
Nick Clifton
Committed by
Nick Clifton
25 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tidy up assemble_variable()'s handling of uninitialised varaibles.
From-SVN: r29661
parent
74d3e96a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
121 additions
and
65 deletions
+121
-65
gcc/ChangeLog
+13
-0
gcc/varasm.c
+108
-65
No files found.
gcc/ChangeLog
View file @
b8694195
Sat
Sep
25
13
:
42
:
15
1999
Nick
Clifton
<
nickc
@cygnus
.
com
>
*
varasm
.
c
(
asm_emit_uninitialised
)
:
New
function
:
Generate
the
assembler
statements
necessary
to
declare
an
uninitialised
variable
.
(
ASM_EMIT_LOCAL
)
:
New
macro
:
Emit
a
local
,
uninitialised
variable
.
(
ASM_EMIT_BSS
)
:
New
macro
:
Emit
an
entry
in
the
bss
section
.
(
ASM_EMIT_COMMON
)
:
New
macro
:
Emit
an
entry
in
the
common
section
.
(
assemble_variable
)
:
Use
asm_emit_uninitialised
to
emit
an
uninitialised
variable
.
Fri
Sep
24
17
:
10
:
56
1999
Nick
Clifton
<
nickc
@cygnus
.
com
>
*
combine
.
c
(
simplify_comparison
)
:
Cope
with
downshifting
a
32
bit
...
...
This diff is collapsed.
Click to expand it.
gcc/varasm.c
View file @
b8694195
...
...
@@ -1197,6 +1197,112 @@ assemble_string (p, size)
}
#if defined ASM_OUTPUT_ALIGNED_DECL_LOCAL
#define ASM_EMIT_LOCAL(decl, name, size, rounded) \
ASM_OUTPUT_ALIGNED_DECL_LOCAL (asm_out_file, decl, name, size, DECL_ALIGN (decl))
#else
#if defined ASM_OUTPUT_ALIGNED_LOCAL
#define ASM_EMIT_LOCAL(decl, name, size, rounded) \
ASM_OUTPUT_ALIGNED_LOCAL (asm_out_file, name, size, DECL_ALIGN (decl))
#else
#define ASM_EMIT_LOCAL(decl, name, size, rounded) \
ASM_OUTPUT_LOCAL (asm_out_file, name, size, rounded)
#endif
#endif
#if defined ASM_OUTPUT_ALIGNED_BSS
#define ASM_EMIT_BSS(decl, name, size, rounded) \
ASM_OUTPUT_ALIGNED_BSS (asm_out_file, decl, name, size, DECL_ALIGN (decl))
#else
#if defined ASM_OUTPUT_BSS
#define ASM_EMIT_BSS(decl, name, size, rounded) \
ASM_OUTPUT_BSS (asm_out_file, decl, name, size, rounded)
#else
#undef ASM_EMIT_BSS
#endif
#endif
#if defined ASM_OUTPUT_ALIGNED_DECL_COMMON
#define ASM_EMIT_COMMON(decl, name, size, rounded) \
ASM_OUTPUT_ALIGNED_DECL_COMMON (asm_out_file, decl, name, size, DECL_ALIGN (decl))
#else
#if defined ASM_OUTPUT_ALIGNED_COMMON
#define ASM_EMIT_COMMON(decl, name, size, rounded) \
ASM_OUTPUT_ALIGNED_COMMON (asm_out_file, name, size, DECL_ALIGN (decl))
#else
#define ASM_EMIT_COMMON(decl, name, size, rounded) \
ASM_OUTPUT_COMMON (asm_out_file, name, size, rounded)
#endif
#endif
static
void
asm_emit_uninitialised
(
decl
,
name
,
size
,
rounded
)
tree
decl
;
char
*
name
;
int
size
;
int
rounded
;
{
enum
{
asm_dest_common
,
asm_dest_bss
,
asm_dest_local
}
destination
=
asm_dest_local
;
if
(
TREE_PUBLIC
(
decl
))
{
#if defined ASM_EMIT_BSS
if
(
!
DECL_COMMON
(
decl
))
destination
=
asm_dest_bss
;
else
#endif
destination
=
asm_dest_common
;
}
if
(
flag_shared_data
)
{
switch
(
destination
)
{
#ifdef ASM_OUTPUT_SHARED_BSS
case
asm_dest_bss
:
ASM_OUTPUT_SHARED_BSS
(
asm_out_file
,
decl
,
name
,
size
,
rounded
);
return
;
#endif
#ifdef ASM_OUTPUT_SHARED_COMMON
case
asm_dest_common
:
ASM_OUTPUT_SHARED_COMMON
(
asm_out_file
,
name
,
size
,
rounded
);
return
;
#endif
#ifdef ASM_OUTPUT_SHARED_LOCAL
case
asm_dest_local
:
ASM_OUTPUT_SHARED_LOCAL
(
asm_out_file
,
name
,
size
,
rounded
);
return
;
#endif
default
:
break
;
}
}
switch
(
destination
)
{
#ifdef ASM_EMIT_BSS
case
asm_dest_bss
:
ASM_EMIT_BSS
(
decl
,
name
,
size
,
rounded
);
break
;
#endif
case
asm_dest_common
:
ASM_EMIT_COMMON
(
decl
,
name
,
size
,
rounded
);
break
;
case
asm_dest_local
:
ASM_EMIT_LOCAL
(
decl
,
name
,
size
,
rounded
);
break
;
default
:
abort
();
}
return
;
}
/* Assemble everything that is needed for a variable or function declaration.
Not used for automatic variables, and not used for function definitions.
Should not be called for variables of incomplete structure type.
...
...
@@ -1386,7 +1492,7 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
if
((
DECL_INITIAL
(
decl
)
==
0
||
DECL_INITIAL
(
decl
)
==
error_mark_node
)
/* If the target can't output uninitialized but not common global data
in .bss, then we have to use .data. */
#if ! defined
(ASM_OUTPUT_BSS) && ! defined (ASM_OUTPUT_ALIGNED_BSS)
#if ! defined
ASM_EMIT_BSS
&&
DECL_COMMON
(
decl
)
#endif
&&
DECL_SECTION_NAME
(
decl
)
==
0
...
...
@@ -1436,71 +1542,8 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
if (flag_shared_data)
data_section ();
#endif
asm_emit_uninitialised
(
decl
,
name
,
size
,
rounded
);
if
(
TREE_PUBLIC
(
decl
)
#if defined (ASM_OUTPUT_BSS) || defined (ASM_OUTPUT_ALIGNED_BSS)
&&
DECL_COMMON
(
decl
)
#endif
)
{
#ifdef ASM_OUTPUT_SHARED_COMMON
if
(
flag_shared_data
)
ASM_OUTPUT_SHARED_COMMON
(
asm_out_file
,
name
,
size
,
rounded
);
else
#endif
{
#ifdef ASM_OUTPUT_ALIGNED_DECL_COMMON
ASM_OUTPUT_ALIGNED_DECL_COMMON
(
asm_out_file
,
decl
,
name
,
size
,
DECL_ALIGN
(
decl
));
#else
#ifdef ASM_OUTPUT_ALIGNED_COMMON
ASM_OUTPUT_ALIGNED_COMMON
(
asm_out_file
,
name
,
size
,
DECL_ALIGN
(
decl
));
#else
ASM_OUTPUT_COMMON
(
asm_out_file
,
name
,
size
,
rounded
);
#endif
#endif
}
}
#if defined (ASM_OUTPUT_BSS) || defined (ASM_OUTPUT_ALIGNED_BSS)
else
if
(
TREE_PUBLIC
(
decl
))
{
#ifdef ASM_OUTPUT_SHARED_BSS
if
(
flag_shared_data
)
ASM_OUTPUT_SHARED_BSS
(
asm_out_file
,
decl
,
name
,
size
,
rounded
);
else
#endif
{
#ifdef ASM_OUTPUT_ALIGNED_BSS
ASM_OUTPUT_ALIGNED_BSS
(
asm_out_file
,
decl
,
name
,
size
,
DECL_ALIGN
(
decl
));
#else
ASM_OUTPUT_BSS
(
asm_out_file
,
decl
,
name
,
size
,
rounded
);
#endif
}
}
#endif
/* ASM_OUTPUT_BSS || ASM_OUTPUT_ALIGNED_BSS */
else
{
#ifdef ASM_OUTPUT_SHARED_LOCAL
if
(
flag_shared_data
)
ASM_OUTPUT_SHARED_LOCAL
(
asm_out_file
,
name
,
size
,
rounded
);
else
#endif
{
#ifdef ASM_OUTPUT_ALIGNED_DECL_LOCAL
ASM_OUTPUT_ALIGNED_DECL_LOCAL
(
asm_out_file
,
decl
,
name
,
size
,
DECL_ALIGN
(
decl
));
#else
#ifdef ASM_OUTPUT_ALIGNED_LOCAL
ASM_OUTPUT_ALIGNED_LOCAL
(
asm_out_file
,
name
,
size
,
DECL_ALIGN
(
decl
));
#else
ASM_OUTPUT_LOCAL
(
asm_out_file
,
name
,
size
,
rounded
);
#endif
#endif
}
}
goto
finish
;
}
...
...
This diff is collapsed.
Click to expand it.
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