Public bug reported:

When compiling a source file that includes
<boost/multiprecision/cpp_int.hpp> (indirectly via CGAL headers in the
original case) with the -ftime-report flag, GCC crashes with an internal
compiler error at timevar.cc:490. The crash occurs during template
instantiation of boost::multiprecision::number.

The error does not occur if -ftime-report is omitted. Precompiled
headers are not used in this test case, the preprocessed file
(draw_surface_mesh.ii) is proveided as attachment.

1: gcc version: 14.2.0 (Ubuntu 14.2.0-4ubuntu2~24.04)

2: Boost version (boost/version.hpp): #define BOOST_VERSION 109000

3: CGAL version (CGAL/version): #define CGAL_VERSION 6.1.1

4: gcc options: COLLECT_GCC_OPTIONS='-std=gnu++23' '-c' '-o'
'draw_surface_mesh.o' '-isystem' '/home/azusa/file/libs/install/include'
'-I' '.' '-I' '..' '-ftime-report' '-v' '-save-temps' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'

5: compelete command line: g++ -std=gnu++23 -c draw_surface_mesh.cpp -o
draw_surface_mesh.o -isystem /home/azusa/file/libs/install/include  -I.
-I.. -ftime-report -v -save-temps

6: full output of compiler (line starting with '>' is user input):
> make
g++ -std=gnu++23 -c draw_surface_mesh.cpp -o draw_surface_mesh.o -isystem 
/home/azusa/file/libs/install/include  -I. -I.. -ftime-report -v -save-temps
Using built-in specs.
COLLECT_GCC=g++
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 
14.2.0-4ubuntu2~24.04' --with-bugurl=file:///usr/share/doc/gcc-14/README.Bugs 
--enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2,rust --prefix=/usr 
--with-gcc-major-version-only --program-suffix=-14 
--program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id 
--libexecdir=/usr/libexec --without-included-gettext --enable-threads=posix 
--libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu 
--enable-libstdcxx-debug --enable-libstdcxx-time=yes 
--with-default-libstdcxx-abi=new --enable-libstdcxx-backtrace 
--enable-gnu-unique-object --disable-vtable-verify --enable-plugin 
--enable-default-pie --with-system-zlib --enable-libphobos-checking=release 
--with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch 
--disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 
--with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic 
--enable-offload-targets=nvptx-none=/build/gcc-14-ig5ci0/gcc-14-14.2.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-14-ig5ci0/gcc-14-14.2.0/debian/tmp-gcn/usr
 --enable-offload-defaulted --without-cuda-driver --enable-checking=release 
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu 
--with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.2.0 (Ubuntu 14.2.0-4ubuntu2~24.04) 
COLLECT_GCC_OPTIONS='-std=gnu++23' '-c' '-o' 'draw_surface_mesh.o' '-isystem' 
'/home/azusa/file/libs/install/include' '-I' '.' '-I' '..' '-ftime-report' '-v' 
'-save-temps' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/libexec/gcc/x86_64-linux-gnu/14/cc1plus -E -quiet -v -I . -I .. 
-imultiarch x86_64-linux-gnu -D_GNU_SOURCE -isystem 
/home/azusa/file/libs/install/include draw_surface_mesh.cpp -mtune=generic 
-march=x86-64 -std=gnu++23 -ftime-report -fpch-preprocess 
-fasynchronous-unwind-tables -fstack-protector-strong -Wformat 
-Wformat-security -fstack-clash-protection -fcf-protection -o 
draw_surface_mesh.ii
ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/14"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory 
"/usr/lib/gcc/x86_64-linux-gnu/14/include-fixed/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/14/include-fixed"
ignoring nonexistent directory 
"/usr/lib/gcc/x86_64-linux-gnu/14/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 .
 ..
 /home/azusa/file/libs/install/include
 /usr/include/c++/14
 /usr/include/x86_64-linux-gnu/c++/14
 /usr/include/c++/14/backward
 /usr/lib/gcc/x86_64-linux-gnu/14/include
 /usr/local/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.

