From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9647 invoked by alias); 11 Oct 2012 17:14:41 -0000 Received: (qmail 9625 invoked by uid 22791); 11 Oct 2012 17:14:40 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-qc0-f175.google.com (HELO mail-qc0-f175.google.com) (209.85.216.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 11 Oct 2012 17:14:34 +0000 Received: by mail-qc0-f175.google.com with SMTP id j3so1657970qcs.20 for ; Thu, 11 Oct 2012 10:14:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:organization:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding:x-gm-message-state; bh=nr2jMPj6YXs7penqSOdmGf8wVK51FjJUuUYpFX4fkbs=; b=C8nr1+pp3RhDihE07xUJDrXItQwYCD+RT5OJb3GjU7z/ueTU0oB73OeIDvx/gTd+WK cWNuYNJRZQmBiWelwlHlKei1dQPk+4yy3lOPw2NeuhowJ3NkQPJnsiMk2G4Te+bFMv8G PDHpAIpBAdbln8hQ9W0m1bPlsdp4zFHmS9phNVnfePd/R/lhtsjjLKqM1R0z75opmWHm 6+rDgXZx5bb9B/9xScC4QnC2e+EaNMkJrLYPhtOXSyQid24sSCy6Uf2i6XSq/CBMNsCV otc6aS8SY3QUSwrYljgwfb8Fr00X4lTYGbPkXaSTxmdHmKuFKrdUFTI6DM5wuolR4CxQ H14w== Received: by 10.224.184.197 with SMTP id cl5mr2943112qab.28.1349975673895; Thu, 11 Oct 2012 10:14:33 -0700 (PDT) Received: from urs-home.corp.google.com ([172.26.40.156]) by mx.google.com with ESMTPS id a8sm4309715qew.11.2012.10.11.10.14.32 (version=SSLv3 cipher=OTHER); Thu, 11 Oct 2012 10:14:33 -0700 (PDT) Message-ID: <5076FE77.1060806@google.com> Date: Thu, 11 Oct 2012 17:27:00 -0000 From: Diego Novillo User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20121005 Thunderbird/16.0 MIME-Version: 1.0 To: Jakub Jelinek CC: Dodji Seketeli , gcc-patches@gcc.gnu.org, Wei Mi Subject: Re: [asan] Emit GIMPLE directly, small cleanups References: <20121011163847.GE584@tucnak.redhat.com> In-Reply-To: <20121011163847.GE584@tucnak.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQmhyHo7qMqOh+d8/5yezHpzr1lz/JCKHXnKxw36fGasTdSU8oAdf1vdhBxgQ7wYqqo3TgAcpniS8bxJQYNTiBf+Hz7diZePv6fO6ASO7IcrLlSgNrcmok9gihb7vIpf5I3p/LgXoADZkExiErIw/UEF5HF2KH1YIxOvCHv/4Q2YPIMYYLavVfvuGF0RiCPHrfJiZKXm X-IsSubscribed: yes 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-10/txt/msg01133.txt.bz2 On 2012-10-11 12:38 , Jakub Jelinek wrote: > - gimple_seq seq, stmts; > - tree shadow_type = size_in_bytes == 16 ? > - short_integer_type_node : char_type_node; > - tree shadow_ptr_type = build_pointer_type (shadow_type); > - tree uintptr_type = lang_hooks.types.type_for_mode (ptr_mode, > - /*unsignedp=*/true); > + tree shadow_ptr_type = shadow_ptr_types[size_in_bytes == 16]; Add '? 1 : 0' in the array index expression. > /* Build > - (base_addr >> ASAN_SHADOW_SHIFT) | targetm.asan_shadow_offset (). */ > + (base_addr >> ASAN_SHADOW_SHIFT) + targetm.asan_shadow_offset (). */ Hm, I wonder if this is a documentation problem or we're generating bad runtime code. Wei, you tested the runtime and it was working with the GCC generated code, right? In any case, we can adjust the expression later. > + if (shadow_ptr_types[0] == NULL_TREE) > + { > + alias_set_type set = new_alias_set (); > + shadow_ptr_types[0] > + = build_distinct_type_copy (unsigned_char_type_node); > + TYPE_ALIAS_SET (shadow_ptr_types[0]) = set; > + shadow_ptr_types[0] = build_pointer_type (shadow_ptr_types[0]); > + shadow_ptr_types[1] > + = build_distinct_type_copy (short_unsigned_type_node); > + TYPE_ALIAS_SET (shadow_ptr_types[1]) = set; > + shadow_ptr_types[1] = build_pointer_type (shadow_ptr_types[1]); > + } Move this to an initialization function, please. OK with those changes. Diego.