public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Delete bogus use of flag_zero_initialized_in_bss
@ 2010-03-16  8:58 Duncan Sands
  2010-03-16  9:06 ` Eric Botcazou
  0 siblings, 1 reply; 15+ messages in thread
From: Duncan Sands @ 2010-03-16  8:58 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 728 bytes --]

The Ada front-end seems to think that clearing flag_zero_initialized_in_bss
means that global variables without an explicit initializer will be considered
to be uninitialized rather than zero initialized by the rest of the compiler.
But that is not the effect of this flag at all.  Rather than specifying whether
the global will be zero initialized or not, it specifies by what method it will
be zero initialized: whether by placing in the BSS section or by outputting an
explicit block of zeros.

I can understand that the Ada front-end would like a way of telling the
optimizers that globals in Ada are not automatically zero initialized -
in theory it would open up some optimization opportunities.  But this is
not the way.

[-- Attachment #2: bss.diff --]
[-- Type: text/x-diff, Size: 949 bytes --]

Index: mainline/gcc/ada/gcc-interface/misc.c
===================================================================
--- mainline.orig/gcc/ada/gcc-interface/misc.c	2010-03-15 21:51:40.607571847 +0100
+++ mainline/gcc/ada/gcc-interface/misc.c	2010-03-15 21:51:52.950077996 +0100
@@ -294,9 +294,6 @@
   save_argc = argc;
   save_argv = argv;
 
-  /* Uninitialized really means uninitialized in Ada.  */
-  flag_zero_initialized_in_bss = 0;
-
   return CL_Ada;
 }
 
Index: mainline/gcc/ChangeLog
===================================================================
--- mainline.orig/gcc/ChangeLog	2010-03-16 08:51:27.540175865 +0100
+++ mainline/gcc/ChangeLog	2010-03-16 09:06:11.920238870 +0100
@@ -1,3 +1,8 @@
+2010-03-16  Duncan Sands  <baldrick@free.fr>
+
+	* ada/gcc-interface/misc.c (gnat_init_options): Do not unconditionally
+        clear flag_zero_initialized_in_bss.
+
 2010-03-15  Martin Jambor  <mjambor@suse.cz>
 
 	PR tree/optimization/43141

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2010-04-15 17:13 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-16  8:58 [Ada] Delete bogus use of flag_zero_initialized_in_bss Duncan Sands
2010-03-16  9:06 ` Eric Botcazou
2010-03-16  9:21   ` Duncan Sands
2010-03-16  9:34     ` Arnaud Charlet
2010-03-16  9:37       ` Duncan Sands
2010-03-16 10:20         ` Arnaud Charlet
2010-03-16 16:08     ` Eric Botcazou
2010-03-16 17:00       ` Duncan Sands
2010-03-16 22:26         ` Eric Botcazou
2010-03-18 14:06           ` Duncan Sands
2010-03-18 15:26             ` Eric Botcazou
2010-04-15 13:10               ` Florian Weimer
2010-04-15 16:59                 ` Eric Botcazou
2010-04-15 17:13                   ` Florian Weimer
2010-04-15 17:40                     ` Eric Botcazou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).