This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Mark va_start as nothrow
> On Wed, Apr 15, 2009 at 7:40 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> > On Mon, Apr 13, 2009 at 11:20 AM, Jan Hubicka <hubicka@ucw.cz> wrote:
> >> Hi,
> >> va_start/va_copy/va_end is not marked as nothrow that makes every
> >> function using variadic arguments to be believed throwing externally
> >> that degrade nothrow analysis we make.
> >>
> >> I think it is safe to mark them nothorw. ?With -fnon-call-exceptions
> >> they can theoretically be given bad pointer, but other similar
> >> functions that can ICE are already marked NOTHROW (such as sprintf).
> >> Or if this is not true, I can probably add ATTR_NONTRHOW_FOR_NCE_LIST
> >>
> >> Bootstrapped/regtested x86_64-linux, seems sane?
> >> Honza
> >>
> >> ? ? ? ?* builtins.def (va_copy, va_end, va_start): Mark as nothrow
> >
> > Gcc trunk is broken. I got
> >
> > ../../src-trunk/gcc/builtins.def: In function 'c_define_builtins':
> > ../../src-trunk/gcc/builtins.def:703: error: 'ATTR_NOTHROW_NULL'
> > undeclared (first use in this function)
> > ../../src-trunk/gcc/builtins.def:703: error: (Each undeclared
> > identifier is reported only once
> > ../../src-trunk/gcc/builtins.def:703: error: for each function it appears in.)
> >
> >
>
> It may have been fixed by revision 146117.
I've accidentally comitted wrong variant of patch. Should be fixed now.
Sorry for that.
Honza
>
> --
> H.J.