From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by sourceware.org (Postfix) with ESMTPS id 2CAE53858CDA for ; Fri, 7 Oct 2022 11:34:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2CAE53858CDA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-x631.google.com with SMTP id a26so10703450ejc.4 for ; Fri, 07 Oct 2022 04:34:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=WNKkaiS7cF2ylhQ8onDcPaOemci5wrsptDrKFLpmm8g=; b=I6Jw69YyAXk9uWiDCf0LIXInLoQwcRstZQcuUkQt6cJvhDIQO0orLephinTrZ+PJ27 IYQbgGm3yR5VUTBpBnln4xB5FRKDAQW597Ki37TUAl07ZtNWyuZa+JXwCwW6XaGfmL8z qK4OfBbp0aw79JFpbqBqeBQiE4DtBOt6WZsjKwhUItRaV9UxKSzDA+pyM4XYDgKaotlC fjs98hzY+if4zxOw3qFRJd7fEd4jCG9toSWANOKQG6nZ0JyqbH2Cn0mVdLF7hzW/dzKB uG4C5bmahq0RlhkxP5IdQ2oFln3e7UQq3Uit5jSuzbBbCSwI1JwOxUU5nBmfKLt2ACXI LCaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WNKkaiS7cF2ylhQ8onDcPaOemci5wrsptDrKFLpmm8g=; b=uejAtwpgELhVs1tEjsT2YxKHOFpoS+a44KkeiCnyAMBj9ZPdjkJrLNwMrOFXcporhp sgRKQ8WYdWrlgZsFBmkiAdGwnxKgX93wjlcRQruFV1CG+Z7xO749Z2uwpk3dFrCX0v6w CnurYUoM0wOfoQC7CQ2w9xkzoTioC94PFZJJ8jRDB/eHgUZ+VfcH7KmBMCqxq3k8QjCa t4eyBUx4EScyRvdgoHdqcZktGUy565rq4O34deXQqfQPQN8fIxk511T57qkyo6kGepKM g/5ueuSdosyhy+aDDnM9H/5cUdG8Ej8KFEJ5DaD0uJtgzFEjZSOgSq4u1d0U0vJfyF5Q 74pA== X-Gm-Message-State: ACrzQf2KiCQBWGGarqKt5NehNY1Xf0PCn7onK0FmCZ9iMZPDii1GUkeT AQgM7oOM/S0Fg1san0lHZxQxT90MlZee1om9lPc= X-Google-Smtp-Source: AMsMyM76+ewdMhvlB2fm5bHC7F0ZVUjA1g/LqJ6liYWUYcK6sw5faRoOBs71tYihJBle4v8MtXW+YhjwfZGI4W3D634= X-Received: by 2002:a17:907:7635:b0:78d:74c2:a986 with SMTP id jy21-20020a170907763500b0078d74c2a986mr1774211ejc.442.1665142444648; Fri, 07 Oct 2022 04:34:04 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Richard Biener Date: Fri, 7 Oct 2022 13:33:52 +0200 Message-ID: Subject: Re: [RFA] Minor improvement to coremark, avoid unconditional jump to return To: Franz Sirl Cc: Jeff Law , gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, Oct 7, 2022 at 12:51 PM Franz Sirl wrote: > > Am 2022-09-25 um 18:28 schrieb Jeff Law: > > This is a minor improvement for the core_list_find routine in coremark. > > > > > > Basically for riscv, and likely other targets, we can end up with an > > unconditional jump to a return statement. This is a result of > > compensation code created by bb-reorder, and no jump optimization pass > > runs after bb-reorder to clean this stuff up. > > > > This patch utilizes preexisting code to identify suitable branch targets > > as well as preexisting code to emit a suitable return, so it's pretty > > simple. Note that when we arrange to do this optimization, the original > > return block may become unreachable. So we conditionally call > > delete_unreachable_blocks to fix that up. > > > > This triggers ~160 times during an x86_64 bootstrap. Naturally it > > bootstraps and regression tests on x86_64. > > > > I've also bootstrapped this on riscv64, regression testing with qemu > > shows some regressions, but AFAICT they're actually qemu bugs with > > signal handling/delivery -- qemu user mode emulation is not consistently > > calling user defined signal handlers. Given the same binary, sometimes > > they'll get called and the test passes, other times the handler isn't > > called and the test (of course) fails. I'll probably spend some time to > > try and chase this down for the sake of making testing easier. > > > > > > OK for the trunk? > > Hello Jeff, > > I've bisected this change to break a "profiledbootstrap" on x86_64 like > that: Can you open a bugreport please? > make[3]: Entering directory > '/home/fsirl/rpmbuild/BUILD/gcc-13.0.0+gitr13+2871/obj-x86_64-suse-linux/gcc' > /home/fsirl/rpmbuild/BUILD/gcc-13.0.0+gitr13+2871/obj-x86_64-suse-linux/./prev-gcc/xg++ > -B/home/fsirl/rpmbuild/BUILD/gcc-13.0.0+gitr13+2871/obj-x86_64-suse-linux/./prev-gcc/ > -B/usr/x86_64-suse-linux/ > bin/ -nostdinc++ > -B/home/fsirl/rpmbuild/BUILD/gcc-13.0.0+gitr13+2871/obj-x86_64-suse-linux/prev-x86_64-suse-linux/libstdc++-v3/src/.libs > -B/home/fsirl/rpmbuild/BUILD/gcc-13.0.0+gitr13+2871/obj-x86_64 > -suse-linux/prev-x86_64-suse-linux/libstdc++-v3/libsupc++/.libs > -I/home/fsirl/rpmbuild/BUILD/gcc-13.0.0+gitr13+2871/obj-x86_64-suse-linux/prev-x86_64-suse-linux/libstdc++-v3/include/x86_64-suse-linu > x > -I/home/fsirl/rpmbuild/BUILD/gcc-13.0.0+gitr13+2871/obj-x86_64-suse-linux/prev-x86_64-suse-linux/libstdc++-v3/include > > -I/home/fsirl/rpmbuild/BUILD/gcc-13.0.0+gitr13+2871/libstdc++-v3/libsupc++ > -L > /home/fsirl/rpmbuild/BUILD/gcc-13.0.0+gitr13+2871/obj-x86_64-suse-linux/prev-x86_64-suse-linux/libstdc++-v3/src/.libs > -L/home/fsirl/rpmbuild/BUILD/gcc-13.0.0+gitr13+2871/obj-x86_64-suse-linux/prev-x8 > 6_64-suse-linux/libstdc++-v3/libsupc++/.libs -fno-PIE -c -O2 -g > -fmessage-length=0 -D_FORTIFY_SOURCE=2 -funwind-tables > -fasynchronous-unwind-tables -U_FORTIFY_SOURCE -fprofile-use > -fprofile-reprod > ucible=parallel-runs -DIN_GCC -fno-exceptions -fno-rtti > -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings > -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic > -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common > -DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include > -I../../gcc/../libcpp/include -I../../gcc/../libcody > -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/bid > -I../libdecnumber -I../../gcc/../libbacktrace -o cgraph.o -MT cgraph.o > -MMD -MP -MF ./.deps/cgraph.TPo ../../gcc/cgraph.cc > ../../gcc/cgraph.cc: In member function 'cgraph_edge* > cgraph_edge::first_speculative_call_target()': > ../../gcc/cgraph.cc:1166:1: error: EDGE_CROSSING incorrectly set across > same section > 1166 | } > | ^ > ../../gcc/cgraph.cc:1166:1: error: No region crossing jump at section > boundary in bb 19 > during RTL pass: bbro > ../../gcc/cgraph.cc:1166:1: internal compiler error: verify_flow_info failed > 0xa7116e verify_flow_info() > ../../gcc/cfghooks.cc:284 > 0x1c64958 execute > ../../gcc/bb-reorder.cc:2663 > > In such a case, what do you need to reproduce it? I'm a mere user of the > Suse RPM builds here, no idea if profiling needs any extra data to > reproduce to bug. > > Franz. >