From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22578 invoked by alias); 12 Nov 2012 15:46:03 -0000 Received: (qmail 22568 invoked by uid 22791); 12 Nov 2012 15:46:02 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mx02.qsc.de (HELO mx02.qsc.de) (213.148.130.14) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 12 Nov 2012 15:45:57 +0000 Received: from [192.168.188.20] (port-92-195-100-57.dynamic.qsc.de [92.195.100.57]) by mx02.qsc.de (Postfix) with ESMTP id 22A812484F; Mon, 12 Nov 2012 16:45:56 +0100 (CET) Message-ID: <50A119B3.4000201@net-b.de> Date: Mon, 12 Nov 2012 15:46:00 -0000 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121025 Thunderbird/16.0.2 MIME-Version: 1.0 To: Dodji Seketeli CC: gcc patches , Jakub Jelinek , Wei Mi , Kostya Serebryany , Xinliang David Li Subject: Re: [asan] Patch - fix an ICE in asan.c References: <509D6965.5040405@net-b.de> <874nkv3up1.fsf@redhat.com> In-Reply-To: <874nkv3up1.fsf@redhat.com> Content-Type: multipart/mixed; boundary="------------050507050506080700060504" Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-11/txt/msg00907.txt.bz2 This is a multi-part message in MIME format. --------------050507050506080700060504 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1900 Dodji Seketeli wrote: > I believe the neqw series of patches I have juste posted address this > issue. Thanks a lot for your merging work! I am really looking forward to have it available on the trunk! I guess that your updated patch fixes the issue as it incorporates Jakub's patch. (I have not yet re-build your merge branch but have just applied Jakub's patch to the "asan" branch. Cloning your merge branch takes quite some time and due to --rebase, a simple "git update" doesn't work.) * * * I have two minor issues which can be fixed after committal of the patches to the trunk. First, I have a small hyphen fix patch, which is on top of your merge branch. (The "asan" branch itself is okay.) --- invoke.texi.orig 2012-11-12 15:41:31.000000000 +0100 +++ invoke.texi 2012-11-12 15:16:33.856424039 +0100 @@ -356,5 +356,5 @@ Objective-C and Objective-C++ Dialects}. -falign-labels[=@var{n}] -falign-loops[=@var{n}] -faddress-sanitizer @gol ---fassociative-math fauto-inc-dec -fbranch-probabilities @gol ---fbranch-target-load-optimize fbranch-target-load-optimize2 @gol ---fbtr-bb-exclusive -fcaller-saves @gol +-fassociative-math -fauto-inc-dec -fbranch-probabilities @gol +-fbranch-target-load-optimize -fbranch-target-load-optimize2 @gol +-fbtr-bb-exclusive -fcaller-saves @gol -fcheck-data-deps -fcombine-stack-adjustments -fconserve-stack @gol * * * Secondly, the following code fails on both the asan branch and on the merge branch with an ICE: void TI_ASM_Pack_Inst (const int *opnd) { int bopnd[5]; __builtin_bcopy(opnd, bopnd, sizeof (bopnd)); } The ICE is: fail7.i:1:6: error: type mismatch in pointer plus expression _40 = _39 + _38; as the operands aren't POINTER_P. That's fixed by the following patch; I am not sure whether it is fully correct, but that patched line is used for both pointers and nonpointers in *this* example. Tobias --------------050507050506080700060504 Content-Type: text/x-patch; name="pointer-plus.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pointer-plus.diff" Content-length: 504 diff --git a/gcc/asan.c b/gcc/asan.c index 639dd9f..42f1abe 100644 --- a/gcc/asan.c +++ b/gcc/asan.c @@ -928,7 +928,8 @@ instrument_mem_region_access (tree base, tree len, /* _2 = _1 + offset; */ region_end = - gimple_build_assign_with_ops (POINTER_PLUS_EXPR, + gimple_build_assign_with_ops (POINTER_TYPE_P (TREE_TYPE (base)) + ? POINTER_PLUS_EXPR : PLUS_EXPR, make_ssa_name (TREE_TYPE (base), NULL), gimple_assign_lhs (region_end), gimple_assign_lhs (offset)); --------------050507050506080700060504--