From patchwork Mon Sep 24 13:19:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 973929 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-486236-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="km/PZP7m"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42JlFN5bRhz9s47 for ; Mon, 24 Sep 2018 23:20:39 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=RTnrbrnaZYSggHEnpf6qGvd2ja6PJb4ulmRPfVRx73VvkOpaYPXbw l4wZ1gTpexoc2sW3YR6bj7s3NFtQ8FIM64SO4feA9savWUrRHsUgbkCDMnoeu6aH dwDVzql86MMD9qDwJLNPPW9pj+HBVP45AdGNbV+q1ln32tq/sh2Ekc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references; s=default; bh=BmXKVNI+nxzOMQPtrbJGzQLkZCQ=; b=km/PZP7mD/rr7uCpkgDQBMPu9Q3x aLL4Ed0X5EmLHwQ5WNBhsXVKahzPtwctFCVGJVcbPQ0USrjk/YPPCJbzNyOAD8Pr lZ4O+zIYDBJg4s9fyyI0lpopYQuWAmlGQ2JzKc6eY74zZ6hQ3U1F39htWR1ytxi7 vU/goxYS/3sFJVs= Received: (qmail 118403 invoked by alias); 24 Sep 2018 13:20:32 -0000 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 Received: (qmail 118393 invoked by uid 89); 24 Sep 2018 13:20:31 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=scanning, Scanning X-HELO: mga01.intel.com Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 24 Sep 2018 13:20:30 +0000 Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Sep 2018 06:20:28 -0700 Received: from gnu-hsw-1.sc.intel.com ([172.25.70.218]) by orsmga008.jf.intel.com with ESMTP; 24 Sep 2018 06:19:41 -0700 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Subject: [PATCH 2/2] Check non-pic/ia32 in stackprotectexplicit2.C Date: Mon, 24 Sep 2018 06:19:40 -0700 Message-Id: <20180924131940.31953-2-hjl.tools@gmail.com> In-Reply-To: <20180924131940.31953-1-hjl.tools@gmail.com> References: <20180924131940.31953-1-hjl.tools@gmail.com> X-IsSubscribed: yes For ia32, __stack_chk_fail isn't called in PIC. We need to check non-pic or non-ia32 before scanning for __stack_chk_fail. PR testsuite/70150 * g++.dg/stackprotectexplicit2.C: Scanning for __stack_chk_fail only for non-pic or non-ia32 . --- gcc/testsuite/g++.dg/stackprotectexplicit2.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/g++.dg/stackprotectexplicit2.C b/gcc/testsuite/g++.dg/stackprotectexplicit2.C index 35d9e886ccf..cd34e4c7cfd 100644 --- a/gcc/testsuite/g++.dg/stackprotectexplicit2.C +++ b/gcc/testsuite/g++.dg/stackprotectexplicit2.C @@ -25,4 +25,4 @@ int __attribute__((stack_protect)) c() } -/* { dg-final { scan-assembler-times "stack_chk_fail" 2 } } */ +/* { dg-final { scan-assembler-times "stack_chk_fail" 2 { target { nonpic || { ! ia32 } } } } } */