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 (&vf))
    {
      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!

Reply via email to