g95 sets DECL_COMMON on these variable decls (only for Darwin
targets). This seems like a hack to me (see below). The problem is
darwin-specific, not related to the front-end. On darwin:
$ cat a.c int x[9999999] = { 0 }; $ gcc -c a.c && ls -lh a.o -rw-r--
r-- 1 fx wheel 38M May 12 13:43 a.o $ size a.o __TEXT __DATA __OBJC
others dec hex 0 39999996 0 0 39999996 26259fc
while on x86_64-linux, I get:
$ cat a.c int x[9999999] = { 0 }; $ gcc -c a.c && ls -lh a.o -rw-r--
r-- 1 fx fx 959 May 12 13:44 a.o $ size a.o text data bss dec hex
filename 0 0 39999996 39999996 26259fc a.o
I'm CC'ing Andrew as he could give us a good idea of what needs to be
done.
Thanks,
FX
Index: trans-decl.c
===================================================================
--- trans-decl.c (revision 147744)
+++ trans-decl.c (working copy)
@@ -144,6 +144,8 @@ tree gfor_fndecl_convert_char4_to_char1;
tree gfor_fndecl_size0;
tree gfor_fndecl_size1;
tree gfor_fndecl_iargc;
+tree gfor_fndecl_clz128;
+tree gfor_fndecl_ctz128;
/* Intrinsic functions implemented in Fortran. */
tree gfor_fndecl_sc_kind;
@@ -524,6 +526,7 @@ gfc_finish_var_decl (tree decl, gfc_symb
/* This is the declaration of a module variable. */
TREE_PUBLIC (decl) = 1;
TREE_STATIC (decl) = 1;
+ DECL_COMMON (decl) = 1;
}
/* Derived types are a bit peculiar because of the possibility of