From patchwork Mon Sep 24 13:19:39 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: 973930 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-486237-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="sXo0cLaX"; 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 42JlFZ6lDKz9s47 for ; Mon, 24 Sep 2018 23:20:50 +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; q=dns; s=default; b=FA+x6jNWgEmJjB5 UGRv9mDjnfhtqQJA7lw7vkE2CUDfWD+o7nB+lDabal6pA+zqHAV4r/OehXvVqbEd erLcc6hVjTBiRAg+hG3mNf9uorIMZldbKJtMm/XQfQ0FFsEdtGWLlOEaHh5iITZn VsOT9Y2ExWTKoHxyg5wtsdb1k3ug= 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; s=default; bh=BaP2g3PqmKaRq/fSH9emr QHdAxc=; b=sXo0cLaXmC1FXPqo+bDF5E+VwNK7IgwoWDcc/3LwBGG6t7dzLAIaQ /IZh6lYhOA7KS0O42Uq1HR9wgwIoce1jxmUCt6wVH59iit3wlyVVIhcG4WMjpMjF C8DNgQujqFZ0Xnlsjq2Km07bDPJsI+YmfYhxjiCNOganA8mQJj4nIs= Received: (qmail 118676 invoked by alias); 24 Sep 2018 13:20:34 -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 118560 invoked by uid 89); 24 Sep 2018 13:20:33 -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= 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:31 +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 1/2] Check pie_enabled target in PIC tests Date: Mon, 24 Sep 2018 06:19:39 -0700 Message-Id: <20180924131940.31953-1-hjl.tools@gmail.com> X-IsSubscribed: yes We need to check pie_enabled target in PIC tests to support GCC where PIE is enabled by default when configured with --enable-default-pie. PR testsuite/70150 * gcc.dg/20020312-2.c (dg-additional-options): Set to "-no-pie" for pie_enabled target. * gcc.dg/uninit-19.c: Check pie_enabled for PIC. * gcc.target/i386/pr34256.c: Likewise. --- gcc/testsuite/gcc.dg/20020312-2.c | 1 + gcc/testsuite/gcc.dg/uninit-19.c | 4 ++-- gcc/testsuite/gcc.target/i386/pr34256.c | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gcc/testsuite/gcc.dg/20020312-2.c b/gcc/testsuite/gcc.dg/20020312-2.c index f8be3ce2964..1a8afd81506 100644 --- a/gcc/testsuite/gcc.dg/20020312-2.c +++ b/gcc/testsuite/gcc.dg/20020312-2.c @@ -7,6 +7,7 @@ /* { dg-do run } */ /* { dg-options "-O -fno-pic" } */ +/* { dg-additional-options "-no-pie" { target pie_enabled } } */ /* { dg-require-effective-target nonlocal_goto } */ extern void abort (void); diff --git a/gcc/testsuite/gcc.dg/uninit-19.c b/gcc/testsuite/gcc.dg/uninit-19.c index 094dc0eb73d..3f5f06af540 100644 --- a/gcc/testsuite/gcc.dg/uninit-19.c +++ b/gcc/testsuite/gcc.dg/uninit-19.c @@ -12,7 +12,7 @@ fn1 (int p1, float *f1, float *f2, float *f3, unsigned char *c1, float *f4, { if (p1 & 8) b[3] = p10[a]; - /* { dg-warning "may be used uninitialized" "" { target { { nonpic } || { hppa*64*-*-* } } } .-1 } */ + /* { dg-warning "may be used uninitialized" "" { target { { nonpic || pie_enabled } || { hppa*64*-*-* } } } .-1 } */ } void @@ -22,5 +22,5 @@ fn2 () if (l & 6) n = &c + m; fn1 (l, &d, &e, &g, &i, &h, &k, n); - /* { dg-warning "may be used uninitialized" "" { target { ! { { nonpic } || { hppa*64*-*-* } } } } .-1 } */ + /* { dg-warning "may be used uninitialized" "" { target { ! { { nonpic || pie_enabled } || { hppa*64*-*-* } } } } .-1 } */ } diff --git a/gcc/testsuite/gcc.target/i386/pr34256.c b/gcc/testsuite/gcc.target/i386/pr34256.c index 992312a4f26..698745765d8 100644 --- a/gcc/testsuite/gcc.target/i386/pr34256.c +++ b/gcc/testsuite/gcc.target/i386/pr34256.c @@ -10,5 +10,5 @@ unsigned long long foo(__m64 m) { return _mm_cvtm64_si64(_mm_add_pi32(x, y)); } -/* { dg-final { scan-assembler-times "mov" 2 { target nonpic } } } */ -/* { dg-final { scan-assembler-times "mov" 4 { target { ! nonpic } } } } */ +/* { dg-final { scan-assembler-times "mov" 2 { target { nonpic || pie_enabled } } } } */ +/* { dg-final { scan-assembler-times "mov" 4 { target { { ! nonpic } && { ! pie_enabled } } } } } */ 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 } } } } } */