From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0A0EB3857809; Thu, 15 Oct 2020 15:21:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0A0EB3857809 From: "christophe.leroy at csgroup dot eu" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/97448] New: Unneccessary stack frame when using stack protector Date: Thu, 15 Oct 2020 15:21:52 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 10.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: christophe.leroy at csgroup dot eu X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2020 15:21:53 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97448 Bug ID: 97448 Summary: Unneccessary stack frame when using stack protector Product: gcc Version: 10.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: christophe.leroy at csgroup dot eu Target Milestone: --- While building Linux kernel for 32 bits powerpc with GCC 10.1 with stack fr= ame protection, functions that don't use the stack at all get a pointless stack frame, while they don't when stackframe protection is not used: c0016af4 : c0016af4: 38 63 ff ff addi r3,r3,-1 c0016af8: 94 21 ff f0 stwu r1,-16(r1) c0016afc: 54 63 a3 3e rlwinm r3,r3,20,12,31 c0016b00: 7c 63 00 34 cntlzw r3,r3 c0016b04: 20 63 00 20 subfic r3,r3,32 c0016b08: 38 21 00 10 addi r1,r1,16 c0016b0c: 4e 80 00 20 blr c000d1b8 : c000d1b8: 94 21 ff f0 stwu r1,-16(r1) c000d1bc: 38 21 00 10 addi r1,r1,16 c000d1c0: 48 00 c5 44 b c0019704 <__copy_tofrom_user> Used GCC version: GCC version with the BUG: Using built-in specs. COLLECT_GCC=3D/opt/gcc-10.1.0-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc COLLECT_LTO_WRAPPER=3D/home/opt/gcc-10.1.0-nolibc/powerpc64-linux/bin/../li= bexec/gcc/powerpc64-linux/10.1.0/lto-wrapper Target: powerpc64-linux Configured with: /home/arnd/git/gcc/configure --target=3Dpowerpc64-linux --enable-targets=3Dall --prefix=3D/home/arnd/cross/x86_64/gcc-10.1.0-nolibc/powerpc64-linux --enable-languages=3Dc --without-headers --disable-bootstrap --disable-nls --disable-threads --disable-shared --disable-libmudflap --disable-libssp --disable-libgomp --disable-decimal-float --disable-libquadmath --disable-libatomic --disable-libcc1 --disable-libmpx --enable-checking=3Dr= elease Thread model: single Supported LTO compression algorithms: zlib gcc version 10.1.0 (GCC) Build command: powerpc64-linux-gcc -Wp,-MMD,arch/powerpc/kernel/.setup-common.o.d -nostdi= nc -isystem /home/opt/gcc-10.1.0-nolibc/powerpc64-linux/bin/../lib/gcc/powerpc64-linux/= 10.1.0/include -I./arch/powerpc/include -I./arch/powerpc/include/generated -I./include -I./arch/powerpc/include/uapi -I./arch/powerpc/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfi= g.h -include ./include/linux/compiler_types.h -D__KERNEL__ -I ./arch/powerpc -W= all -Wundef -Werror=3Dstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=3Dimplicit-function-declaration -Werror=3Dimplicit-int -Wno-format-security -std=3Dgnu89 -mcpu=3Dpowerpc -mcpu=3Dpowerpc -m32 -msoft-float -pipe -ffixed-r2 -mmultiple -mno-readonly-in-sdata -mcpu=3Dpowerpc64 -mno-altivec -mno-vsx -fno-asynchronous-unwind-tables -mno-string -mbig-endian -mstack-protector-guard=3Dtls -mstack-protector-guard-reg=3Dr2 -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-address-of-packed-member -O2 -fno-allow-store-data-races -Wframe-larger-than=3D1024 -fstack-protector -Wno-unused-but-set-variable -Wimplicit-fallthrough -Wno-unused-const-varia= ble -fomit-frame-pointer -fno-var-tracking-assignments -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-stringop-truncat= ion -Wno-zero-length-bounds -Wno-array-bounds -Wno-stringop-overflow -Wno-restr= ict -Wno-maybe-uninitialized -fno-strict-overflow -fno-merge-all-constants -fmerge-constants -fno-stack-check -fconserve-stack -Werror=3Ddate-time -Werror=3Dincompatible-pointer-types -Werror=3Ddesignated-init -fmacro-prefix-map=3D./=3D -Wno-packed-not-aligned -mstack-protector-guard-offset=3D552 -Werror=20=20=20 -DKBUILD_MODFILE=3D'"arch/powerpc/kernel/setup-common"' -DKBUILD_BASENAME=3D'"setup_common"' -DKBUILD_MODNAME=3D'"setup_common"' -c= -o arch/powerpc/kernel/setup-common.o arch/powerpc/kernel/setup-common.c=