From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 01E773858C39; Tue, 9 Jan 2024 11:04:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 01E773858C39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704798246; bh=kxzjdGyYw1Eqi0VWdj9l8vNoVrWyV51neC1RN182U/s=; h=From:To:Subject:Date:In-Reply-To:References:From; b=HS8Ofgn4kfqB7Iuaz/kupDTAc65Kdp9h6J2XiLZB1GuIknM6ng/nFV1AKM3FhWsLF TShX96mSfgDjt2fgmKWX/s8diPsDgBLns81QSRRFg76n0uhUCjjj860dPJcil2hMXe FhyBiEEOrgpQL0topvAbhQ+HdE5WxWQ5yEeHM+00= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/113284] [14 regression] many failures in asan after r14-6946-ge66dc37b299cac Date: Tue, 09 Jan 2024 11:04:03 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: sanitizer X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: link-failure X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org 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: 14.0 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=3D113284 --- Comment #5 from Jakub Jelinek --- (In reply to Ilya Leoshkevich from comment #4) > Thanks, I can repro this on cfarm203 now. Apparently I missed >=20 > diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc > index 94fbf46f2b6..fd9bb807957 100644 > --- a/gcc/config/rs6000/rs6000.cc > +++ b/gcc/config/rs6000/rs6000.cc > @@ -21334,7 +21334,7 @@ rs6000_elf_declare_function_name (FILE *file, con= st > char *name, tree decl) > if (TARGET_64BIT && DEFAULT_ABI !=3D ABI_ELFv2) > { > fputs ("\t.section\t\".opd\",\"aw\"\n\t.align 3\n", file); > - ASM_OUTPUT_LABEL (file, name); > + ASM_OUTPUT_FUNCTION_LABEL (file, name, decl); Is that correct? The function label is emitted in the .opd section on powerpc big endian, but I think we want the .LASAN label to be in the text section instead, e.g. after the rs6000_output_function_entry (file, name); label emitted a f= ew lines later. > fputs (DOUBLE_INT_ASM_OP, file); > rs6000_output_function_entry (file, name); > fputs (",.TOC.@tocbase,0\n\t.previous\n", file); >=20 > in commit c659dd8bfb55 ("Implement ASM_DECLARE_FUNCTION_NAME using > ASM_OUTPUT_FUNCTION_LABEL"). I will start a full regtest and send a patch > shortly. Before your changes, we used to emit something like .section ".opd","aw" .align 3 foo: .quad .L.foo,.TOC.@tocbase,0 .previous .type foo, @function .L.foo: .LASANPC0: .LFB0: .cfi_startproc The above patch would emit the .LASANPC0: label after foo:, which is clearly incorrect, it really should go where it was emitted before. Completely untested: --- gcc/config/rs6000/rs6000.cc.jj 2024-01-05 15:22:21.915684074 +0100 +++ gcc/config/rs6000/rs6000.cc 2024-01-09 12:03:09.295509894 +0100 @@ -21357,6 +21357,10 @@ rs6000_elf_declare_function_name (FILE * ASM_DECLARE_RESULT (file, DECL_RESULT (decl)); rs6000_output_function_entry (file, name); fputs (":\n", file); + if ((flag_sanitize & SANITIZE_ADDRESS) + && (in_cold_section_p =3D=3D first_function_block_is_cold) + && cfun) + asan_function_start (); return; }=