From patchwork Mon Oct 28 20:57:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Kleen X-Patchwork-Id: 2003506 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=f3ciMG7l; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xcm1f5kBVz1xwF for ; Tue, 29 Oct 2024 07:57:57 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E26B73858429 for ; Mon, 28 Oct 2024 20:57:54 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) by sourceware.org (Postfix) with ESMTPS id 4DE0D3858D26; Mon, 28 Oct 2024 20:57:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4DE0D3858D26 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.intel.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=linux.intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4DE0D3858D26 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730149048; cv=none; b=sDmhnDAom6HZdkx3Sg1hlBG7ppd3tliH2H/kmVPv2LirPxLiTin5b0IHF0VOr0SJtGhFLd3WslKQr2b8Sa3xDN7wmeD0pJpjf/5yEe7r0Zn4AbUF1fQutn1JoYl2KaJUQ7MutGnox02NUXUJmtDcWLzaOekZaD51vmZJ7WNqhes= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730149048; c=relaxed/simple; bh=79ETvewIrjpJ2Bskr3jhAYe9akZ2g5k8IjROAsCSpm4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Utn/0p16XC032UjCr1sLUL5UtroBapPlk4eQ1omOtrmmMvkVSkvD3VsMtSuRsARscHGKsCQHshQJr9lAgTMvLCJe1N/3G7r1MSmgFcmXbrF1J1ffDE7LZUES/ilBUcX7hpKtJPnQVvgZOixwHqpJhUClf3qDqqBsmLIdG0gjz6E= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730149046; x=1761685046; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=79ETvewIrjpJ2Bskr3jhAYe9akZ2g5k8IjROAsCSpm4=; b=f3ciMG7l7NQJm3StG0CXpDQLd8aAIO/psFua9sfEBHTohOyMDn9doY5p szR54O2LBXjizSAoMO7SWy7696lRffAx7mPGBYPaiziRsHC3vX2t8uUpS PJQ/RS2CcRnD3OpI3WukXhBApaGq1emasACUADBaDq4pBchqz2JuX8vN8 hyZaR2OCTkbgR3TWzOf1idxRSbvC4Bw4gi/U4+YDUXZTR7gA1K8udznvo +1XG/G3Cfn4HHFavfMNIOON/nJY/znn1H2COCGeKGCzuN6Y3F8ybIDlGN 0uOb00/Di0tHteiag6Sat80Tz6mJKKpA+wwK/aEihzPQAio4ooahzdre+ A==; X-CSE-ConnectionGUID: 9Kd4ul+UQra0/oVQvQjS4Q== X-CSE-MsgGUID: KCCQsyTETmifP5lR5UEIlQ== X-IronPort-AV: E=McAfee;i="6700,10204,11239"; a="29975951" X-IronPort-AV: E=Sophos;i="6.11,240,1725346800"; d="scan'208";a="29975951" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Oct 2024 13:57:25 -0700 X-CSE-ConnectionGUID: 5JcSvAiwSHGzU1hc2pY9CA== X-CSE-MsgGUID: RHYJIbPwQWCwLY+HsLhsHw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,240,1725346800"; d="scan'208";a="82555730" Received: from tassilo.jf.intel.com ([10.54.38.190]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Oct 2024 13:57:25 -0700 From: Andi Kleen To: gcc-patches@gcc.gnu.org Cc: Andi Kleen Subject: [PATCH v2 1/3] Disable -fbit-tests and -fjump-tables at -O0 Date: Mon, 28 Oct 2024 13:57:17 -0700 Message-ID: <20241028205719.685557-1-ak@linux.intel.com> X-Mailer: git-send-email 2.46.2 MIME-Version: 1.0 X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org From: Andi Kleen gcc/ChangeLog: * common.opt: Enable -fbit-tests and -fjump-tables only at -O1. * opts.cc (default_options_table): Dito. --- gcc/common.opt | 4 ++-- gcc/opts.cc | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/common.opt b/gcc/common.opt index 12b25ff486de..70a22cdc71a4 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -2189,11 +2189,11 @@ Common Var(flag_ivopts) Init(1) Optimization Optimize induction variables on trees. fjump-tables -Common Var(flag_jump_tables) Init(1) Optimization +Common Var(flag_jump_tables) Init(0) Optimization Use jump tables for sufficiently large switch statements. fbit-tests -Common Var(flag_bit_tests) Init(1) Optimization +Common Var(flag_bit_tests) Init(0) Optimization Use bit tests for sufficiently large switch statements. fkeep-inline-functions diff --git a/gcc/opts.cc b/gcc/opts.cc index acd53befdbfc..7adc495a7c2a 100644 --- a/gcc/opts.cc +++ b/gcc/opts.cc @@ -610,6 +610,7 @@ static const struct default_options default_options_table[] = { OPT_LEVELS_1_PLUS, OPT_fvar_tracking, NULL, 1 }, /* -O1 (and not -Og) optimizations. */ + { OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fbit_tests, NULL, 1 }, { OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fbranch_count_reg, NULL, 1 }, #if DELAY_SLOTS { OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fdelayed_branch, NULL, 1 }, @@ -618,6 +619,7 @@ static const struct default_options default_options_table[] = { OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fif_conversion, NULL, 1 }, { OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fif_conversion2, NULL, 1 }, { OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_finline_functions_called_once, NULL, 1 }, + { OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fjump_tables, NULL, 1 }, { OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fmove_loop_invariants, NULL, 1 }, { OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fmove_loop_stores, NULL, 1 }, { OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fssa_phiopt, NULL, 1 },