Time variable                                   usr           sys          wall 
          GGC
 phase setup                        :   1.27 (100%)   0.29 (100%)   1.43 (100%) 
  375M (100%)
 |name lookup                       :   0.00 (  0%)   0.01 (  3%)   0.00 (  0%) 
  166k (  0%)
 TOTAL                              :   1.27          0.29          1.43        
  375M
COLLECT_GCC_OPTIONS='-std=gnu++23' '-c' '-o' 'draw_surface_mesh.o' '-isystem' 
'/home/azusa/file/libs/install/include' '-I' '.' '-I' '..' '-ftime-report' '-v' 
'-save-temps' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/libexec/gcc/x86_64-linux-gnu/14/cc1plus -fpreprocessed 
draw_surface_mesh.ii -quiet -dumpbase draw_surface_mesh.cpp -dumpbase-ext .cpp 
-mtune=generic -march=x86-64 -std=gnu++23 -version -ftime-report 
-fasynchronous-unwind-tables -fstack-protector-strong -Wformat 
-Wformat-security -fstack-clash-protection -fcf-protection -o 
draw_surface_mesh.s
GNU C++23 (Ubuntu 14.2.0-4ubuntu2~24.04) version 14.2.0 (x86_64-linux-gnu)
        compiled by GNU C version 14.2.0, GMP version 6.3.0, MPFR version 
4.2.1, MPC version 1.3.1, isl version isl-0.26-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 15295618e53100c52860079ea59d3eac
In file included from 
/home/azusa/file/libs/install/include/boost/multiprecision/cpp_int.hpp:19,
                 from /home/azusa/file/libs/install/include/CGAL/Quotient.h:37,
                 from 
/home/azusa/file/libs/install/include/CGAL/Kernel_d/Cartesian_const_iterator_d.h:20,
                 from 
/home/azusa/file/libs/install/include/CGAL/Homogeneous/VectorH2.h:23,
                 from 
/home/azusa/file/libs/install/include/CGAL/Homogeneous/predicates_on_directionsH2.h:22,
                 from 
/home/azusa/file/libs/install/include/CGAL/Homogeneous/DirectionH2.h:99,
                 from 
/home/azusa/file/libs/install/include/CGAL/Homogeneous/Homogeneous_base.h:29,
                 from 
/home/azusa/file/libs/install/include/CGAL/Simple_homogeneous.h:20,
                 from 
/home/azusa/file/libs/install/include/CGAL/Exact_kernel_selector.h:24,
                 from 
/home/azusa/file/libs/install/include/CGAL/Filtered_kernel.h:22,
                 from 
/home/azusa/file/libs/install/include/CGAL/Exact_predicates_inexact_constructions_kernel.h:21,
                 from draw_surface_mesh.cpp:5:
/home/azusa/file/libs/install/include/boost/multiprecision/number.hpp: In 
instantiation of ‘struct 
boost::multiprecision::number<boost::multiprecision::backends::rational_adaptor<boost::multiprecision::backends::cpp_int_backend<>
 > >’:
/home/azusa/file/libs/install/include/CGAL/boost_mp_type.h:65:22:   required 
from here
   65 |     if (denominator(x) != 1 )
      |                      ^
/home/azusa/file/libs/install/include/boost/multiprecision/number.hpp:81:66: 
internal compiler error: in start, at timevar.cc:490
   81 |       && (boost::multiprecision::number_category<Backend>::value != 
boost::multiprecision::number_kind_complex)
      |          
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x75ed4f62a1c9 __libc_start_call_main
        ../sysdeps/nptl/libc_start_call_main.h:58
0x75ed4f62a28a __libc_start_main_impl
        ../csu/libc-start.c:360
Please submit a full bug report, with preprocessed source (by using 
-freport-bug).
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-14/README.Bugs> for instructions.
make: *** [Makefile:13: draw_surface_mesh.o] Error 1

7: preprocessed file: in attachment

** Affects: gcc-14 (Ubuntu)
     Importance: Undecided
         Status: New

** Attachment added: "preprocess file of  the source file casuing bug"
   
https://bugs.launchpad.net/bugs/2142489/+attachment/5948051/+files/draw_surface_mesh.ii

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2142489

Title:
  GCC-14 internal compiler error with option -ftime-report dealing
  boost::multiprecision

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-14/+bug/2142489/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to