Status of GCC 6 on x86_64 (Debian)

2016-01-21 Thread Martin Michlmayr
Matthias Klose did an archive rebuild of Ubuntu with GCC 6 recently [1].
He wanted to file bugs in Debian and so I offered to do a build of
Debian unstable.  This was done with GCC 6 20160117 as packaged for
Debian by Matthias.  I built 11,500 Debian packages.

I ran into the following compiler errors:

* ICE in fold_convert_loc, at fold-const.c:2366 (PR69379): new, fix
  available

* ICE in dwarf2out_finish, at dwarf2out.c:27175 (PR69393): new, outstanding

* ICE in get_initial_def_for_reduction, at tree-vect-loop.c:4196
  (PR69166): reported by Matthias, outstanding

* ICE in assign_temp, at function.c:961 (PR69241): known, outstanding

* Wrong code generation at -O2 and higher (PR69320): known, fixed

Afterwards, I took all packages that compiled successfully with GCC 6
and compiled them with dpkg-buildflags set to -O3 (note that not every
package uses flags from dpkg-buildflags but many do).  I ran into the
following compiler errors:

* ICE in vect_get_vec_def_for_operand, at tree-vect-stmts.c:1379 (PR69328):
  known, fixed

* ICE in rewrite_use_nonlinear_expr, at tree-ssa-loop-ivopts.c:7086
  (PR68021): known, outstanding

* ICE in maybe_legitimize_operand, at optabs.c:6888 (PR69421): new,
  outstanding

This was done on x86_64.  I'd also like to do an archive build on arm64.

I'm impressed by the speed the GCC developers have been looking at these
bugs!

In terms of build failures, I reported 520 bugs to Debian.  Most of them
were new GCC errors or warnings (some packages use -Werror and many
-Werror=format-security).

Here are some of the most frequent errors see:

* 77: error: narrowing conversion of '128' from 'int' to 'char' inside { } 
[-Wnarrowing]
* 73: error: no match for or error: no matching function for call to
* 65:
  error: cannot convert 'bool' to '...' in return
  error: cannot convert 'std::basic_istream' to 'bool' in initialization
  error: could not convert 'false' from 'bool' to '...'
* 36: error: statement is indented as if it were guarded by... 
[-Werror=misleading-indentation]
* 16: error: 'xxx' defined but not used [-Werror=unused-const-variable]
* 16: error: reference to '...' is ambiguous
* 13: test suite failures (segfaults and similar); not clear if the
  package or if GCC is at fault.
* 12: error: enumerator value for '...' is not an integer constant expression 
[-Wpedantic]
* 12: error: call of overloaded ... is ambiguous
* 9: 'xxx' needed for in-class initialization of static data member
* 9: error: '...' was not declared in this scope
* 8: error: unknown type name
* 8: error: unable to find string literal operator
* 8: cmake failure (cmake configure scripts fail)
* 6: error: macro "..." passed 2 arguments, but takes just 1
* 3: error: invalid suffix on literal; C++11 requires a space between literal 
and string macro [-Werror=literal-suffix]
* 3: error: template argument X is invalid

[1] https://gcc.gnu.org/ml/gcc/2016-01/msg00101.html

-- 
Martin Michlmayr
Linux for HPE Helion, Hewlett Packard Enterprise


Re: Status of GCC 6 on x86_64 (Debian)

2016-01-21 Thread Matthias Klose

On 22.01.2016 06:09, Martin Michlmayr wrote:

In terms of build failures, I reported 520 bugs to Debian.  Most of them
were new GCC errors or warnings (some packages use -Werror and many
-Werror=format-security).

Here are some of the most frequent errors see:


[...]
Martin tagged these issues; https://wiki.debian.org/GCC6 has links with these 
bug searches.




Re: Status of GCC 6 on x86_64 (Debian)

2016-01-22 Thread Martin Michlmayr
* Martin Michlmayr  [2016-01-21 21:09]:
> * 13: test suite failures (segfaults and similar); not clear if the
>   package or if GCC is at fault.

Rene Engelhard pointed me to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69327
which might explain some of these segfaults.

-- 
Martin Michlmayr
Linux for HPE Helion, Hewlett Packard Enterprise


Re: Status of GCC 6 on x86_64 (Debian)

2016-01-22 Thread Markus Trippelsdorf
On 2016.01.22 at 11:27 -0800, Martin Michlmayr wrote:
> * Martin Michlmayr  [2016-01-21 21:09]:
> > * 13: test suite failures (segfaults and similar); not clear if the
> >   package or if GCC is at fault.
> 
> Rene Engelhard pointed me to 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69327
> which might explain some of these segfaults.

My guess would be that most segfaults are caused by the much more
aggressive optimization based on the assumption that "this" must never
be NULL in C++. 

QT5, Chromium and Kdevelop all call methods from a NULL pointer and
crash for this reason. -fno-delete-null-pointer-checks is a workaround.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68853 for an analysis
of the Chromium crash.

-- 
Markus


Re: Status of GCC 6 on x86_64 (Debian)

2016-01-26 Thread David Malcolm
On Fri, 2016-01-22 at 08:27 +0100, Matthias Klose wrote:
> On 22.01.2016 06:09, Martin Michlmayr wrote:
> > In terms of build failures, I reported 520 bugs to Debian.  Most of them
> > were new GCC errors or warnings (some packages use -Werror and many
> > -Werror=format-security).
> >
> > Here are some of the most frequent errors see:
> 
> [...]
> Martin tagged these issues; https://wiki.debian.org/GCC6 has links with these 
> bug searches.

Thanks.

