Bug 71980 - [5] libraw on x86_64-linux-musl causes ICE in vect_analyze_data_ref_accesses, at tree-vect-data-refs.c:2596
Summary: [5] libraw on x86_64-linux-musl causes ICE in vect_analyze_data_ref_accesses,...
Status: RESOLVED DUPLICATE of bug 71702
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 5.4.0
: P3 major
Target Milestone: ---
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2016-07-23 05:44 UTC by A. Wilcox (awilfox)
Modified: 2016-07-23 06:28 UTC (History)
1 user (show)

See Also:
Known to work:
Known to fail:
Last reconfirmed: 2016-07-23 00:00:00


Note You need to log in before you can comment on or make changes to this bug.
Description A. Wilcox (awilfox) 2016-07-23 05:44:09 UTC
Hello.  We are starting a new musl libc-based Linux distribution targeting desktops called Adélie Linux; our target is therefore x86_64-foxkit-linux-musl.  We use the Gentoo and musl patchsets for GCC.  I have also cherry-picked the fix for #71505 and applied it as an additional patch, since it seemed to have a very similar issue.  Still, we are seeing the following output when attempting to build libraw-0.16.2:

[ 42%] Building CXX object CMakeFiles/raw_r.dir/internal/demosaic_packs.cpp.o
/usr/bin/x86_64-foxkit-linux-musl-g++  -DUSE_JPEG -DUSE_JPEG8 -DUSE_LCMS2 -Draw_r_EXPORTS   -DNDEBUG -O2 -ggdb -march=nocona -mtune=core2 -fno-omit-frame-pointer -mfpmath=sse  -fPIC -I/usr/src/media-libs/libraw-0.16.2/work/LibRaw-0.16.2-.default -I/usr/src/media-libs/libraw-0.16.2/work/LibRaw-0.16.2    -w -fPIC -O4 -o CMakeFiles/raw_r.dir/internal/demosaic_packs.cpp.o -c /usr/src/media-libs/libraw-0.16.2/work/LibRaw-0.16.2/internal/demosaic_packs.cpp
/usr/src/media-libs/libraw-0.16.2/work/LibRaw-0.16.2/internal/./dcb_demosaicing.c: In member function ‘void LibRaw::dcb_nyquist()’:
/usr/src/media-libs/libraw-0.16.2/work/LibRaw-0.16.2/internal/demosaic_packs.cpp:26:15: internal compiler error: in vect_analyze_data_ref_accesses, at tree-vect-data-refs.c:2596
 #define CLASS LibRaw::
/usr/src/media-libs/libraw-0.16.2/work/LibRaw-0.16.2/internal/./dcb_demosaicing.c:231:6: note: in expansion of macro ‘CLASS’
 void CLASS dcb_nyquist()
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bts.adelielinux.org/> for instructions.
CMakeFiles/raw.dir/build.make:110: recipe for target 'CMakeFiles/raw.dir/internal/demosaic_packs.cpp.o' failed
make[2]: *** [CMakeFiles/raw.dir/internal/demosaic_packs.cpp.o] Error 1

This also occurs on a vanilla 5.4.0, i.e. without any distro patches applied.

I do realise that upstream really should not be using -O4.  Adding "-fno-tree-loop-vectorize -fno-tree-slp-vectorize" allowed the build to continue.  But since this is likely a bug anyway, I have filed it here.

ciall ~ # gcc -v
Using built-in specs.
Target: x86_64-foxkit-linux-musl
Configured with: /var/tmp/portage/sys-devel/gcc-5.4.0-r1/work/gcc-5.4.0/configure --host=x86_64-foxkit-linux-musl --build=x86_64-foxkit-linux-musl --prefix=/usr --bindir=/usr/x86_64-foxkit-linux-musl/gcc-bin/5.4.0 --includedir=/usr/lib/gcc/x86_64-foxkit-linux-musl/5.4.0/include --datadir=/usr/share/gcc-data/x86_64-foxkit-linux-musl/5.4.0 --mandir=/usr/share/gcc-data/x86_64-foxkit-linux-musl/5.4.0/man --infodir=/usr/share/gcc-data/x86_64-foxkit-linux-musl/5.4.0/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-foxkit-linux-musl/5.4.0/include/g++-v5 --with-python-dir=/share/gcc-data/x86_64-foxkit-linux-musl/5.4.0/python --enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --enable-checking=release --with-bugurl=http://bts.adelielinux.org/ --with-pkgversion='Adélie 5.4.0-r1 p1.0, pie-0.6.5' --enable-libstdcxx-time --enable-shared --enable-threads=posix --disable-multilib --disable-altivec --disable-fixed-point --enable-targets=all --disable-libgcj --enable-libgomp --disable-libmudflap --enable-libssp --disable-libcilkrts --disable-libmpx --disable-vtable-verify --disable-libvtv --enable-lto --without-isl --disable-libsanitizer
Thread model: posix
gcc version 5.4.0 (Adélie 5.4.0-r1 p1.0, pie-0.6.5)
Comment 1 Alexander Monakov 2016-07-23 06:06:33 UTC
This is most likely a duplicate of bug 71702. I've talked with the reporter briefly on IRC, waiting to confirm if STRIP_NOPS patch solves the issue here as well.
Comment 2 A. Wilcox (awilfox) 2016-07-23 06:28:43 UTC
I can confirm that libraw compiles with -O4 as it so desires using 5.4.0 + the patch mentioned in bug 71702 on the same target as reported in the bug description.

*** This bug has been marked as a duplicate of bug 71702 ***