public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
From: "rmathew at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: java-prs@gcc.gnu.org
Subject: [Bug java/16451] New: [3.5 regression] Class Initialisation Check Optimisation Lost With Tree-SSA
Date: Fri, 09 Jul 2004 13:42:00 -0000	[thread overview]
Message-ID: <20040709134225.16451.rmathew@gcc.gnu.org> (raw)

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


             reply	other threads:[~2004-07-09 13:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-09 13:42 rmathew at gcc dot gnu dot org [this message]
2004-07-09 13:55 ` [Bug java/16451] " rmathew at gcc dot gnu dot org
2004-07-09 16:51 ` pinskia at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040709134225.16451.rmathew@gcc.gnu.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=java-prs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).