On Mon, 8 Apr 2024 at 10:00, Alexander Lakhin <exclus...@gmail.com> wrote:
> As I wrote in [1], I didn't observe the issue with clang-18, so maybe it
> is fixed already.
> Perhaps it's worth rechecking...

Using the attached script I got these timings. Clang is significantly
slower in all of them. But especially with -Og the difference between
is huge.

gcc 11.4.0: 7.276s
clang 18.1.3: 17.216s
gcc 11.4.0 --debug: 7.441s
clang 18.1.3 --debug: 18.164s
gcc 11.4.0 --debug -Og: 2.418s
clang 18.1.3 --debug -Og: 14.864s

I reported this same issue to the LLVM project here:
https://github.com/llvm/llvm-project/issues/87973
#!/bin/bash
set -exo pipefail
compile() {
        ninja -C build 
src/interfaces/ecpg/preproc/ecpg.p/meson-generated_.._preproc.c.o
        rm 
build/src/interfaces/ecpg/preproc/ecpg.p/meson-generated_.._preproc.c.o
        time ninja -C build 
src/interfaces/ecpg/preproc/ecpg.p/meson-generated_.._preproc.c.o -v
}

CC=gcc CC_LD=lld meson setup --reconfigure build --wipe > /dev/null
compile
CC=clang-18 CC_LD=lld meson setup --reconfigure build --wipe > /dev/null
compile
CC=gcc CC_LD=lld meson setup --reconfigure --debug build --wipe > /dev/null
compile
CC=clang-18 CC_LD=lld meson setup --reconfigure --debug build --wipe > /dev/null
compile
CC=gcc CC_LD=lld meson setup --reconfigure --debug -Dc_args="-Og" build --wipe 
> /dev/null
compile
CC=clang-18 CC_LD=lld meson setup --reconfigure --debug -Dc_args="-Og" build 
--wipe > /dev/null
compile

Reply via email to