public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/15576] New: Class initialization optimization is disabled
@ 2004-05-21 21:13 mckinlay at redhat dot com
  2004-05-21 21:34 ` [Bug java/15576] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: mckinlay at redhat dot com @ 2004-05-21 21:13 UTC (permalink / raw)
  To: java-prs

gcj used to perform an optimization which eliminated redundant class
initialization calls. For example, given the following example,
_Jv_InitClass(Foo) is called twice from Init.a() when it is only needed once:

class Foo 
{
  static int a;
  static int b;
}

public class Init
{
  int a()
  { 
    return Foo.a + Foo.b;
  }
}

This was done in expr.c build_class_init(), look for
LOCAL_CLASS_INITIALIZATION_FLAG. The optimization was turned off in tree-ssa
branch and needs to be updated to work with the gimplifier.

-- 
           Summary: Class initialization optimization is disabled
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mckinlay at redhat dot com
                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=15576


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug java/15576] Class initialization optimization is disabled
  2004-05-21 21:13 [Bug java/15576] New: Class initialization optimization is disabled mckinlay at redhat dot com
@ 2004-05-21 21:34 ` pinskia at gcc dot gnu dot org
  2004-05-21 23:32 ` mckinlay at redhat dot com
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-21 21:34 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-21 21:19 -------
Confirmed, could we make another attribute which says that it only touches the memory passed into 
the function and it is okay to remove if the agruments are the same as it will not do anything else, this 
will also help fortran's "pure" functions too.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-05-21 21:19:17
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15576


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug java/15576] Class initialization optimization is disabled
  2004-05-21 21:13 [Bug java/15576] New: Class initialization optimization is disabled mckinlay at redhat dot com
  2004-05-21 21:34 ` [Bug java/15576] " pinskia at gcc dot gnu dot org
@ 2004-05-21 23:32 ` mckinlay at redhat dot com
  2004-05-27  9:24 ` [Bug java/15576] [3.5 Regression] " pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: mckinlay at redhat dot com @ 2004-05-21 23:32 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From mckinlay at redhat dot com  2004-05-21 21:34 -------
Well, _Jv_InitClass isn't really a pure function, as class initialization has
side effects. However after it has been called the first time, all subsequent
calls have no effect.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15576


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug java/15576] [3.5 Regression] Class initialization optimization is disabled
  2004-05-21 21:13 [Bug java/15576] New: Class initialization optimization is disabled mckinlay at redhat dot com
  2004-05-21 21:34 ` [Bug java/15576] " pinskia at gcc dot gnu dot org
  2004-05-21 23:32 ` mckinlay at redhat dot com
@ 2004-05-27  9:24 ` pinskia at gcc dot gnu dot org
  2004-07-09 16:51 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-27  9:24 UTC (permalink / raw)
  To: java-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |3.5.0
      Known to work|                            |3.4.0
            Summary|Class initialization        |[3.5 Regression] Class
                   |optimization is disabled    |initialization optimization
                   |                            |is disabled
   Target Milestone|---                         |3.5.0
            Version|unknown                     |tree-ssa


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15576


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug java/15576] [3.5 Regression] Class initialization optimization is disabled
  2004-05-21 21:13 [Bug java/15576] New: Class initialization optimization is disabled mckinlay at redhat dot com
                   ` (2 preceding siblings ...)
  2004-05-27  9:24 ` [Bug java/15576] [3.5 Regression] " pinskia at gcc dot gnu dot org
@ 2004-07-09 16:51 ` pinskia at gcc dot gnu dot org
  2004-11-05  0:43 ` [Bug java/15576] [4.0 " pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-09 16:51 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-07-09 16:51 -------
*** Bug 16451 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rmathew at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15576


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug java/15576] [4.0 Regression] Class initialization optimization is disabled
  2004-05-21 21:13 [Bug java/15576] New: Class initialization optimization is disabled mckinlay at redhat dot com
                   ` (3 preceding siblings ...)
  2004-07-09 16:51 ` pinskia at gcc dot gnu dot org
@ 2004-11-05  0:43 ` pinskia at gcc dot gnu dot org
  2004-11-05  1:08 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-05  0:43 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-05 00:43 -------
