From patchwork Sun Jul 22 15:58:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Endo X-Patchwork-Id: 172521 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 79E9F2C0125 for ; Mon, 23 Jul 2012 01:59:15 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1343577556; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Subject:From:To:Date:Content-Type:Mime-Version: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=Me+7JiHqrnPO8Nf7Eawl xZPMCDU=; b=GLo2s4gnQjPE34t0fKA7cWOeYo7zucK9a3/+r095TYaLWwSv56WY RjaMQsqjKRHq7nGAVIqQ0Zvq+yk2XzhEtQ99+zc2jytXkzrPbPgVNKjNCjHamuSn TVnUox41ukhyk+rHHlDkLIFdSv4a+OAboZDQG470EMx4VUBgeBwazwg= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Message-ID:Subject:From:To:Date:Content-Type:Mime-Version:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=aXAKmVnjyLzo8HdmanW5Q6jJqpxBMo5VsWgnZlg6fUl2U3Hozhx5e5yuYakk6K aJYAYWRCtPF5HQ9p3Q+lyOCKbCLNdh74BSAeBqVIFnqaILFFB5vupNFMdATWGD2n +Dwv1P6fAVd15amGFkfvnpehm2QqznpWb9amzS/GrWYgI=; Received: (qmail 22465 invoked by alias); 22 Jul 2012 15:59:12 -0000 Received: (qmail 22452 invoked by uid 22791); 22 Jul 2012 15:59:11 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_HOSTKARMA_NO, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY X-Spam-Check-By: sourceware.org Received: from mailout08.t-online.de (HELO mailout08.t-online.de) (194.25.134.20) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 22 Jul 2012 15:58:56 +0000 Received: from fwd24.aul.t-online.de (fwd24.aul.t-online.de ) by mailout08.t-online.de with smtp id 1SsyYZ-0004ZI-GL; Sun, 22 Jul 2012 17:58:55 +0200 Received: from [192.168.0.100] (rCFwSwZEZhs4MR5v9FCiMj9H3RwTK7rh5wLZU56G3-PqOcu7OpxnXylXz0R15YYQuT@[87.157.52.231]) by fwd24.t-online.de with esmtp id 1SsyYY-0M1YsC0; Sun, 22 Jul 2012 17:58:54 +0200 Message-ID: <1342972733.2373.2.camel@yam-132-YW-E178-FTW> Subject: [SH] Backport PR 33135 fix to 4.7 and 4.6 From: Oleg Endo To: gcc-patches Date: Sun, 22 Jul 2012 17:58:53 +0200 Mime-Version: 1.0 X-IsSubscribed: yes 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, The attached patches fix PR 33135 on the 4.7 and 4.6 branches. Tested on both branches with 'make all' and 'make info dvi pdf'. OK to install? Cheers, Oleg ChangeLog: PR target/33135 * config/sh/sh.opt (mieee): Use Var instead of Mask. Correct description. * config/sh/sh.c (sh_option_override): Do not change flag_finite_math_only. Set TARGET_IEEE to complement of flag_finite_math_only. * doc/invoke.texi (SH options): Add mno-ieee. Correct description of mieee and mno-ieee behavior. Index: gcc/config/sh/sh.opt =================================================================== --- gcc/config/sh/sh.opt (revision 189755) +++ gcc/config/sh/sh.opt (working copy) @@ -270,8 +270,8 @@ Follow Renesas (formerly Hitachi) / SuperH calling conventions mieee -Target Report Mask(IEEE) -Increase the IEEE compliance for floating-point code +Target Var(TARGET_IEEE) +Increase the IEEE compliance for floating-point comparisons mindexed-addressing Target Report Mask(ALLOW_INDEXED_ADDRESS) Condition(SUPPORT_ANY_SH5_32MEDIA) Index: gcc/config/sh/sh.c =================================================================== --- gcc/config/sh/sh.c (revision 189755) +++ gcc/config/sh/sh.c (working copy) @@ -763,11 +763,6 @@ SUBTARGET_OVERRIDE_OPTIONS; if (optimize > 1 && !optimize_size) target_flags |= MASK_SAVE_ALL_TARGET_REGS; - if (flag_finite_math_only == 2) - flag_finite_math_only - = !flag_signaling_nans && TARGET_SH2E && ! TARGET_IEEE; - if (TARGET_SH2E && !flag_finite_math_only) - target_flags |= MASK_IEEE; sh_cpu = PROCESSOR_SH1; assembler_dialect = 0; if (TARGET_SH2) @@ -1007,6 +1002,11 @@ align_functions = min_align; } + /* If the -mieee option was not explicitly set by the user, turn it on + unless -ffinite-math-only was specified. See also PR 33135. */ + if (! global_options_set.x_TARGET_IEEE) + TARGET_IEEE = ! flag_finite_math_only; + if (sh_fixed_range_str) sh_fix_range (sh_fixed_range_str); Index: gcc/doc/invoke.texi =================================================================== --- gcc/doc/invoke.texi (revision 189755) +++ gcc/doc/invoke.texi (working copy) @@ -853,8 +853,8 @@ -m5-compact -m5-compact-nofpu @gol -mb -ml -mdalign -mrelax @gol -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol --mieee -mbitops -misize -minline-ic_invalidate -mpadstruct -mspace @gol --mprefergot -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol +-mieee -mno-ieee -mbitops -misize -minline-ic_invalidate -mpadstruct @gol +-mspace -mprefergot -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol -maccumulate-outgoing-args -minvalid-symbols} @@ -16938,13 +16938,15 @@ @option{-mhitachi} is given. @item -mieee +@item -mno-ieee @opindex mieee -Increase IEEE-compliance of floating-point code. -At the moment, this is equivalent to @option{-fno-finite-math-only}. -When generating 16 bit SH opcodes, getting IEEE-conforming results for -comparisons of NANs / infinities incurs extra overhead in every -floating point comparison, therefore the default is set to -@option{-ffinite-math-only}. +@opindex mnoieee +Control the IEEE compliance of floating-point comparisons, which affects the +handling of cases where the result of a comparison is unordered. By default +@option{-mieee} is implicitly enabled. If @option{-ffinite-math-only} is +enabled @option{-mno-ieee} is implicitly set, which results in faster +floating-point greater-equal and less-equal comparisons. The implcit settings +can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}. @item -minline-ic_invalidate @opindex minline-ic_invalidate