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

--- Comment #1 from ktkachov at gcc dot gnu.org ---
If you have
tu1.cc:
#define TU1
#include "repro.cc"

tu2.cc:
#define TU2
#include "repro.cc"

tu3.cc:
#define TU3
#include "repro.cc"

And use the following simple makefile to reproduce:

CXX   ?= g++
FLAGS  = -O2 -fipa-cp-clone -flto

repro: tu1.o tu2.o tu3.o
        @$(CXX) $(FLAGS) -fprofile-use -shared $^ -o red.so 2> link.err; \
        if grep -q "decide_about_value, at ipa-cp" link.err; then \
                echo "=== ICE REPRODUCED ==="; grep -m1 "internal compiler
error" link.err; \
        else \
                echo "=== NO ICE (see link.err) ==="; exit 1; \
        fi

tu%.o: tu%.cc repro.cc
        $(CXX) $(FLAGS) -c $< -o $@

clean:
        rm -f tu*.o red.so link.err

.PHONY: repro clean

Reply via email to