From patchwork Thu Oct 25 21:32:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Mi X-Patchwork-Id: 194312 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id D21AE2C009A for ; Fri, 26 Oct 2012 08:32:43 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1351805564; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:Date:Message-ID:Subject:From:To: Cc:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=ky0ZpeO YetYCWLq1lM9xUdkIA3o=; b=eGNVkk6VDSfVkXcoOqlFhjP6fGSydiP3LxTaFLk Nx7R0zmu/O8OSrz0Hh41GVjqo/YCBaBoa/lk4HP9MopvDiTOBokoFC3gVv5HJk1d r4RXze3nEWSsZ4771UpFv5O3ntTACmwn5KPA0gjSL6P9wu7ubMjXqmZpHr8tTsda U0No= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:MIME-Version:Received:Received:Date:Message-ID:Subject:From:To:Cc:Content-Type:X-System-Of-Record:X-Gm-Message-State:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=cqK0lUXvcrvhxfpGP0PXOGOjWspw8g2vsy1Is6dFXSmnvkHahj20xeRihqgAKk CD0DfbWw8BwN9MbeYgv9uOdAjtGnA9sNAqGAjbqR0sbj5knzKiOugvEHHGuQhgDH ycMOKJLablHI3ALll++4YOaQEfibLhn8bD84PfWJH9qh4=; Received: (qmail 21842 invoked by alias); 25 Oct 2012 21:32:40 -0000 Received: (qmail 21827 invoked by uid 22791); 25 Oct 2012 21:32:39 -0000 X-SWARE-Spam-Status: No, hits=-5.8 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-qa0-f54.google.com (HELO mail-qa0-f54.google.com) (209.85.216.54) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 25 Oct 2012 21:32:34 +0000 Received: by mail-qa0-f54.google.com with SMTP id p27so2431419qat.20 for ; Thu, 25 Oct 2012 14:32:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type :x-system-of-record:x-gm-message-state; bh=NZICw+B5SAyAZE8+HlXe4l+o3LAIAVt2EgusrfAMQM8=; b=UpN1Vz4vRGGeUnNYJaTY87czb52u1MDkNETPorUSupr8nR3ZQBT9vABaowuRFgU4K2 G2VHEaRRS0QF6wuZM4yobSOM1wx2LUgFp0l6r1DIM0aqBDPxD+6xMYwt20AYeynLQD+G uvsHtIM/cYdoM3/xOVinnb4J1iqXWlXqlCqtMfsDf4Q5w46YyPrEL6xyBluGdY8EhdXi f5J7L5Z7wc8q/41P0wtDz/UqIewk5pDsv0eU+5P8sFFu+1waEHdTJVfUhoII59Ypy1x/ OsPtBZPVs2AUBI4XVEoDhWYxCSF60hmlaksCsk5QxiUEVaQtuPtAYpmk3jgzmi4h0PBN v7bQ== MIME-Version: 1.0 Received: by 10.224.42.136 with SMTP id s8mr9959261qae.82.1351200753960; Thu, 25 Oct 2012 14:32:33 -0700 (PDT) Received: by 10.49.87.164 with HTTP; Thu, 25 Oct 2012 14:32:33 -0700 (PDT) Date: Thu, 25 Oct 2012 14:32:33 -0700 Message-ID: Subject: [asan] a small patch to fix bogus error about global buffer overflow From: Wei Mi To: gcc-patches@gcc.gnu.org Cc: Diego Novillo , David Li , Jakub Jelinek , Dodji Seketeli , Andrew Pinski X-System-Of-Record: true X-Gm-Message-State: ALoCoQkNNquRCy62++2Mk2hSZijXlJJ4aJPSA7kyyZLNbYNmDQTt6/xQGUOSdHeVlCHcA2J4QsaVmptw36tZGcDgC8VHX1GGCvPOZ3Q1NRVApp1qXVPyVVSNcyrdIbxgporXa/0dX7bB+4q9VcbXHjSXg9+mwITSXSUfpYrj7UqmgGF3p+/AHsEwlzLghkM5dJhVuzSBZ37t Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi, A small patch to remove the bogus error reports exposed in the spec2000 testing. In varasm.c, asan_protected should be equivalent with asan_protect_global (decl) all the time, or else compiler will not insert redzones for some globals planned to be protected. gcc/ChangeLog: 2012-10-25 Wei Mi A small fix to remove bogus error report of global buffer overflow. * varasm.c: correct the condition of asan_protected being true. set_mem_align (decl_rtl, DECL_ALIGN (decl)); Thanks, Wei. Index: varasm.c =================================================================== --- varasm.c (revision 192822) +++ varasm.c (working copy) @@ -1991,11 +1991,10 @@ assemble_variable (tree decl, int top_le align_variable (decl, dont_output_data); if (flag_asan - && asan_protect_global (decl) - && DECL_ALIGN (decl) < ASAN_RED_ZONE_SIZE * BITS_PER_UNIT) + && asan_protect_global (decl)) { asan_protected = true; - DECL_ALIGN (decl) = ASAN_RED_ZONE_SIZE * BITS_PER_UNIT; + DECL_ALIGN (decl) = MAX (DECL_ALIGN (decl), ASAN_RED_ZONE_SIZE * BITS_PER_UNIT); }