I have a fix which just renables the orginal code plus fixes the other part of the front-end.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pinskia at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15576


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug java/15576] [4.0 Regression] Class initialization optimization is disabled
  2004-05-21 21:13 [Bug java/15576] New: Class initialization optimization is disabled mckinlay at redhat dot com
                   ` (4 preceding siblings ...)
  2004-11-05  0:43 ` [Bug java/15576] [4.0 " pinskia at gcc dot gnu dot org
@ 2004-11-05  1:08 ` pinskia at gcc dot gnu dot org
  2004-11-06  3:05 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-05  1:08 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-05 01:08 -------
I attached the patch which I am testing right now to fix this.
The changelog is:
* check-init.c (check_init): Ignore DECL_EXPR.
* expr.c (always_initialize_class_p): Reenable.
(build_class_init): Use a variable to store the decl.  Also use
boolean_false_node instead of integer_zero_node.
* parse.y (attach_init_test_initialization_flags): Add a decl_expr
to the block.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15576


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug java/15576] [4.0 Regression] Class initialization optimization is disabled
  2004-05-21 21:13 [Bug java/15576] New: Class initialization optimization is disabled mckinlay at redhat dot com
                   ` (5 preceding siblings ...)
  2004-11-05  1:08 ` pinskia at gcc dot gnu dot org
@ 2004-11-06  3:05 ` pinskia at gcc dot gnu dot org
  2004-11-09 14:34 ` cvs-commit at gcc dot gnu dot org
  2004-11-09 14:37 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-06  3:05 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-06 03:05 -------
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-11/msg00400.html>.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15576


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug java/15576] [4.0 Regression] Class initialization optimization is disabled
  2004-05-21 21:13 [Bug java/15576] New: Class initialization optimization is disabled mckinlay at redhat dot com
                   ` (6 preceding siblings ...)
  2004-11-06  3:05 ` pinskia at gcc dot gnu dot org
@ 2004-11-09 14:34 ` cvs-commit at gcc dot gnu dot org
  2004-11-09 14:37 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-11-09 14:34 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-11-09 14:34 -------
Subject: Bug 15576

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	pinskia@gcc.gnu.org	2004-11-09 14:33:36

Modified files:
	gcc/java       : ChangeLog check-init.c expr.c parse.y 

Log message:
	2004-11-09  Andrew Pinski  <pinskia@physics.uc.edu>
	
	PR java/15576
	* check-init.c (check_init): Ignore DECL_EXPR.
	* expr.c (always_initialize_class_p): Reenable.
	(build_class_init): Use a variable to store the decl.  Also use
	boolean_false_node instead of integer_zero_node.
	* parse.y (attach_init_test_initialization_flags): Add a decl_expr
	to the block.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&r1=1.1495&r2=1.1496
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/check-init.c.diff?cvsroot=gcc&r1=1.59&r2=1.60
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/expr.c.diff?cvsroot=gcc&r1=1.209&r2=1.210
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/parse.y.diff?cvsroot=gcc&r1=1.519&r2=1.520



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15576


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug java/15576] [4.0 Regression] Class initialization optimization is disabled
  2004-05-21 21:13 [Bug java/15576] New: Class initialization optimization is disabled mckinlay at redhat dot com
                   ` (7 preceding siblings ...)
  2004-11-09 14:34 ` cvs-commit at gcc dot gnu dot org
@ 2004-11-09 14:37 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-09 14:37 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-09 14:36 -------
Fixed, I filed PR 18399 for this optimization not working with the inliner.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |18399
              nThis|                            |
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15576


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-11-09 14:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-21 21:13 [Bug java/15576] New: Class initialization optimization is disabled mckinlay at redhat dot com
2004-05-21 21:34 ` [Bug java/15576] " pinskia at gcc dot gnu dot org
2004-05-21 23:32 ` mckinlay at redhat dot com
2004-05-27  9:24 ` [Bug java/15576] [3.5 Regression] " pinskia at gcc dot gnu dot org
2004-07-09 16:51 ` pinskia at gcc dot gnu dot org
2004-11-05  0:43 ` [Bug java/15576] [4.0 " pinskia at gcc dot gnu dot org
2004-11-05  1:08 ` pinskia at gcc dot gnu dot org
2004-11-06  3:05 ` pinskia at gcc dot gnu dot org
2004-11-09 14:34 ` cvs-commit at gcc dot gnu dot org
2004-11-09 14:37 ` pinskia at gcc dot gnu dot org

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).