From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by sourceware.org (Postfix) with ESMTPS id ECD313858D1E for ; Mon, 26 Jun 2023 23:34:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ECD313858D1E 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-pg1-x52b.google.com with SMTP id 41be03b00d2f7-53482b44007so1913883a12.2 for ; Mon, 26 Jun 2023 16:34:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687822458; x=1690414458; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=i3eSclrcLZvS1s/cEl39R0TzO6SlpvkB4E88fxNW8xw=; b=LhSkceErm1amJkAvChnHfjBDxWxdIzEHIrlxoLgNSHKK8ogzJW5E64O5PkTeucKZ+P FFAITI3eGA2ueNjNjdNerrwpo5zVtxfwF0f+YvXOL68eIBL/T7kl/cPCMevM3yoH6cnP +bHem3xoOCBjS2wr18bi0y8DI7yh20e25DhaJjTL4sva3wiledcZm4rJ8tC4hq5dOgxV hxFql6gOEOJJjIqJGTcecqofpsEW2Tw0/SZjVgqGtlm55bguo+3jpPvCXFSrVTzwQ0AN VF81+2DsPRRQ1QMQq4/9hqY4dMb1YSG4Wln9g+fY17rp+WhxVQVokF/+CI69o3dpTWaQ OiUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687822458; x=1690414458; h=content-transfer-encoding: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=i3eSclrcLZvS1s/cEl39R0TzO6SlpvkB4E88fxNW8xw=; b=h65F4Tu0JbPxYVgh+dSab2OaovoB1XhjP7LwBrh2savR2WpwVgL8zphkAJH826FRjt +n/nyo3jppdaxX85LiX8LjXwMX1hRGWtlVIM75St20E+G78WjFRVMmnOCQYxRoBIdTmP mBEkWPSVb1IvvKftgkPK/gEcF+k9M16Nda2rwnN+9qMlDfvkVgtdFSy5NpdBpO+m8w7t 5ii2+AmRTxDCfFSz8BZfI1We7ZPfib1Y8CDAe01Qyt4nlOZvosRop20bq6x7mth4qNXX +qQ9rxk76KPI7iJGqnkYE1Mv24TiyfbniAInUy1ctMcnb/+ruaxYhGr6etUrWwBLWRKf z5vQ== X-Gm-Message-State: AC+VfDwBY3LrrcDtYBvrfS0EkAzjFRfKdWqKCcJ68/hT4o+b8UwagwzB 9c4Bk7NIk99Bq6FhdeD/m8Sjgz+wY/sxla6j9cQ= X-Google-Smtp-Source: ACHHUZ5+hHk1Lu03oUiVxEa42swDO2I5n9NnByO0FsyJLUQn9jwHKwdw/WP39gS6eu4Goq7kLme6Jt4SqbII+lfjDmA= X-Received: by 2002:a17:90a:1999:b0:261:2a57:2b9 with SMTP id 25-20020a17090a199900b002612a5702b9mr7908827pji.37.1687822457664; Mon, 26 Jun 2023 16:34:17 -0700 (PDT) MIME-Version: 1.0 References: <20230505151719.1031737-1-apinski@marvell.com> <20230626055827.t57twu4yykagzdpt@lug-owl.de> In-Reply-To: From: Andrew Pinski Date: Mon, 26 Jun 2023 16:34:05 -0700 Message-ID: Subject: Re: [PATCH] Move substitute_and_fold over to use simple_dce_from_worklist To: Jan-Benedict Glaw Cc: Andrew Pinski , gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE,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 Mon, Jun 26, 2023 at 12:41=E2=80=AFPM Andrew Pinski = wrote: > > On Mon, Jun 26, 2023 at 11:49=E2=80=AFAM Andrew Pinski wrote: > > > > On Mon, Jun 26, 2023 at 9:13=E2=80=AFAM Andrew Pinski wrote: > > > > > > On Sun, Jun 25, 2023 at 10:59=E2=80=AFPM Jan-Benedict Glaw wrote: > > > > > > > > Hi Andrew, > > > > > > > > On Fri, 2023-05-05 08:17:19 -0700, Andrew Pinski via Gcc-patches wrote: > > > > > While looking into a different issue, I noticed that it > > > > > would take until the second forwprop pass to do some > > > > > forward proping and it was because the ssa name was > > > > > used more than once but the second statement was > > > > > "dead" and we don't remove that until much later. > > > > [...] > > > > > OK? Bootstrapped and tested on x86_64-linux-gnu with no regressio= ns. > > > > > > > > Since this patch, I see a bit of fallout building the Linux kernel > > > > using the adder875_defconfig: > > > > > > > > # CC arch/powerpc/kernel/ptrace/ptrace-view.o > > > > powerpc-linux-gcc -Wp,-MMD,arch/powerpc/kernel/ptrace/.ptrace-vie= w.o.d -nostdinc -I./arch/powerpc/include -I./arch/powerpc/include/generated= -I./include -I./arch/powerpc/include/uapi -I./arch/powerpc/include/genera= ted/uapi -I./include/uapi -I./include/generated/uapi -include ./include/lin= ux/compiler-version.h -include ./include/linux/kconfig.h -include ./include= /linux/compiler_types.h -D__KERNEL__ -I ./arch/powerpc -fmacro-prefix-map= =3D./=3D -Wall -Wundef -Werror=3Dstrict-prototypes -Wno-trigraphs -fno-stri= ct-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=3Dimplicit-function-= declaration -Werror=3Dimplicit-int -Werror=3Dreturn-type -Wno-format-securi= ty -funsigned-char -std=3Dgnu11 -mbig-endian -m32 -msoft-float -pipe -ffixe= d-r2 -mmultiple -mno-readonly-in-sdata -mcpu=3D860 -mno-prefixed -mno-pcrel= -mno-altivec -mno-vsx -mno-mma -fno-asynchronous-unwind-tables -mno-string= -mbig-endian -mstack-protector-guard=3Dtls -mstack-protector-guard-reg=3Dr= 2 -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation= -Wno-format-overflow -Wno-address-of-packed-member -O2 -fno-allow-store-da= ta-races -Wframe-larger-than=3D1024 -fstack-protector-strong -Wno-main -Wno= -unused-but-set-variable -Wno-unused-const-variable -Wno-dangling-pointer -= fomit-frame-pointer -ftrivial-auto-var-init=3Dzero -fno-stack-clash-protect= ion -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wcast-function-t= ype -Wno-stringop-truncation -Wno-stringop-overflow -Wno-restrict -Wno-mayb= e-uninitialized -Wno-array-bounds -Wno-alloc-size-larger-than -Wimplicit-fa= llthrough=3D5 -fno-strict-overflow -fno-stack-check -fconserve-stack -Werro= r=3Ddate-time -Werror=3Dincompatible-pointer-types -Werror=3Ddesignated-ini= t -Wno-packed-not-aligned -g -mstack-protector-guard-offset=3D544 -Werror -= DUTS_MACHINE=3D'"ppc"' -DKBUILD_MODFILE=3D'"arch/powerpc/kernel/ptrace/p= trace-view"' -DKBUILD_BASENAME=3D'"ptrace_view"' -DKBUILD_MODNAME=3D'"ptrac= e_view"' -D__KBUILD_MODNAME=3Dkmod_ptrace_view -c -o arch/powerpc/kernel/pt= race/ptrace-view.o arch/powerpc/kernel/ptrace/ptrace-view.c > > > > during GIMPLE pass: pre > > > > arch/powerpc/kernel/ptrace/ptrace-view.c: In function 'gpr32_set_co= mmon': > > > > arch/powerpc/kernel/ptrace/ptrace-view.c:649:5: internal compiler e= rror: in gimple_redirect_edge_and_branch, at tree-cfg.cc:6262 > > > > 649 | int gpr32_set_common(struct task_struct *target, > > > > | ^~~~~~~~~~~~~~~~ > > > > 0x1a562a6 internal_error(char const*, ...) > > > > ???:0 > > > > 0x826ea1 fancy_abort(char const*, int, char const*) > > > > ???:0 > > > > 0x9b77c9 redirect_edge_and_branch(edge_def*, basic_block_def*) > > > > ???:0 > > > > 0x9b7e43 split_edge(edge_def*) > > > > ???:0 > > > > 0xee1cc7 split_critical_edges(bool) > > > > ???:0 > > > > Please submit a full bug report, with preprocessed source (by using= -freport-bug). > > > > Please include the complete backtrace with any bug report. > > > > See for instructions. > > > > make[4]: *** [scripts/Makefile.build:252: arch/powerpc/kernel/ptrac= e/ptrace-view.o] Error 1 > > > > make[3]: *** [scripts/Makefile.build:494: arch/powerpc/kernel/ptrac= e] Error 2 > > > > make[2]: *** [scripts/Makefile.build:494: arch/powerpc/kernel] Erro= r 2 > > > > make[1]: *** [scripts/Makefile.build:494: arch/powerpc] Error 2 > > > > make: *** [Makefile:2026: .] Error 2 > > > > > > Can you file a bug (https://gcc.gnu.org/bugzilla/) with the > > > preprocessed source (which -freport-bug will provide). In the meantim= e > > > I will try to reproduce it and see what is going on. > > > > Note I am suspecting it is related to GCC PR 103979 . I am still > > trying to reproduce the ICE. > > I am 99% sure it is more related to PR 105165 really. Where PRE is now > trying to insert on a critical edge and that is failing ... > Basically my patch removes some extra statements (unrelated to the asm > goto) and that causes the IR to be enough different that PRE is now > failing. So I found a testcase which fails before this patch, though the problem is simple_dce_from_worklist is removing the `asm goto` which is wrong. Thanks, Andrew Pinski > > Thanks, > Andrew > > > > > > > > > Thanks, > > > Andrew > > > > > > > > > > > > > > > > > > (Full log at http://toolchain.lug-owl.de/laminar/jobs/linux-powerpc= -adder875_defconfig/100) > > > > > > > > Thanks, > > > > Jan-Benedict > > > > > > > > --