The -Wmisleading-indentation ones can be seen at:
https://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=gcc-6-misleading-indentation;users=debian-...@lists.debian.org

I looked through them all.

I opened PR c/69415 to cover some possible issues with how we deal with
one-liners, which a couple of these relate to; I don't know if we want
to tweak our policy for one-liners.

Other than that, I felt that we're in good shape here: I think the
things we warned about were reasonable to warn about (but I have an
obvious bias here).  I'm writing up some notes for the website's
"porting to gcc 6" page based on this.

Detailed notes follow:
##
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=811572
Package: pimd/litite:

Looking at,
  https://github.com/troglobit/libite/blob/master/lite.h#L134
the code in question seems to be:

static inline int fisslashdir(char *dir)
{
   if (!dir) return 0;
   if (strlen (dir) > 0) return dir[strlen (dir) - 1] == '/';
 return 0;
}

##
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=811573
Package: rustc

> /<>/rustc-1.5.0+dfsg1/src/rt/miniz.c: In function 
> 'tinfl_decompress':
> /<>/rustc-1.5.0+dfsg1/src/rt/miniz.c:578:47: error: statement is 
> indented as if it were guarded by... [-Werror=misleading-indentation]
>  for ( i = 0; i <= 143; ++i) *p++ = 8; for ( ; i <= 255; ++i) *p++ = 
> 9; for ( ; i <= 279; ++i) *p++ = 7; for ( ; i <= 287; ++i) *p++ = 8;
>^~~


Link to upstream rustc code in context:
  https://github.com/rust-lang/rust/blob/master/src/rt/miniz.c#L578
  https://github.com/rust-lang/rust/blob/master/src/rt/miniz.c#L1396

My opinion: it's fair to issue a warning for this at -Wall


##
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=811575
Package: nss

The code in question seems to be here:
  https://hg.mozilla.org/projects/nss/file/tip/lib/dbm/src/h_page.c#l117

and contains mixed spaces and tabs.  Detabifying at 8-spaces per tab (though
am not sure if this is what upstream nss use), I get:

if(origin == SEEK_CUR)
  {
if(offset < 1)
return(lseek(fd, offset, SEEK_CUR));

cur_pos = lseek(fd, 0, SEEK_CUR);

if(cur_pos < 0)
return(cur_pos);
  }

IMHO the indentation here *is* misleading and hence the warning is justified.

##
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=811576
Package: tpm-tools

Code in question seems to be here:
  
http://sources.debian.net/src/tpm-tools/1.3.8-2/src/tpm_mgmt/tpm_present.c/#L358

at the end of the function:

  out:
if (szTpmPasswd && !isWellKnown)
shredPasswd( szTpmPasswd );
return iRc;

IMHO indentation here is somewhat misleading; warning feels justified

##
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=811577
Package: sgt-puzzles

Code in question seems to be here:
  https://github.com/radekp/sgt-puzzles/blob/master/towers.c#L391

if (ret)
return ret;

#ifdef STANDALONE_SOLVER
if (solver_show_working)
sprintf(prefix, "%*slower bounds for clue %s %d:\n",
solver_recurse_depth*4, "",
cluepos[c/w], c%w+1);
else
prefix[0] = '\0';  /* placate optimiser */
#endif

Not sure how "misleading" this is, more just poorly indented.

##
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=811578
Package: confetti

Looks like it might be generated code
e.g. generated by https://github.com/mailru/confetti/blob/master/c_dump.c


##
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=811579
Package: mosh

> make[5]: Entering directory '/<>/src/protobufs'
...
> userinput.pb.cc: In member function 'virtual bool 
> ClientBuffers::Instruction::IsInitialized() const':
> userinput.pb.cc:375:53: error: statement is indented as if it were guarded 
> by... [-Werror=misleading-indentation]
>if (!_extensions_.IsInitialized()) return false;  return true;
>   

Re: Status of GCC 6 on x86_64 (Debian)

2016-02-02 Thread Matthias Klose

On 22.01.2016 08:27, Matthias Klose wrote:

On 22.01.2016 06:09, Martin Michlmayr wrote:

In terms of build failures, I reported 520 bugs to Debian.  Most of them
were new GCC errors or warnings (some packages use -Werror and many
-Werror=format-security).

Here are some of the most frequent errors see:


[...]
Martin tagged these issues; https://wiki.debian.org/GCC6 has links with these
bug searches.


Now added the issues with the gcc6-unknown tag, including packages with build 
failures in running the test suites, which might point out wrong-code issues.


see
http://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=gcc-6-unknown;users=debian-...@lists.debian.org



Re: Status of GCC 6 on x86_64 (Debian)

2016-02-03 Thread Markus Trippelsdorf
On 2016.02.03 at 01:13 +0100, Matthias Klose wrote:
> On 22.01.2016 08:27, Matthias Klose wrote:
> >On 22.01.2016 06:09, Martin Michlmayr wrote:
> >>In terms of build failures, I reported 520 bugs to Debian.  Most of them
> >>were new GCC errors or warnings (some packages use -Werror and many
> >>-Werror=format-security).
> >>
> >>Here are some of the most frequent errors see:
> >
> >[...]
> >Martin tagged these issues; https://wiki.debian.org/GCC6 has links with these
> >bug searches.
> 
> Now added the issues with the gcc6-unknown tag, including packages with
> build failures in running the test suites, which might point out wrong-code
> issues.

Looks like Google Mock (of googletest) invokes undefined behavior
(member call on null "this" pointer). So potentially all packages that
use googletest in their testsuite may be affected. 

I've opened: https://github.com/google/googletest/issues/705

-- 
Markus