Re: make_decl_one_only and inlining

2013-02-18 Thread Johannes Pfau
Jan Hubicka ucw.cz> writes: > > > > How does the C++ frontend handle this? > > See logic in cgraph_function_body_availability. When function is weak (that is effect > of make_decl_one_only) it will be inlinable only if it is declared inline. This happens > to be the case of C++ weaks because o

Re: C/C++ Option to Initialize Variables?

2013-02-18 Thread Robert Dewar
Wrong. It specifies that objects with static storage duration that aren't explicitely initialized are initialized with null pointers, or zeros depending on type. 6.7.8.10. OK, that means that the comments of my last mesage don't apply to variables of this type. So they should at least option

Re: C/C++ Option to Initialize Variables?

2013-02-18 Thread Robert Dewar
Forgive me, but I don't see where anything is guaranteed to be zero'd before use. I'm likely wrong somewhere since you disagree. http://en.wikipedia.org/wiki/.bss This is about what happens to work, and specifically notes that it is not part of the C standard. There is a big difference betwe

Re: C/C++ Option to Initialize Variables?

2013-02-18 Thread Alexander Monakov
On Mon, 18 Feb 2013, Michael Matz wrote: > Automatic variables, as they are on the stack, are unlikely to usually get > the value 0 out of pure luck, so an option to initialize them to 0xDEADBEAF > doesn't make much sense. Hm, but the following comment from init-regs.c indicates that GCC will set

Re: C/C++ Option to Initialize Variables?

2013-02-18 Thread Michael Matz
Hi, On Mon, 18 Feb 2013, Jeffrey Walton wrote: > On Mon, Feb 18, 2013 at 10:34 AM, Andrew Haley wrote: > > On 02/18/2013 03:07 PM, Jeffrey Walton wrote: > >> On Mon, Feb 18, 2013 at 9:43 AM, Jonathan Wakely > >> wrote: > >>> On 18 February 2013 13:28, Jeffrey Walton wrote: > > > What if t

Re: C/C++ Option to Initialize Variables?

2013-02-18 Thread Uday Khedker
On Monday 18 February 2013 09:44 PM, Jeffrey Walton wrote: On Mon, Feb 18, 2013 at 10:34 AM, Andrew Haley wrote: On 02/18/2013 03:07 PM, Jeffrey Walton wrote: On Mon, Feb 18, 2013 at 9:43 AM, Jonathan Wakely wrote: On 18 February 2013 13:28, Jeffrey Walton wrote: What if the ".BSS" sect

Re: C/C++ Option to Initialize Variables?

2013-02-18 Thread Jeffrey Walton
On Mon, Feb 18, 2013 at 10:34 AM, Andrew Haley wrote: > On 02/18/2013 03:07 PM, Jeffrey Walton wrote: >> On Mon, Feb 18, 2013 at 9:43 AM, Jonathan Wakely >> wrote: >>> On 18 February 2013 13:28, Jeffrey Walton wrote: > What if the ".BSS" section was initialized to 0xFF rather than a pa

Re: C/C++ Option to Initialize Variables?

2013-02-18 Thread Andrew Haley
On 02/18/2013 03:07 PM, Jeffrey Walton wrote: > On Mon, Feb 18, 2013 at 9:43 AM, Jonathan Wakely > wrote: >> On 18 February 2013 13:28, Jeffrey Walton wrote: >>> What if the ".BSS" section was >>> initialized to 0xFF rather than a page full of NULLs? >> >> That could break millions of perfectly

Re: C/C++ Option to Initialize Variables?

2013-02-18 Thread Jeffrey Walton
On Mon, Feb 18, 2013 at 9:43 AM, Jonathan Wakely wrote: > On 18 February 2013 13:28, Jeffrey Walton wrote: >> The reason I went looking for the flag is someone asked about a crash >> on the OpenSSL mailing list. I knew it was due to an uninitialized >> field (but they did not realize the value was

Re: C/C++ Option to Initialize Variables?

2013-02-18 Thread Jonathan Wakely
On 18 February 2013 13:28, Jeffrey Walton wrote: > The reason I went looking for the flag is someone asked about a crash > on the OpenSSL mailing list. I knew it was due to an uninitialized > field (but they did not realize the value was not initialized). I > wanted to suggest a quick way to find w

Re: C/C++ Option to Initialize Variables?

2013-02-18 Thread Michael Veksler
On 02/18/2013 03:28 PM, Jeffrey Walton wrote: On Mon, Feb 18, 2013 at 7:42 AM, Michael Veksler wrote: On 02/18/2013 02:02 PM, Alec Teal wrote: On 18/02/13 11:40, Jeffrey Walton wrote: Hi All, http://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html#C-Dialect-Options Is there an option to i

Re: C/C++ Option to Initialize Variables?

2013-02-18 Thread Jeffrey Walton
On Mon, Feb 18, 2013 at 7:42 AM, Michael Veksler wrote: > On 02/18/2013 02:02 PM, Alec Teal wrote: >> >> On 18/02/13 11:40, Jeffrey Walton wrote: >>> >>> Hi All, >>> >>> >>> http://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html#C-Dialect-Options >>> >>> Is there an option to initialize variable

Re: gcc : c++11 : full support : eta?

2013-02-18 Thread Uday P. Khedker
Gerald Pfeifer wrote, On Monday 18 February 2013 02:17 AM: On Thu, 24 Jan 2013, Richard Biener wrote: There are technical details of the maintaining part - like would the material reside in SVN? Or in the CVS where we keep our webpages? Or somewhere else public (github?)? Would we want to ha

Re: C/C++ Option to Initialize Variables?

2013-02-18 Thread Michael Veksler
On 02/18/2013 02:02 PM, Alec Teal wrote: On 18/02/13 11:40, Jeffrey Walton wrote: Hi All, http://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html#C-Dialect-Options Is there an option to initialize variables to known values in a C/C++ program? My use case is 'debug' builds and finding us

Re: C/C++ Option to Initialize Variables?

2013-02-18 Thread Alec Teal
On 18/02/13 11:40, Jeffrey Walton wrote: Hi All, http://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html#C-Dialect-Options Is there an option to initialize variables to known values in a C/C++ program? My use case is 'debug' builds and finding use of uninitialized values that get lucky by bei

C/C++ Option to Initialize Variables?

2013-02-18 Thread Jeffrey Walton
Hi All, http://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html#C-Dialect-Options Is there an option to initialize variables to known values in a C/C++ program? My use case is 'debug' builds and finding use of uninitialized values that get lucky by being 0 most of the time. For example: void D