From patchwork Tue Aug 29 17:03:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 807185 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-461102-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="WNiaDq20"; 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 3xhZjN29vlz9t3F for ; Wed, 30 Aug 2017 03:03:51 +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 :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=lzzm1lfOIV4wR2wQYkfE2TngprudmjHShtvS3uqJe6ZYBp CRh2AeNBgciZisBWUqZb6A1w69SrA1E6jHGXKwntGMkLTEQOCbk/db1TAg6OsLQJ GfmeiCfrAqq6KAvjIpt/h7SkDcFsKkOyrY2F9Gb9iqv7Wjo73wnycHRyoAglQ= 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 :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=AkVPpkBuwf9MlU3nJiV8Eit/RsQ=; b=WNiaDq20yPAEVbJDFZ+N ajbhAeHT3Pm1FiFchLJN5q97UxZRyAQ9iyGX0WF3xStLXSCD/8pfKyukypBYNojA MJO/3rBa6S/QEA5krwKi6K/WPaWgO6CCrZqg/EgC1BMdegYawlk97N1Rs01AQ0K8 G5uTLl7kHgmZcEE0hBxpVa4= Received: (qmail 41243 invoked by alias); 29 Aug 2017 17:03:43 -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 41192 invoked by uid 89); 29 Aug 2017 17:03:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-vk0-f53.google.com Received: from mail-vk0-f53.google.com (HELO mail-vk0-f53.google.com) (209.85.213.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 29 Aug 2017 17:03:32 +0000 Received: by mail-vk0-f53.google.com with SMTP id s199so11262172vke.1 for ; Tue, 29 Aug 2017 10:03:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=r2PeLMvT3V4k9W+oQSJZ+xojZZOqGHD3R3TcCDbUxzc=; b=XpwjEK2U1N4yhJzj8+B6+NijS5mAh8h/ZA7tTjNh0kvCOVzdIvXP4uhdjQMyK1rm3w QPl6l9oB0uHxA3dg/eWLgqwnG3QXllT1sFzu9B7V5Hbi9FTQiRK/NBVo82bSyIIT3k0n HSTjsihXT6lAlwHznm2RUN5Oe/rohqnw8SZ0JC0L+qwDnhpzTgiFtjaT2k7QlI12ImSK NhZcyoPOu2P42oizF97XeKxJF7qyJS/T+5R0cyjrQWSn6x9ginKWf4ixPpqIGlqeXGry 3IIhmenI1iYZdA9Lexp18NEdpBQ3kZE0wL8iewjbcc9iK3yBeEN6em51jq+Lf/VfHrmR 9bEQ== X-Gm-Message-State: AHYfb5i7xx7BRseQKPypDx7mnpQ9ynHIZFBKlgECpPf+M0/aZS/epHrD sZsIw4guMjnvAv2CoEMkS5etQ9Ypic3Y X-Received: by 10.31.86.197 with SMTP id k188mr667943vkb.196.1504026210105; Tue, 29 Aug 2017 10:03:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.55.28 with HTTP; Tue, 29 Aug 2017 10:03:29 -0700 (PDT) From: Uros Bizjak Date: Tue, 29 Aug 2017 19:03:29 +0200 Message-ID: Subject: [PATCH, i386]: Simplify setting of opts->x_flag_entry. To: "gcc-patches@gcc.gnu.org" Check opts_set->x_flag_fentry and remove check for non-existing PROFILE_BEFORE_PROLOGUE definition. 2017-08-29 Uros Bizjak * config/i386/i386.opt (flag_fentry): Do not init to -1. * config/i386/i386.c (ix86_option_override_internal): Simplify setting of opts->x_flag_entry. Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}. Committed to mainline SVN. Uros. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index b5c113d95aad..509fd3a26d5b 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -6545,27 +6545,18 @@ ix86_option_override_internal (bool main_args_p, opts->x_target_flags |= MASK_CLD & ~opts_set->x_target_flags; #endif - if (!TARGET_64BIT_P (opts->x_ix86_isa_flags) && opts->x_flag_pic) + /* Set the default value for -mfentry. */ + if (!opts_set->x_flag_fentry) + opts->x_flag_fentry = TARGET_SEH; + else { - if (opts->x_flag_fentry > 0) - sorry ("-mfentry isn%'t supported for 32-bit in combination " + if (!TARGET_64BIT_P (opts->x_ix86_isa_flags) && opts->x_flag_pic + && opts->x_flag_fentry) + sorry ("-mfentry isn%'t supported for 32-bit in combination " "with -fpic"); - opts->x_flag_fentry = 0; - } - else if (TARGET_SEH) - { - if (opts->x_flag_fentry == 0) + else if (TARGET_SEH && !opts->x_flag_fentry) sorry ("-mno-fentry isn%'t compatible with SEH"); - opts->x_flag_fentry = 1; } - else if (opts->x_flag_fentry < 0) - { -#if defined(PROFILE_BEFORE_PROLOGUE) - opts->x_flag_fentry = 1; -#else - opts->x_flag_fentry = 0; -#endif - } if (TARGET_SEH && TARGET_CALL_MS2SYSV_XLOGUES) sorry ("-mcall-ms2sysv-xlogues isn%'t currently supported with SEH"); diff --git a/gcc/config/i386/i386.opt b/gcc/config/i386/i386.opt index 8bf6af21fd18..81bbc1e2170a 100644 --- a/gcc/config/i386/i386.opt +++ b/gcc/config/i386/i386.opt @@ -862,7 +862,7 @@ Target Report Mask(ISA_PREFETCHWT1) Var(ix86_isa_flags) Save Support PREFETCHWT1 built-in functions and code generation. mfentry -Target Report Var(flag_fentry) Init(-1) +Target Report Var(flag_fentry) Emit profiling counter call at function entry before prologue. mrecord-mcount