This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: patch in handling of finit$
Alexandre Petit-Bianco wrote:
> Per Bothner writes:
>
>
>>This patch fixes a problem that causes finit$ calls to get dropped
>>when generating bytecode.
>>
>
> There was PR and a patch covering this issue:
>
> http://gcc.gnu.org/ml/java-prs/2002-q1/msg00082.html
>
> I updated it.
Hm. It's a different patch and different failure mode.
From my quick test, it appears my patch fixes the testcase
in the PR. I haven't checked if the PR's patch fixes my
testcase, but since my patch is simpler, I prefer it anyway.
--
--Per Bothner
per@bothner.com http://www.bothner.com/per/
2002-02-20 Per Bothner <per@bothner.com>
* parse.y (patch_method_invocation): Set CAN_COMPLETE_NORMALLY on call
to finit$ (otherwise generate_bytecode_insns drops it). However, we
don't need to set it on the COMPOUND_EXPR - the caller does that.
Index: parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.352
diff -u -p -r1.352 parse.y
--- parse.y 2002/02/20 19:53:48 1.352
+++ parse.y 2002/02/20 19:55:24
@@ -10514,9 +10514,9 @@ patch_method_invocation (patch, primary,
/* Generate the code used to initialize fields declared with an
initialization statement and build a compound statement along
with the super constructor invocation. */
+ CAN_COMPLETE_NORMALLY (patch) = 1;
patch = build (COMPOUND_EXPR, void_type_node, patch,
java_complete_tree (finit_call));
- CAN_COMPLETE_NORMALLY (patch) = 1;
}
return patch;
}