This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: PR16867: Fix a long standing DCE bug
- From: Bryce McKinlay <mckinlay at redhat dot com>
- To: Ranjit Mathew <rmathew at gmail dot com>
- Cc: Diego Novillo <dnovillo at redhat dot com>, "java-patches at gcc dot gnu dot org" <java-patches at gcc dot gnu dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 12 Aug 2004 13:39:18 -0400
- Subject: Re: PR16867: Fix a long standing DCE bug
- References: <1092291946.7543.37.camel@localhost.localdomain> <411B3D86.8090906@gmail.com>
Ranjit Mathew wrote:
+ /* The SSA-DCE was removing the initialization of the temporary object
+ in getFoo because it wasn't realizing that the pointer was needed
+ outside of it. */
+
+ public class PR16867
+ {
+ public static Object[] getFoo()
+ {
+ return new Object[] {"OK"};
+ }
+
+ public static void main(String[] args)
+ {
+ Object[] a = getFoo();
+ System.out.println(a[0]);
+ }
+ }
FWIW, this test is already passing on the mainline
for me without your patch.
Even at -O1/-O2? It was still failing for me yesterday. Although
strangely, it did work at -O3.
Regards
Bryce