[Bug target/87231] stdatomic.h: No such file or directory on OpenBSD 6.3

2018-09-06 Thread sh...@time-travellers.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87231

--- Comment #3 from Shane Kerr  ---
(In reply to Andrew Pinski from comment #2)
> Similar issue to PR 69744.  OpenBSD config should just remove that.

How would I do that?

Should I just comment out the USER_H variable?

[Bug bootstrap/87231] New: stdatomic.h: No such file or directory on OpenBSD 6.3

2018-09-05 Thread sh...@time-travellers.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87231

Bug ID: 87231
   Summary: stdatomic.h: No such file or directory on OpenBSD 6.3
   Product: gcc
   Version: 8.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
  Assignee: unassigned at gcc dot gnu.org
  Reporter: sh...@time-travellers.org
  Target Milestone: ---

Trying to build gcc 8.2.0 on OpenBSD 6.3 fails in stage 3.

(Note that the patch in bug 87225 is required to get to this failure.)

The error message:

/bin/sh ./libtool --tag=CC   --mode=compile
/home/shane/gcc-8.2.0/host-i386-unknown-openbsd6.3/gcc/xgcc
-B/home/shane/gcc-8.2.0/host-i386-unknown-openbsd6.3/gcc/
-B/opt/gcc-8.2.0/i386-unknown-openbsd6.3/bin/
-B/opt/gcc-8.2.0/i386-unknown-openbsd6.3/lib/ -isystem
/opt/gcc-8.2.0/i386-unknown-openbsd6.3/include -isystem
/opt/gcc-8.2.0/i386-unknown-openbsd6.3/sys-include-DHAVE_CONFIG_H
-I../.././libatomic/config/x86 -I../.././libatomic/config/posix
-I../.././libatomic -I.-march=i486 -mtune=i386 -fomit-frame-pointer -Wall
-Werror   -pthread -g -O2 -MT fence.lo -MD -MP -MF .deps/fence.Tpo -c -o
fence.lo ../.././libatomic/fence.c
libtool: compile:  /home/shane/gcc-8.2.0/host-i386-unknown-openbsd6.3/gcc/xgcc
-B/home/shane/gcc-8.2.0/host-i386-unknown-openbsd6.3/gcc/
-B/opt/gcc-8.2.0/i386-unknown-openbsd6.3/bin/
-B/opt/gcc-8.2.0/i386-unknown-openbsd6.3/lib/ -isystem
/opt/gcc-8.2.0/i386-unknown-openbsd6.3/include -isystem
/opt/gcc-8.2.0/i386-unknown-openbsd6.3/sys-include -DHAVE_CONFIG_H
-I../.././libatomic/config/x86 -I../.././libatomic/config/posix
-I../.././libatomic -I. -march=i486 -mtune=i386 -fomit-frame-pointer -Wall
-Werror -pthread -g -O2 -MT fence.lo -MD -MP -MF .deps/fence.Tpo -c
../.././libatomic/fence.c  -fPIC -DPIC -o .libs/fence.o
../.././libatomic/fence.c:26:10: fatal error: stdatomic.h: No such file or
directory
 #include 
  ^
compilation terminated.

My build process is:

* Install OpenBSD (all defaults).
* Run syspatch
* Install packages:
# pkg_add wget
# pkg_add gmp mpfr libmpc
# pkg_add gmake
* Get latest source and unpack:
$ wget
ftp://ftp.nluug.nl/mirror/languages/gcc/releases/gcc-8.2.0/gcc-8.2.0.tar.gz
$ tar xzf gcc-8.2.0.tar.gz
$ cd gcc-8.2.0
* Patch the code from here:
https://gcc.gnu.org/viewcvs/gcc/branches/gcc-8-branch/gcc/tree-vect-stmts.c?r1=264117=264116=264117
* Build:
$ ./configure --prefix=/opt/gcc-8.2.0 --with-gmp=/usr/local
--enable-languages=c,c++
$ gmake

[Bug bootstrap/87225] New: tree-vect-stmts.c:3748 error: converting to 'bool' from 'std::nullptr_t' requires direct-initialization [-fpermissive]

2018-09-05 Thread sh...@time-travellers.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87225

Bug ID: 87225
   Summary: tree-vect-stmts.c:3748 error: converting to 'bool'
from 'std::nullptr_t' requires direct-initialization
[-fpermissive]
   Product: gcc
   Version: 8.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
  Assignee: unassigned at gcc dot gnu.org
  Reporter: sh...@time-travellers.org
  Target Milestone: ---

The vectorizable_simd_clone_call() function returns a bool, but one return has
NULL which the compiler complains on, breaking the build.

The function declaration:

static bool
vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi,
  gimple **vec_stmt, slp_tree slp_node)
{

The return in question:

  unsigned HOST_WIDE_INT vf;
  if (!LOOP_VINFO_VECT_FACTOR (loop_vinfo).is_constant ())
{
  if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
 "not considering SIMD clones; not yet supported"
 " for variable-width vectors.\n");
  return NULL;
}


The error message:

In file included from
/home/shane/gcc-8.2.0/host-i386-unknown-openbsd6.3/prev-gcc/include-fixed/stddef.h:48,
 from ../.././gcc/system.h:43,
 from ../.././gcc/tree-vect-stmts.c:23:
../.././gcc/tree-vect-stmts.c: In function 'bool
vectorizable_simd_clone_call(gimple*, gimple_stmt_iterator*, gimple**,
slp_tree)':
../.././gcc/tree-vect-stmts.c:3748:14: error: converting to 'bool' from
'std::nullptr_t' requires direct-initialization [-fpermissive]
   return NULL;
  ^~~~

This is on OpenBSD 6.3. My build process is:

* Install OpenBSD (all defaults).
* Run syspatch
* Install packages:
# pkg_add wget
# pkg_add gmp mpfr libmpc
# pkg_add gmake
* Get latest source and unpack:
$ wget
ftp://ftp.nluug.nl/mirror/languages/gcc/releases/gcc-8.2.0/gcc-8.2.0.tar.gz
$ tar xzf gcc-8.2.0.tar.gz
$ cd gcc-8.2.0
* Build:
$ ./configure --prefix=/opt/gcc-8.2.0 --with-gmp=/usr/local
--enable-languages=c,c++
$ gmake

It fails in stage2:

$ cat stage_current
stage2

I am curious how this build ever works at all on any system!