From patchwork Sun Jan 22 14:52:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 137243 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 F317DB6FA2 for ; Mon, 23 Jan 2012 01:52:54 +1100 (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=1327848776; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:To:Cc:Subject:Date:Message-ID:User-Agent: MIME-Version:Content-Type:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=CznkhrupgLrxgIA6nC42KHYfPxA=; b=yKjCF3v9Tu0p6vh N4UCgDusDSYAQ1EAaUh1XJQJXcmqV1rkfJRKGcftmB8oeGFBNZZteqN8kKsqvGbU kThB+9u5F8sf7dZGwyLWupX+ZgOuTQko8/lb/k3sYTRdKYYZW32fusruRYcoWU50 6IO8afr6GZtcJYe03c9YdW6Rq4Us= 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:X-Auth-Info:Received:Received:From:To:Cc:Subject:X-Yow:Date:Message-ID:User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=rgyhiOxIakHO+G6JAgYWhH/AoO294Anq2eGvfaahAhIwq2V6gJtkSR42uMcPKg VC8tvzhWxAFjvqWGlojRcSmWQ00NIGIeZpQ5xWNLNGfX3i1d+wip89rLwezFLK+v XSEar79FLAWOW7gHpVD9Fk2/WX0mx22RHq1VXIai1C6FQ=; Received: (qmail 20057 invoked by alias); 22 Jan 2012 14:52:51 -0000 Received: (qmail 20040 invoked by uid 22791); 22 Jan 2012 14:52:50 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mail-out.m-online.net (HELO mail-out.m-online.net) (212.18.0.9) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 22 Jan 2012 14:52:36 +0000 Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id E2C3C1C00B33; Sun, 22 Jan 2012 15:52:34 +0100 (CET) X-Auth-Info: nOZVm0JO9+e/u3jpQ3xYlH82GG1hOKazBwfSOiCJvEc= Received: from igel.home (ppp-93-104-157-111.dynamic.mnet-online.de [93.104.157.111]) by mail.mnet-online.de (Postfix) with ESMTPA id 628F21C001BE; Sun, 22 Jan 2012 15:52:34 +0100 (CET) Received: by igel.home (Postfix, from userid 501) id 12628CA29E; Sun, 22 Jan 2012 15:52:34 +0100 (CET) From: Andreas Schwab To: gcc-patches@gcc.gnu.org, java-patches@gcc.gnu.org Cc: Joseph Myers Subject: Fix flag_trapping_math in java frontend X-Yow: .. I think I'd better go back to my DESK and toy with a few common MISAPPREHENSIONS... Date: Sun, 22 Jan 2012 15:52:33 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 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 The java frontend wants that floating point operations are assumed to never trap, thus clears flag_trapping_math in java_init_options_struct. But this is no longer effective after revision 165823, because set_fast_math_flags is now always called during option processing, overriding anything what the frontend did to flag_trapping_math. This is an amendment to revision 169930 which introduced frontend_set_flag_trapping_math, but didn't set it in java_init_options_struct. While this was found during examination of PR49847, this doesn't fix it, but only makes the bug dormant again in 4.6. Tested on powerpc-linux, ok for trunk and 4.6 branch? Andreas. 2012-01-22 Andreas Schwab * lang.c (java_init_options_struct): Set frontend_set_flag_trapping_math. diff --git a/gcc/java/lang.c b/gcc/java/lang.c index ccab48c..da7dd05 100644 --- a/gcc/java/lang.c +++ b/gcc/java/lang.c @@ -1,6 +1,6 @@ /* Java(TM) language-specific utility routines. Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008, 2010 Free Software Foundation, Inc. + 2005, 2006, 2007, 2008, 2010, 2012 Free Software Foundation, Inc. This file is part of GCC. @@ -550,6 +550,7 @@ java_init_options_struct (struct gcc_options *opts) /* In Java floating point operations never trap. */ opts->x_flag_trapping_math = 0; + opts->frontend_set_flag_trapping_math = true; /* In Java arithmetic overflow always wraps around. */ opts->x_flag_wrapv = 1;