OSDN Git Service

* cp-decl.c (flag_conserve_space): New language specific flag to
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 Dec 1993 00:15:21 +0000 (00:15 +0000)
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 Dec 1993 00:15:21 +0000 (00:15 +0000)
tell the compiler to use .common when possible.  Reduces the size of
.o files.
* cp-decl.c (duplicate_decls): Copy DECL_COMMON from the olddecl.
* cp-decl.c (start_decl): Set DECL_COMMON appropriately.
* cp-decl.c (finish_decl): Use flag_conserve_space, instead of
flag_no_common.
* cp-decl2.c (flag_conserve_space, lang_f_options): New flag.
* toplev.c (lang_options): New -fconserve-space flag.
* tree.h (DECL_COMMON): New flag.
* tree.h (tree_decl): New common_flag.
* varasm.c (assemble_variable): Use DECL_COMMON to help determine if
an object can be put in .common.
* c-decl.c (start_decl): Set DECL_COMMON to 1..

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@6244 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/c-decl.c
gcc/toplev.c
gcc/tree.h
gcc/varasm.c

index 7a18d44..bdfb7b4 100644 (file)
@@ -3333,6 +3333,10 @@ start_decl (declarator, declspecs, initialized)
      TEM may equal DECL or it may be a previous decl of the same name.  */
   tem = pushdecl (decl);
 
+  /* For C and Obective-C, we by default put things in .common when
+     possible.  */
+  DECL_COMMON (tem) = 1;
+
   /* For a local variable, define the RTL now.  */
   if (current_binding_level != global_binding_level
       /* But not if this is a duplicate decl
index 7acabf6..b60c624 100644 (file)
@@ -646,6 +646,10 @@ char *lang_options[] =
   "-fno-external-templates",
   "-fansi-overloading",
   "-fno-ansi-overloading",
+  "-fhuge-objects",
+  "-fno-huge-objects",
+  "-fconserve-space",
+  "-fno-conserve-space",
 
   "-Wreturn-type",
   "-Wno-return-type",
index 50b4d7e..a697f96 100644 (file)
@@ -832,6 +832,11 @@ struct tree_type
    because this decl is unused.  */
 #define DECL_IN_SYSTEM_HEADER(NODE) ((NODE)->decl.in_system_header_flag)
 
+/* Nonzero for a given ..._DECL node means that this node should be
+   put in .common, if possible.  If a DECL_INITIAL is given, and it
+   is not error_mark_node, then the decl cannot be put in .common.  */
+#define DECL_COMMON(NODE) ((NODE)->decl.common_flag)
+
 /* Language-specific decl information.  */
 #define DECL_LANG_SPECIFIC(NODE) ((NODE)->decl.lang_specific)
 
@@ -914,7 +919,8 @@ struct tree_decl
   unsigned abstract_flag : 1;
 
   unsigned in_system_header_flag : 1;
-  /* room for seven more */
+  unsigned common_flag : 1;
+  /* room for six more */
 
   unsigned lang_flag_0 : 1;
   unsigned lang_flag_1 : 1;
index 013be97..3dbc517 100644 (file)
@@ -979,6 +979,7 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
      -fno-common gives strict ANSI behavior.  Usually you don't want it.
      This matters only for variables with external linkage.  */
   if ((! flag_no_common || ! TREE_PUBLIC (decl))
+      && DECL_COMMON (decl)
       && ! dont_output_data
       && (DECL_INITIAL (decl) == 0 || DECL_INITIAL (decl) == error_mark_node))
     {