From patchwork Wed Dec 21 20:13:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 132730 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 5D7D3B7134 for ; Thu, 22 Dec 2011 07:14:00 +1100 (EST) Received: (qmail 2714 invoked by alias); 21 Dec 2011 20:13:56 -0000 Received: (qmail 2704 invoked by uid 22791); 21 Dec 2011 20:13:52 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, TW_ZJ X-Spam-Check-By: sourceware.org Received: from mail-yw0-f47.google.com (HELO mail-yw0-f47.google.com) (209.85.213.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 21 Dec 2011 20:13:36 +0000 Received: by yhoo47 with SMTP id o47so5444639yho.20 for ; Wed, 21 Dec 2011 12:13:35 -0800 (PST) MIME-Version: 1.0 Received: by 10.236.187.97 with SMTP id x61mr11422603yhm.97.1324498415912; Wed, 21 Dec 2011 12:13:35 -0800 (PST) Received: by 10.147.133.6 with HTTP; Wed, 21 Dec 2011 12:13:35 -0800 (PST) Date: Wed, 21 Dec 2011 21:13:35 +0100 Message-ID: Subject: [PATCH, i386]: Enable flag_ree also on 32bit targets From: Uros Bizjak To: gcc-patches@gcc.gnu.org Cc: Ilya Enkovich 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 Hello! As shown by pr50038.c testcase, recent redundant extension insns improvements also benefit 32bit targets. Attached patch enables this pass for all x86 targets. The patch also moves the testcase to better place. 2011-12-21 Uros Bizjak * config/i386/i386.c (ix86_option_override_internal): Enable flag_ree also for 32bit targets. testsuite/ChangeLog: 2011-12-21 Uros Bizjak * gcc.dg/pr50038.c: Move to ... * gcc.target/i386/pr50038.c: ... here. Test on all targets. Tested on x86_64-pc-linux-gnu {,-m32}, committed to mainline SVN. Uros. Index: i386.c =================================================================== --- i386.c (revision 182601) +++ i386.c (working copy) @@ -3445,12 +3445,14 @@ ix86_option_override_internal (bool main_args_p) #define USE_X86_64_FRAME_POINTER 0 #endif + /* Enable redundant extension instructions removal at -O2 and higher. */ + if (optimize >= 2 && !global_options_set.x_flag_ree) + flag_ree = 1; + /* Set the default values for switches whose default depends on TARGET_64BIT in case they weren't overwritten by command line options. */ if (TARGET_64BIT) { - if (optimize > 1 && !global_options_set.x_flag_ree) - flag_ree = 1; if (optimize >= 1 && !global_options_set.x_flag_omit_frame_pointer) flag_omit_frame_pointer = !USE_X86_64_FRAME_POINTER; if (flag_asynchronous_unwind_tables == 2)