[Bug middle-end/36166] Use of the 'nonnull' attribute breaks code

2008-06-10 Thread pgut001 at cs dot auckland dot ac dot nz
--- Comment #10 from pgut001 at cs dot auckland dot ac dot nz 2008-06-11 03:47 --- >13. Unlike for C9X, the consensus at the London meeting was that there should >be no invention, without exception. Only those features that have a history >and are in common use by a commercial implement

[Bug middle-end/36166] Use of the 'nonnull' attribute breaks code

2008-06-10 Thread joseph at codesourcery dot com
--- Comment #9 from joseph at codesourcery dot com 2008-06-10 11:53 --- Subject: Re: Use of the 'nonnull' attribute breaks code On Tue, 10 Jun 2008, pgut001 at cs dot auckland dot ac dot nz wrote: > fully correct code suddenly breaks. In fact gcc seems to be doing the > opposite >

[Bug middle-end/36166] Use of the 'nonnull' attribute breaks code

2008-06-10 Thread rguenth at gcc dot gnu dot org
--- Comment #8 from rguenth at gcc dot gnu dot org 2008-06-10 09:56 --- This works as designed (and documented). Whether the design is the best possible one is another question. -- rguenth at gcc dot gnu dot org changed: What|Removed |Added --

[Bug middle-end/36166] Use of the 'nonnull' attribute breaks code

2008-06-10 Thread pgut001 at cs dot auckland dot ac dot nz
--- Comment #7 from pgut001 at cs dot auckland dot ac dot nz 2008-06-10 09:27 --- >The developer of the API says that it must be non-NULL so when the developer >of the API then tests for NULLness he is either being stupid or really just >thinking that the user will not use it correctly

[Bug middle-end/36166] Use of the 'nonnull' attribute breaks code

2008-06-10 Thread pinskia at gcc dot gnu dot org
--- Comment #6 from pinskia at gcc dot gnu dot org 2008-06-10 09:19 --- >gcc doesn't just use it for that, it applies two often mutually exclusive >interpretations to the same > attribute. They are no mutually exclusive at all. Think of it is this way. The developer of the API says t

[Bug middle-end/36166] Use of the 'nonnull' attribute breaks code

2008-06-10 Thread pgut001 at cs dot auckland dot ac dot nz
--- Comment #5 from pgut001 at cs dot auckland dot ac dot nz 2008-06-10 09:15 --- >Think printf with %s where it is supplied with a NULL argument or puts >with a NULL argument. Sure, I understand how that part of it works, but gcc doesn't just use it for that, it applies two often mut

[Bug middle-end/36166] Use of the 'nonnull' attribute breaks code

2008-06-10 Thread pinskia at gcc dot gnu dot org
--- Comment #4 from pinskia at gcc dot gnu dot org 2008-06-10 09:07 --- The GCC attribute is an extension. What it is about is saying if it is NULL then the program/function will crash and is not expecting a NULL argument. So if you mark a function argument as non NULL, then the optimi

[Bug middle-end/36166] Use of the 'nonnull' attribute breaks code

2008-06-10 Thread pgut001 at cs dot auckland dot ac dot nz
--- Comment #3 from pgut001 at cs dot auckland dot ac dot nz 2008-06-10 09:02 --- It's more than just a documentation bug, two different portions of gcc are interpreting this attribute in completely different ways, and the interaction between the two breaks otherwise perfectly valid cod

[Bug middle-end/36166] Use of the 'nonnull' attribute breaks code

2008-06-10 Thread pinskia at gcc dot gnu dot org
--- Comment #2 from pinskia at gcc dot gnu dot org 2008-06-10 08:25 --- No this is not a non documentation bug as non-null attribute says that the argument has to be non null to work correctly. So if you pass a NULL argument to the function, it will crash. So optimizing out the check fo