From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4465 invoked by alias); 23 Jan 2012 10:59:52 -0000 Received: (qmail 4447 invoked by uid 22791); 23 Jan 2012 10:59:51 -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 X-Spam-Check-By: sourceware.org Received: from mail-tul01m020-f175.google.com (HELO mail-tul01m020-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 23 Jan 2012 10:59:38 +0000 Received: by obbuo9 with SMTP id uo9so3159274obb.20 for ; Mon, 23 Jan 2012 02:59:37 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.182.65 with SMTP id ec1mr7482845obc.6.1327316377621; Mon, 23 Jan 2012 02:59:37 -0800 (PST) Received: by 10.182.60.39 with HTTP; Mon, 23 Jan 2012 02:59:37 -0800 (PST) In-Reply-To: References: Date: Mon, 23 Jan 2012 10:59:00 -0000 Message-ID: Subject: Re: Fix flag_trapping_math in java frontend From: Richard Guenther To: Andreas Schwab Cc: gcc-patches@gcc.gnu.org, java-patches@gcc.gnu.org, Joseph Myers Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Mailing-List: contact java-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-patches-owner@gcc.gnu.org X-SW-Source: 2012-q1/txt/msg00012.txt.bz2 On Sun, Jan 22, 2012 at 3:52 PM, Andreas Schwab wro= te: > 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. =A0This > 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? Ok. Thanks, Richard. > Andreas. > > 2012-01-22 =A0Andreas Schwab =A0 > > =A0 =A0 =A0 =A0* lang.c (java_init_options_struct): Set > =A0 =A0 =A0 =A0frontend_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 @@ > =A0/* Java(TM) language-specific utility routines. > =A0 =A0Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, > - =A0 2005, 2006, 2007, 2008, 2010 Free Software Foundation, Inc. > + =A0 2005, 2006, 2007, 2008, 2010, 2012 Free Software Foundation, Inc. > > =A0This file is part of GCC. > > @@ -550,6 +550,7 @@ java_init_options_struct (struct gcc_options *opts) > > =A0 /* In Java floating point operations never trap. =A0*/ > =A0 opts->x_flag_trapping_math =3D 0; > + =A0opts->frontend_set_flag_trapping_math =3D true; > > =A0 /* In Java arithmetic overflow always wraps around. =A0*/ > =A0 opts->x_flag_wrapv =3D 1; > -- > 1.7.8.4 > > -- > Andreas Schwab, schwab@linux-m68k.org > GPG Key fingerprint =3D 58CA 54C7 6D53 942B 1756 =A001D3 44D5 214B 8276 4= ED5 > "And now for something completely different."