From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10733 invoked by alias); 15 Nov 2011 05:03:37 -0000 Received: (qmail 10724 invoked by uid 22791); 15 Nov 2011 05:03:36 -0000 X-SWARE-Spam-Status: No, hits=-7.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 15 Nov 2011 05:03:19 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pAF53JGq031232 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 15 Nov 2011 00:03:19 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id pAF53IYa009809; Tue, 15 Nov 2011 00:03:19 -0500 Received: from [10.3.113.72] (ovpn-113-72.phx2.redhat.com [10.3.113.72]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id pAF53GPJ016524; Tue, 15 Nov 2011 00:03:17 -0500 Message-ID: <4EC1F294.7010605@redhat.com> Date: Tue, 15 Nov 2011 07:52:00 -0000 From: Jeff Law User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1 MIME-Version: 1.0 To: Paolo Bonzini CC: Tom Tromey , gcc-patches Subject: RFA: disable -fdelete-null-pointer-checks for Java References: <4EB7AAF6.6060702@redhat.com> <4EB7FCAA.10100@redhat.com> <4EB80DD0.4070705@gnu.org> In-Reply-To: <4EB80DD0.4070705@gnu.org> Content-Type: multipart/mixed; boundary="------------020502030701090501030107" X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-11/txt/msg01709.txt.bz2 This is a multi-part message in MIME format. --------------020502030701090501030107 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-length: 989 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 11/07/11 09:56, Paolo Bonzini wrote: I'm not sure if GCC will currently delete the "if" statement in > > try { x = x.getSomething(); } catch (NullPointerException npe) { } > > if (x) ... > > but even if it doesn't, the Java front-end should probably reset > flag_delete_null_pointer_checks. Agreed. Bootstrapped and regression tested on x86_64-unknown-linux-gnu. OK for trunk? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJOwfKUAAoJEBRtltQi2kC74vUIALaNiAGCHwU0ysflj4ZfqNjx bMH/sUbkqCOx64xUbh43js8yPFvRZkcmLRgvJNc+D/XXhdvNbvGzWlFzzIgmjwnH +a6G+fkuL5FkxhA9IrNWTH/IbYqf0onfnhcgNKgMdhEgdMxfwiScocye68TP7CrB Jo/McnCe7xN9XVIvPTeSvz7q5mh5lOuoEhIFKyMGpFDE9vyMQpiPMkdZrNLwpmf7 IUS/V6Q6eIu9Z165DDMbR5DllQ7G9pclm7sZWmUgnF1jsIt22ZMhJPGJCyrSfSt3 efsxoT5pRoopbpdh0HAhQiS43KlPi75sQJwr73s48lhB4uPYEGjpj9JVniBB5l4= =82BQ -----END PGP SIGNATURE----- --------------020502030701090501030107 Content-Type: text/plain; name="P" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="P" Content-length: 687 * lang.c (java_init_options_struct): Disable optimizations which assume a NULL pointer dereference will cause a fault. Index: lang.c =================================================================== *** lang.c (revision 181321) --- lang.c (working copy) *************** java_init_options_struct (struct gcc_opt *** 556,561 **** --- 556,565 ---- /* Java requires left-to-right evaluation of subexpressions. */ opts->x_flag_evaluation_order = 1; + + /* Java catches catch NULL pointer exceptions, thus we can not necessarily + rely on a pointer having a non-NULL value after a dereference. */ + opts->x_flag_delete_null_pointer_checks = 0; } static void --------------020502030701090501030107--