Created attachment 84560 [details]
Using gcc-4.7.3, llvm-3.3, clang-3.3 on Gentoo PPC
./configure --prefix=/usr --build=powerpc-unknown-linux-gnu --host=powerpc-unknown-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-silent-rules --disable-dependency-tracking --enable-dri --enable-glx --enable-shared-glapi --enable-texture-float --disable-debug --enable-egl --disable-gbm --disable-gles1 --disable-gles2 --enable-glx-tls --disable-osmesa --enable-asm --disable-xa --disable-xorg --with-dri-drivers=,swrast,radeon,r200 --with-gallium-drivers=,swrast,r300,r600 PYTHON2=/usr/bin/python2.7 --with-egl-platforms=x11 --enable-gallium-egl --enable-gallium-llvm --disable-openvg --enable-r600-llvm-compiler --disable-vdpau --disable-xvmc --enable-opencl --with-opencl-libdir=/usr/lib/OpenCL/vendors/mesa --with-clang-libdir=/usr/lib
Causes the build to fail in clover:
In file included from ./core/device.hpp:29:0,
./core/base.hpp: In member function '__vector(4) __bool int clover::ref_counter::release()':
./core/base.hpp:73:36: error: cannot convert 'bool' to '__vector(4) __bool int' in return
./core/base.hpp: At global scope:
./core/base.hpp:205:26: error: expected type-specifier
./core/base.hpp:205:26: error: expected '>'
> Using gcc-4.7.3, llvm-3.3, clang-3.3 on Gentoo PPC
> Causes the build to fail in clover:
> In file included from ./core/device.hpp:29:0,
> from core/device.cpp:23:
> ./core/base.hpp: In member function '__vector(4) __bool int
> ./core/base.hpp:73:36: error: cannot convert 'bool' to '__vector(4) __bool int'
> in return
That's weird... It looks like gcc is trying to vectorize the return
type of that function, unsuccessfully. Can you try with different build
flags like "-mcpu=powerpc" instead of "-mcpu=7450" and/or
Tried to build 9.2-rc2 with different compiler flags:
CXXFLAGS="-O2 -mcpu=7450 -fno-free-vectorize" fails
CXXFLAGS="-O2 -mcpu=powerpc" succeeds
CXXFLAGS="-O2 -mcpu=7450 -mno-altivec" succeeds
So it looks like the altivec vectorization triggers this issue.
It appears that inclusion of altivec.h in cl_platform.h causes "bool" to be redefined to "__attribute__((altivec(bool__))) unsigned", but only with -std=c++XY
Not including altivec.h or using -std=gnu++11 makes the error go away.
(In reply to comment #3)
> It appears that inclusion of altivec.h in cl_platform.h causes "bool" to be
> redefined to "__attribute__((altivec(bool__))) unsigned", but only with
> Not including altivec.h or using -std=gnu++11 makes the error go away.
Uhm, that shouldn't happen... Can you please file a GCC bug about this? A compiler optimization shouldn't break code that is otherwise correct and working...
Upstream closed my bug report (linked under See Also:) as invalid with the following response:
"You need to use -std=g++11 or undefine bool after the include of altivec.h as
context sensitive keywords is not part of the C++11 standard."
Patch with workaround sent: http://lists.freedesktop.org/archives/mesa-dev/2013-August/043890.html
Tested to build successfully on Gentoo PPC.
New patch sent.
Patch is now upstream.
Author: Matt Turner <email@example.com>
Date: Thu Mar 2 04:43:21 2017 +0000
clover: Work around build failure with AltiVec.
*** Bug 93687 has been marked as a duplicate of this bug. ***