From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 64499 invoked by alias); 8 Nov 2016 09:38:27 -0000 Mailing-List: contact jit-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: Sender: jit-owner@gcc.gnu.org Received: (qmail 64428 invoked by uid 89); 8 Nov 2016 09:38:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1795 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx2.suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Subject: Re: Fix build of jit (was Re: [PATCH, RFC] Introduce -fsanitize=use-after-scope (v3)) To: Jakub Jelinek , David Malcolm References: <20161102095926.GM3541@tucnak.redhat.com> <20161102101053.GN3541@tucnak.redhat.com> <20161102142028.GQ5939@redhat.com> <8ac49efe-83af-933b-2aa5-f4b22972fa6a@suse.cz> <20161102143511.GV3541@tucnak.redhat.com> <20161104093254.GS3541@tucnak.redhat.com> <0e0fd0f9-1c7d-ac9e-8dfc-9349611b5efe@suse.cz> <59fde5a4-3633-5fc8-daa0-ed485d75a5db@suse.cz> <1478534833.7673.11.camel@redhat.com> <20161107161741.GN3541@tucnak.redhat.com> Cc: Marek Polacek , GCC Patches , jit@gcc.gnu.org From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: Date: Fri, 01 Jan 2016 00:00:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161107161741.GN3541@tucnak.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-SW-Source: 2016-q4/txt/msg00009.txt.bz2 On 11/07/2016 05:17 PM, Jakub Jelinek wrote: > On Mon, Nov 07, 2016 at 11:07:13AM -0500, David Malcolm wrote: >> The patch (r241896) introduced an error in the build of the jit: >> >> ../../src/gcc/jit/jit-builtins.c:62:1: error: invalid conversion from >> ‘int’ to ‘gcc::jit::built_in_attribute’ [-fpermissive] >> }; >> ^ >> >> which seems to be due to the "0" for ATTRS in: >> >> --- a/gcc/sanitizer.def >> +++ b/gcc/sanitizer.def >> @@ -165,6 +165,10 @@ DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_BEFORE_DYNAMIC_INIT, >> DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_AFTER_DYNAMIC_INIT, >> "__asan_after_dynamic_init", >> BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST) >> +DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_CLOBBER_N, "__asan_poison_stack_memory", >> + BT_FN_VOID_PTR_PTRMODE, 0) >> +DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_UNCLOBBER_N, "__asan_unpoison_stack_memory", >> + BT_FN_VOID_PTR_PTRMODE, 0) > > I believe the 0 here is a bug, I'd think we should be using something like > ATTR_TMPURE_NOTHROW_LEAF_LIST that we are using __asan_load* - the functions > aren't going to throw, nor call anything in the current TU. Not 100% sure > about the TMPURE, after all they do write/read memory (the shadow one). > So maybe ATTR_NOTHROW_LEAF_LIST instead for now? Martin? Yes, 0 is bug. I'm inclining to ATTR_NOTHROW_LEAF_LIST as __asan_{un}poison_stack_memory modifies global memory. It would be more safe. I'm also going to change it for ASAN_MARK internal function (where ECF_TM_PURE is currently selected). I'm testing patch for that. Martin > >> Is the attached patch OK as a fix? (assuming testing passes) Or should >> these builtins have other attrs? (sorry, am not very familiar with the >> sanitizer code). > > Jakub >