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
2786cbad
Commit
2786cbad
authored
May 06, 1996
by
Jason Merrill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-fno-common change
From-SVN: r11940
parent
7b8b9722
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
15 deletions
+21
-15
gcc/c-common.c
+9
-1
gcc/c-decl.c
+6
-2
gcc/final.c
+1
-1
gcc/flags.h
+2
-1
gcc/toplev.c
+2
-1
gcc/varasm.c
+1
-9
No files found.
gcc/c-common.c
View file @
2786cbad
...
@@ -37,7 +37,7 @@ Boston, MA 02111-1307, USA. */
...
@@ -37,7 +37,7 @@ Boston, MA 02111-1307, USA. */
extern
struct
obstack
permanent_obstack
;
extern
struct
obstack
permanent_obstack
;
enum
attrs
{
A_PACKED
,
A_NOCOMMON
,
A_NORETURN
,
A_CONST
,
A_T_UNION
,
enum
attrs
{
A_PACKED
,
A_NOCOMMON
,
A_
COMMON
,
A_
NORETURN
,
A_CONST
,
A_T_UNION
,
A_CONSTRUCTOR
,
A_DESTRUCTOR
,
A_MODE
,
A_SECTION
,
A_ALIGNED
,
A_CONSTRUCTOR
,
A_DESTRUCTOR
,
A_MODE
,
A_SECTION
,
A_ALIGNED
,
A_UNUSED
,
A_FORMAT
,
A_WEAK
,
A_ALIAS
};
A_UNUSED
,
A_FORMAT
,
A_WEAK
,
A_ALIAS
};
...
@@ -263,6 +263,7 @@ init_attributes ()
...
@@ -263,6 +263,7 @@ init_attributes ()
{
{
add_attribute
(
A_PACKED
,
"packed"
,
0
,
0
,
0
);
add_attribute
(
A_PACKED
,
"packed"
,
0
,
0
,
0
);
add_attribute
(
A_NOCOMMON
,
"nocommon"
,
0
,
0
,
1
);
add_attribute
(
A_NOCOMMON
,
"nocommon"
,
0
,
0
,
1
);
add_attribute
(
A_COMMON
,
"common"
,
0
,
0
,
1
);
add_attribute
(
A_NORETURN
,
"noreturn"
,
0
,
0
,
1
);
add_attribute
(
A_NORETURN
,
"noreturn"
,
0
,
0
,
1
);
add_attribute
(
A_NORETURN
,
"volatile"
,
0
,
0
,
1
);
add_attribute
(
A_NORETURN
,
"volatile"
,
0
,
0
,
1
);
add_attribute
(
A_UNUSED
,
"unused"
,
0
,
0
,
1
);
add_attribute
(
A_UNUSED
,
"unused"
,
0
,
0
,
1
);
...
@@ -358,6 +359,13 @@ decl_attributes (node, attributes, prefix_attributes)
...
@@ -358,6 +359,13 @@ decl_attributes (node, attributes, prefix_attributes)
warning
(
"`%s' attribute ignored"
,
IDENTIFIER_POINTER
(
name
));
warning
(
"`%s' attribute ignored"
,
IDENTIFIER_POINTER
(
name
));
break
;
break
;
case
A_COMMON
:
if
(
TREE_CODE
(
decl
)
==
VAR_DECL
)
DECL_COMMON
(
decl
)
=
1
;
else
warning
(
"`%s' attribute ignored"
,
IDENTIFIER_POINTER
(
name
));
break
;
case
A_NORETURN
:
case
A_NORETURN
:
if
(
TREE_CODE
(
decl
)
==
FUNCTION_DECL
)
if
(
TREE_CODE
(
decl
)
==
FUNCTION_DECL
)
TREE_THIS_VOLATILE
(
decl
)
=
1
;
TREE_THIS_VOLATILE
(
decl
)
=
1
;
...
...
gcc/c-decl.c
View file @
2786cbad
...
@@ -3611,8 +3611,12 @@ start_decl (declarator, declspecs, initialized, attributes, prefix_attributes)
...
@@ -3611,8 +3611,12 @@ start_decl (declarator, declspecs, initialized, attributes, prefix_attributes)
if
(
TREE_CODE
(
decl
)
==
FUNCTION_DECL
)
if
(
TREE_CODE
(
decl
)
==
FUNCTION_DECL
)
gen_aux_info_record
(
decl
,
0
,
0
,
TYPE_ARG_TYPES
(
TREE_TYPE
(
decl
))
!=
0
);
gen_aux_info_record
(
decl
,
0
,
0
,
TYPE_ARG_TYPES
(
TREE_TYPE
(
decl
))
!=
0
);
/* For C and Objective-C, we by default put things in .common when
/* ANSI specifies that a tentative definition which is not merged with
possible. */
a non-tentative definition behaves exactly like a definition with an
initializer equal to zero. (Section 3.7.2)
-fno-common gives strict ANSI behavior. Usually you don't want it.
This matters only for variables with external linkage. */
if
(
!
flag_no_common
)
DECL_COMMON
(
decl
)
=
1
;
DECL_COMMON
(
decl
)
=
1
;
/* Set attributes here so if duplicate decl, will have proper attributes. */
/* Set attributes here so if duplicate decl, will have proper attributes. */
...
...
gcc/final.c
View file @
2786cbad
...
@@ -405,7 +405,7 @@ end_final (filename)
...
@@ -405,7 +405,7 @@ end_final (filename)
}
}
/* Make space for the table of counts. */
/* Make space for the table of counts. */
if
(
flag_no_common
||
size
==
0
)
if
(
size
==
0
)
{
{
/* Realign data section. */
/* Realign data section. */
ASM_OUTPUT_ALIGN
(
asm_out_file
,
align
);
ASM_OUTPUT_ALIGN
(
asm_out_file
,
align
);
...
...
gcc/flags.h
View file @
2786cbad
...
@@ -315,7 +315,8 @@ extern int flag_pedantic_errors;
...
@@ -315,7 +315,8 @@ extern int flag_pedantic_errors;
extern
int
flag_pic
;
extern
int
flag_pic
;
/* Nonzero means place uninitialized global data in the bss section. */
/* Nonzero means don't place uninitialized global data in common storage
by default. */
extern
int
flag_no_common
;
extern
int
flag_no_common
;
...
...
gcc/toplev.c
View file @
2786cbad
...
@@ -482,7 +482,8 @@ int flag_short_temps;
...
@@ -482,7 +482,8 @@ int flag_short_temps;
int
flag_pic
;
int
flag_pic
;
/* Nonzero means place uninitialized global data in the bss section. */
/* Nonzero means don't place uninitialized global data in common storage
by default. */
int
flag_no_common
;
int
flag_no_common
;
...
...
gcc/varasm.c
View file @
2786cbad
...
@@ -1229,18 +1229,11 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
...
@@ -1229,18 +1229,11 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
/* Handle uninitialized definitions. */
/* Handle uninitialized definitions. */
/* ANSI specifies that a tentative definition which is not merged with
a non-tentative definition behaves exactly like a definition with an
initializer equal to zero. (Section 3.7.2)
-fno-common gives strict ANSI behavior. Usually you don't want it.
This matters only for variables with external linkage. */
if
((
DECL_INITIAL
(
decl
)
==
0
||
DECL_INITIAL
(
decl
)
==
error_mark_node
)
if
((
DECL_INITIAL
(
decl
)
==
0
||
DECL_INITIAL
(
decl
)
==
error_mark_node
)
/* If the target can't output uninitialized but not common global data
/* If the target can't output uninitialized but not common global data
in .bss, then we have to use .data. */
in .bss, then we have to use .data. */
#if ! defined (ASM_OUTPUT_BSS) && ! defined (ASM_OUTPUT_ALIGNED_BSS)
#if ! defined (ASM_OUTPUT_BSS) && ! defined (ASM_OUTPUT_ALIGNED_BSS)
&&
(
!
flag_no_common
||
!
TREE_PUBLIC
(
decl
))
&&
(
DECL_COMMON
(
decl
)
||
!
TREE_PUBLIC
(
decl
))
&&
DECL_COMMON
(
decl
)
#endif
#endif
&&
!
dont_output_data
)
&&
!
dont_output_data
)
{
{
...
@@ -1286,7 +1279,6 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
...
@@ -1286,7 +1279,6 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
if
(
TREE_PUBLIC
(
decl
)
if
(
TREE_PUBLIC
(
decl
)
#if defined (ASM_OUTPUT_BSS) || defined (ASM_OUTPUT_ALIGNED_BSS)
#if defined (ASM_OUTPUT_BSS) || defined (ASM_OUTPUT_ALIGNED_BSS)
&&
DECL_COMMON
(
decl
)
&&
DECL_COMMON
(
decl
)
&&
!
flag_no_common
#endif
#endif
)
)
{
{
...
...
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