nonnull, -Wnonnull, and do/while

2016-02-16 Thread Stefan Sobernig
Hi We have a number of do/while loops with NULL checks in their exit conditions: #include static void f(const char *s) __attribute__((nonnull(1))); int main(void) { const char *p = "X"; f(p); } static void f(const char *s) { do { printf("%s\n",s); s = NULL; } while (s != NULL)

Re: nonnull, -Wnonnull, and do/while

2016-02-16 Thread Marek Polacek
On Tue, Feb 16, 2016 at 10:43:08AM +0100, Stefan Sobernig wrote: > Under a recent gcc 6 [*], we run into -Wnonnull warnings using the > nonnull attribute: Yes, this warning has been enhanced for GCC 6. > test.c: In function 'f': > test.c:16:14: warning: nonnull argument 's' compared to NULL [-Wn

Re: nonnull, -Wnonnull, and do/while

2016-02-16 Thread Jakub Jelinek
On Tue, Feb 16, 2016 at 11:04:38AM +0100, Marek Polacek wrote: > On Tue, Feb 16, 2016 at 10:43:08AM +0100, Stefan Sobernig wrote: > > Under a recent gcc 6 [*], we run into -Wnonnull warnings using the > > nonnull attribute: > > Yes, this warning has been enhanced for GCC 6. > > > test.c: In func

Re: nonnull, -Wnonnull, and do/while

2016-02-16 Thread Alexander Monakov
On Tue, 16 Feb 2016, Marek Polacek wrote: > Well, it's just that "s" has the nonnull attribute so the compiler thinks it > should never be null in which case comparing it to null should be redundant. > Doesn't seem like a false positive to me, but maybe someone else feels > otherwise. Please look

Re: nonnull, -Wnonnull, and do/while

2016-02-16 Thread Marek Polacek
On Tue, Feb 16, 2016 at 11:11:21AM +0100, Jakub Jelinek wrote: > On Tue, Feb 16, 2016 at 11:04:38AM +0100, Marek Polacek wrote: > > On Tue, Feb 16, 2016 at 10:43:08AM +0100, Stefan Sobernig wrote: > > > Under a recent gcc 6 [*], we run into -Wnonnull warnings using the > > > nonnull attribute: > >

Re: gnu-gabi group

2016-02-16 Thread Szabolcs Nagy
On 15/02/16 17:36, Mike Frysinger wrote: > On 15 Feb 2016 16:18, Szabolcs Nagy wrote: >> you as a group admin can do that, others cannot join >> without creating a account at google (which requires >> the acceptance of the google tos etc). > > that is annoying i didn't know about list+subscr...@g

Re: gengtype: conditional GTY ? (to add before GCC 6 release)

2016-02-16 Thread Mikhail Maltsev
On 02/15/2016 06:34 PM, Michael Matz wrote: > Hi, > > On Fri, 12 Feb 2016, Richard Biener wrote: > >>> What do you think about refactoring iterators in GCC 7? >> >> I think refactoring towards STL style iterators would be welcome. It >> may be different for the actual instances though. > > Oh

Placement new versus flifetime-dse

2016-02-16 Thread Andrew Haley
I'm fixing a bug which involves initialization of a field of an object in its placement new function before the constructor is called. This is falling foul of DSE, which deletes the field initialization. I see this: @item -fno-lifetime-dse @opindex fno-lifetime-dse In C++ the value of an o

Re: Placement new versus flifetime-dse

2016-02-16 Thread Jakub Jelinek
On Tue, Feb 16, 2016 at 01:04:06PM +, Andrew Haley wrote: > I'm fixing a bug which involves initialization of a field of an object > in its placement new function before the constructor is called. This > is falling foul of DSE, which deletes the field initialization. > > I see this: > > @i

Re: Placement new versus flifetime-dse

2016-02-16 Thread Andrew Haley
On 02/16/2016 01:16 PM, Jakub Jelinek wrote: >> > Can someone please tell me Chapter and Verse in the standard, please? >> > Then I can close this one. > I'd think [basic.life] describes this. For the record, I found it in C++98 [class.cdtor]: For an object of non-POD class type ... before the

Re: Need some help regarding bug Bug 38612

2016-02-16 Thread David Malcolm
On Tue, 2016-02-16 at 12:25 +0530, Prasad Ghangal wrote: > Hi ! > I am trying to fix bug 38612 > (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38612). > As mentioned in comment 4, I am changing warning message in > typeck2.c. TREE_TYPE(datum) gives type as 'X', but I want 'X*' I believe you want

Re: gengtype: conditional GTY ? (to add before GCC 6 release)

2016-02-16 Thread Michael Matz
Hi, On Tue, 16 Feb 2016, Mikhail Maltsev wrote: > > If anything, implement and use a range idiom like in D. > > > Could you please elaborate on that? Motivation: http://accu.org/content/conf2009/AndreiAlexandrescu_iterators-must-go.pdf Detailed intro of the concept: http://www.informit.com/a

Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct

2016-02-16 Thread H.J. Lu
On Fri, Feb 12, 2016 at 11:39 AM, H.J. Lu wrote: > On Fri, Feb 12, 2016 at 6:58 AM, Matthijs van Duin > wrote: >> On 11 February 2016 at 16:31, H.J. Lu wrote: >>> struct A { >>> static void foo (void) (); >>> static int xxx; >>> }; >> >> What about it? It's an empty struct. (And it declares a f

Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct

2016-02-16 Thread Richard Smith
On Tue, Feb 16, 2016 at 10:24 AM, H.J. Lu wrote: > > On Fri, Feb 12, 2016 at 11:39 AM, H.J. Lu wrote: > > On Fri, Feb 12, 2016 at 6:58 AM, Matthijs van Duin > > wrote: > >> On 11 February 2016 at 16:31, H.J. Lu wrote: > >>> struct A { > >>> static void foo (void) (); > >>> static int xxx; > >>>

Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct

2016-02-16 Thread H.J. Lu
On Tue, Feb 16, 2016 at 12:22 PM, Richard Smith wrote: > On Tue, Feb 16, 2016 at 10:24 AM, H.J. Lu wrote: >> >> On Fri, Feb 12, 2016 at 11:39 AM, H.J. Lu wrote: >> > On Fri, Feb 12, 2016 at 6:58 AM, Matthijs van Duin >> > wrote: >> >> On 11 February 2016 at 16:31, H.J. Lu wrote: >> >>> struct

Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct

2016-02-16 Thread Richard Smith
On Tue, Feb 16, 2016 at 12:25 PM, H.J. Lu wrote: > On Tue, Feb 16, 2016 at 12:22 PM, Richard Smith wrote: >> On Tue, Feb 16, 2016 at 10:24 AM, H.J. Lu wrote: >>> >>> On Fri, Feb 12, 2016 at 11:39 AM, H.J. Lu wrote: >>> > On Fri, Feb 12, 2016 at 6:58 AM, Matthijs van Duin >>> > wrote: >>> >> On

Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct

2016-02-16 Thread H.J. Lu
On Tue, Feb 16, 2016 at 1:02 PM, Richard Smith wrote: > On Tue, Feb 16, 2016 at 12:25 PM, H.J. Lu wrote: >> On Tue, Feb 16, 2016 at 12:22 PM, Richard Smith >> wrote: >>> On Tue, Feb 16, 2016 at 10:24 AM, H.J. Lu wrote: On Fri, Feb 12, 2016 at 11:39 AM, H.J. Lu wrote: > On Fri,

Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct

2016-02-16 Thread Richard Smith
On Tue, Feb 16, 2016 at 1:10 PM, H.J. Lu wrote: > On Tue, Feb 16, 2016 at 1:02 PM, Richard Smith wrote: >> On Tue, Feb 16, 2016 at 12:25 PM, H.J. Lu wrote: >>> On Tue, Feb 16, 2016 at 12:22 PM, Richard Smith >>> wrote: On Tue, Feb 16, 2016 at 10:24 AM, H.J. Lu wrote: > > On Fri,

Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct

2016-02-16 Thread H.J. Lu
On Tue, Feb 16, 2016 at 1:15 PM, Richard Smith wrote: > On Tue, Feb 16, 2016 at 1:10 PM, H.J. Lu wrote: >> On Tue, Feb 16, 2016 at 1:02 PM, Richard Smith wrote: >>> On Tue, Feb 16, 2016 at 12:25 PM, H.J. Lu wrote: On Tue, Feb 16, 2016 at 12:22 PM, Richard Smith wrote: > On Tue,

Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct

2016-02-16 Thread Richard Smith
On Tue, Feb 16, 2016 at 1:21 PM, H.J. Lu wrote: > On Tue, Feb 16, 2016 at 1:15 PM, Richard Smith wrote: >> On Tue, Feb 16, 2016 at 1:10 PM, H.J. Lu wrote: >>> On Tue, Feb 16, 2016 at 1:02 PM, Richard Smith >>> wrote: On Tue, Feb 16, 2016 at 12:25 PM, H.J. Lu wrote: > On Tue, Feb 16,

Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct

2016-02-16 Thread H.J. Lu
On Tue, Feb 16, 2016 at 1:45 PM, Richard Smith wrote: > On Tue, Feb 16, 2016 at 1:21 PM, H.J. Lu wrote: >> On Tue, Feb 16, 2016 at 1:15 PM, Richard Smith wrote: >>> On Tue, Feb 16, 2016 at 1:10 PM, H.J. Lu wrote: On Tue, Feb 16, 2016 at 1:02 PM, Richard Smith wrote: > On Tue, Fe

gcc-5-20160216 is now available

2016-02-16 Thread gccadmin
Snapshot gcc-5-20160216 is now available on ftp://gcc.gnu.org/pub/gcc/snapshots/5-20160216/ and on various mirrors, see http://gcc.gnu.org/mirrors.html for details. This snapshot has been generated from the GCC 5 SVN branch with the following options: svn://gcc.gnu.org/svn/gcc/branches/gcc-5

Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct

2016-02-16 Thread Richard Smith
On Tue, Feb 16, 2016 at 1:48 PM, H.J. Lu wrote: > On Tue, Feb 16, 2016 at 1:45 PM, Richard Smith wrote: >> On Tue, Feb 16, 2016 at 1:21 PM, H.J. Lu wrote: >>> On Tue, Feb 16, 2016 at 1:15 PM, Richard Smith >>> wrote: On Tue, Feb 16, 2016 at 1:10 PM, H.J. Lu wrote: > On Tue, Feb 16, 2

Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct

2016-02-16 Thread H.J. Lu
On Tue, Feb 16, 2016 at 3:36 PM, Richard Smith wrote: > On Tue, Feb 16, 2016 at 1:48 PM, H.J. Lu wrote: >> On Tue, Feb 16, 2016 at 1:45 PM, Richard Smith wrote: >>> On Tue, Feb 16, 2016 at 1:21 PM, H.J. Lu wrote: On Tue, Feb 16, 2016 at 1:15 PM, Richard Smith wrote: > On Tue, Fe