[Bug c/108523] New: -O1 -fcode-hoisting causes long compilation time ?

dcb314 at hotmail dot com gcc-bugzilla@gcc.gnu.org
Tue Jan 24 17:00:56 GMT 2023


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108523

            Bug ID: 108523
           Summary: -O1 -fcode-hoisting causes long compilation time  ?
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

Created attachment 54337
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54337&action=edit
C source code

The attached C code takes about 0.1 seconds to compile normally:

$ (ulimit -t 300; time ../results.20230124.release/bin/gcc -c -w -O1   
-fno-var-tracking bug875.c)

real    0m0.133s
user    0m0.095s
sys     0m0.013s

Add in -fcode-hoisting and it seems to take a lot longer:

$ (ulimit -t 300; time ../results.20230124.release/bin/gcc -c -w -O1 
-fcode-hoisting  -fno-var-tracking bug875.c)
gcc: fatal error: Killed signal terminated program cc1
compilation terminated.

real    5m3.155s
user    4m59.955s
sys     0m0.017s

$ ../results.20230124.release/bin/gcc -v
Using built-in specs.
COLLECT_GCC=../results.20230124.release/bin/gcc
COLLECT_LTO_WRAPPER=/home/dcb36/gcc/results.20230124.release/libexec/gcc/x86_64-pc-linux-gnu/13.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../trunk.d1/configure
--prefix=/home/dcb36/gcc/results.20230124.release --disable-multilib
--disable-bootstrap --with-pkgversion=e304e9283a97e28d
--enable-checking=release --enable-languages=c
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.0.1 20230124 (experimental) (e304e9283a97e28d)


More information about the Gcc-bugs mailing list