Summary: | 9.2-rc1 workaround for clover build failure on ppc/altivec: cannot convert 'bool' to '__vector(4) __bool int' in return | ||
---|---|---|---|
Product: | Mesa | Reporter: | Chí-Thanh Christopher Nguyễn <chithanh> |
Component: | Other | Assignee: | Matt Turner <mattst88> |
Status: | RESOLVED FIXED | QA Contact: | mesa-dev |
Severity: | normal | ||
Priority: | medium | CC: | kb9vqf |
Version: | 9.2 | ||
Hardware: | Other | ||
OS: | All | ||
See Also: | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58241 | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | compressed build.log |
bugzilla-daemon@freedesktop.org writes: > 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 > clover::ref_counter::release()': > ./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 "-fno-tree-vectorize"? >[...] 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 > -std=c++XY > > 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... Thank you. 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. Patch is now upstream. commit 7d1195c1e4d071fe796bf5f210c468ea1cc86225 Author: Matt Turner <mattst88@gmail.com> Date: Thu Mar 2 04:43:21 2017 +0000 clover: Work around build failure with AltiVec. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.
Created attachment 84560 [details] compressed build.log 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, from core/device.cpp:23: ./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 '>'