https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84229

--- Comment #10 from rguenther at suse dot de <rguenther at suse dot de> ---
On Mon, 26 Feb 2018, hubicka at ucw dot cz wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84229
> 
> --- Comment #9 from Jan Hubicka <hubicka at ucw dot cz> ---
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84229
> > 
> > --- Comment #8 from rguenther at suse dot de <rguenther at suse dot de> ---
> > On Mon, 26 Feb 2018, hubicka at gcc dot gnu.org wrote:
> > 
> > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84229
> > > 
> > > --- Comment #7 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
> > > I am not sure it is really fixed.  We no longer ICE, howeverw we need
> > > backporting to release branches and also I think we miss fortification 
> > > whenever
> > > we fail to inline (that is with -Os). I have some patches to inline more 
> > > of
> > > these fortify wrappers, but still not all of them.
> > 
> > The fortify wrappers are all extern inline __attribute__((gnu_inline)).
> > The glibc ones, that is.
> 
> Well, the bug did reproduce for me on firefox build where we did not early
> inline fortify wrapper for open and later we tried to be smart to clone it
> for common parameters.

I thought we now force all always-inline inlining to happen during
early inlining?  So I wonder how this happened...

For me open is (with -D_FORTIFY_SOURCE=2)

extern __inline __attribute__ ((__always_inline__)) __attribute__ 
((__gnu_inline__)) __attribute__ ((__artificial__)) int
open (const char *__path, int __oflag, ...)
{
  if (__builtin_va_arg_pack_len () > 1)
    __open_too_many_args ();

  if (__builtin_constant_p (__oflag))
    {
      if ((((__oflag) & 0100) != 0 || ((__oflag) & (020000000 | 0200000)) 
== (020000000 | 0200000)) && __builtin_va_arg_pack_len () < 1)
 {
   __open_missing_mode ();
   return __open_2 (__path, __oflag);
 }
      return __open_alias (__path, __oflag, __builtin_va_arg_pack ());
    }

  if (__builtin_va_arg_pack_len () < 1)
    return __open_2 (__path, __oflag);

  return __open_alias (__path, __oflag, __builtin_va_arg_pack ());
}

but of course also declared before that as

extern int open (const char *__file, int __oflag, ...) __attribute__ 
((__nonnull__ (1)));

so I wonder how the firefox issue manifests itself exactly...

Reply via email to