From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 32A413858C50; Tue, 28 Mar 2023 10:04:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 32A413858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679997840; bh=wOca/n11Q51IMpfq2s6PaasK/02hu9/1AIrV1z8TfgQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=CotPPA300493IlSIJj3lS97PFRHrAVni2QpZv7z9lxcJ/Myltw7Cmb/lsumFOZxGK yO8ikqzuDHNj/O735HMS0FAQSw/SnL/bfhSZFmf/k4n8fbRI1/q66U47U5VZ+iAmIU wy5bQVwakQm5AnFkT5WFt41dZ1P988jys/r8vYUI= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/109299] [12/13 Regression] wrong warning on std::wstring with -O2 -std=c++20 -D_FORTIFY_SOURCE=2 Date: Tue, 28 Mar 2023 10:03:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109299 --- Comment #8 from Jonathan Wakely --- Yes, it looks better: --- 109299-orig.s 2023-03-28 11:01:09.886119878 +0100 +++ 109299-fixed.s 2023-03-28 11:01:21.361187289 +0100 @@ -235,21 +235,14 @@ xorl %esi, %esi call wmemset movq (%rsp), %rax - leaq 48(%rsp), %rdi - movq $42, 8(%rsp) - movq %rdi, 32(%rsp) + leaq 32(%rsp), %rdi + movq %rbx, (%rsp) + movq $42, 40(%rsp) movl $0, 168(%rax) - cmpq %rbx, %rax - je .L35 movq %rax, 32(%rsp) movq 16(%rsp), %rax - movq %rax, 48(%rsp) - movl $42, %eax -.L36: - leaq 32(%rsp), %rdi - movq %rax, 40(%rsp) - movq %rbx, (%rsp) movq $0, 8(%rsp) + movq %rax, 48(%rsp) movl $0, 16(%rsp) call=20=20=20 _ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE10_M_disposeEv movq %rsp, %rdi @@ -261,17 +254,10 @@ popq %rbx .cfi_def_cfa_offset 8 ret -.L35: +.L36: .cfi_restore_state - movl $4, %ecx - movl $43, %edx - movq %rbx, %rsi - call __wmemcpy_chk - movq 8(%rsp), %rax - jmp .L36 -.L38: movq %rax, %rbx - jmp .L37 + jmp .L35 .globl __gxx_personality_v0 .section .gcc_except_table,"a",@progbits .LLSDA1811: @@ -282,7 +268,7 @@ .LLSDACSB1811: .uleb128 .LEHB0-.LFB1811 .uleb128 .LEHE0-.LEHB0 - .uleb128 .L38-.LFB1811 + .uleb128 .L36-.LFB1811 .uleb128 0 .LLSDACSE1811: .section .text.startup @@ -294,7 +280,7 @@ .type main.cold, @function main.cold: .LFSB1811: -.L37: +.L35: .cfi_def_cfa_offset 80 .cfi_offset 3, -16 movq %rsp, %rdi=