This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug java/16451] New: [3.5 regression] Class Initialisation Check Optimisation Lost With Tree-SSA
- From: "rmathew at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Jul 2004 13:42:27 -0000
- Subject: [Bug java/16451] New: [3.5 regression] Class Initialisation Check Optimisation Lost With Tree-SSA
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Post tree-ssa merge, we lost the little hack that
implemented this class initialisation optimisation:
http://gcc.gnu.org/ml/java/1999-q3/msg00124.html
Moreover, emit_init_test_initialization() which implemented
it was removed by this patch:
http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00743.html
We need to restore the same hack (or something that
achieves the same optimisation) using trees.
The body of the said function looked like this before
it was removed:
-/* Called for every element in DECL_FUNCTION_INIT_TEST_TABLE of a
- method in order to emit initialization code for each test flag. */
-
-static int
-emit_init_test_initialization (void **entry, void *x ATTRIBUTE_UNUSED)
-{
- struct treetreehash_entry *ite = (struct treetreehash_entry *) *entry;
- tree klass = build_class_ref (ite->key);
- tree rhs;
-
- /* If the DECL_INITIAL of the test flag is set to true, it
- means that the class is already initialized the time it
- is in use. */
- if (DECL_INITIAL (ite->value) == boolean_true_node)
- rhs = boolean_true_node;
- /* Otherwise, we initialize the class init check variable by looking
- at the `state' field of the class to see if it is already
- initialized. This makes things a bit faster if the class is
- already initialized, which should be the common case. */
- else
- rhs = build (GE_EXPR, boolean_type_node,
- build (COMPONENT_REF, byte_type_node,
- build1 (INDIRECT_REF, class_type_node, klass),
- lookup_field (&class_type_node,
- get_identifier ("state")),
- NULL_TREE),
- build_int_2 (JV_STATE_DONE, 0));
-
- expand_expr_stmt (build (MODIFY_EXPR, boolean_type_node,
- ite->value, rhs));
- return true;
-}
-
--
Summary: [3.5 regression] Class Initialisation Check Optimisation
Lost With Tree-SSA
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: java
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rmathew at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16451