public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/16867] New: Inline array initializer miscompilation at -O
@ 2004-08-03 20:47 mckinlay at redhat dot com
  2004-08-03 20:49 ` [Bug java/16867] " mckinlay at redhat dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: mckinlay at redhat dot com @ 2004-08-03 20:47 UTC (permalink / raw)
  To: java-prs

The following test case fails when compiled with mainline at -O. This is a
regression since 3.4.

public class ArrayInit
{
  public static Object[] getFoo()
  {
    return new Object[] {"OK"};
  }

  public static void main(String[] args)
  {
    Object[] a = getFoo();
    System.out.println(a[0]);
  }
}

-- 
           Summary: Inline array initializer miscompilation at -O
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          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=16867


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

* [Bug java/16867] Inline array initializer miscompilation at -O
  2004-08-03 20:47 [Bug java/16867] New: Inline array initializer miscompilation at -O mckinlay at redhat dot com
@ 2004-08-03 20:49 ` mckinlay at redhat dot com
  2004-08-03 20:55 ` [Bug tree-optimization/16867] [3.5 Regression] " pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: mckinlay at redhat dot com @ 2004-08-03 20:49 UTC (permalink / raw)
  To: java-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
      Known to work|                            |3.3.3 3.4.2


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


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

* [Bug tree-optimization/16867] [3.5 Regression] Inline array initializer miscompilation at -O
  2004-08-03 20:47 [Bug java/16867] New: Inline array initializer miscompilation at -O mckinlay at redhat dot com
  2004-08-03 20:49 ` [Bug java/16867] " mckinlay at redhat dot com
@ 2004-08-03 20:55 ` pinskia at gcc dot gnu dot org
  2004-08-03 22:24 ` mckinlay at redhat dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-03 20:55 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-08-03 20:55 -------
Confirmed, this is a CD-DCE bug.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |steven at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
          Component|java                        |tree-optimization
     Ever Confirmed|                            |1
      Known to fail|                            |3.5.0
      Known to work|3.3.3 3.4.2                 |3.4.0
   Last reconfirmed|0000-00-00 00:00:00         |2004-08-03 20:55:18
               date|                            |
            Summary|Inline array initializer    |[3.5 Regression] Inline
                   |miscompilation at -O        |array initializer
                   |                            |miscompilation at -O
   Target Milestone|---                         |3.5.0


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


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

* [Bug tree-optimization/16867] [3.5 Regression] Inline array initializer miscompilation at -O
  2004-08-03 20:47 [Bug java/16867] New: Inline array initializer miscompilation at -O mckinlay at redhat dot com
  2004-08-03 20:49 ` [Bug java/16867] " mckinlay at redhat dot com
  2004-08-03 20:55 ` [Bug tree-optimization/16867] [3.5 Regression] " pinskia at gcc dot gnu dot org
@ 2004-08-03 22:24 ` mckinlay at redhat dot com
  2004-08-09 10:04 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: mckinlay at redhat dot com @ 2004-08-03 22:24 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From mckinlay at redhat dot com  2004-08-03 22:24 -------
FYI making this change in tree-ssa-dce works around the problem:

--- tree-ssa-dce.c      28 Jul 2004 05:13:08 -0000      2.11
+++ tree-ssa-dce.c      3 Aug 2004 22:23:24 -0000
@@ -393,7 +393,6 @@
   for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++)
     {
       tree v_may_def = V_MAY_DEF_RESULT (v_may_defs, i);
-      if (need_to_preserve_store (v_may_def))
        {
          mark_stmt_necessary (stmt, true);
          return;


-- 


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


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

* [Bug tree-optimization/16867] [3.5 Regression] Inline array initializer miscompilation at -O
  2004-08-03 20:47 [Bug java/16867] New: Inline array initializer miscompilation at -O mckinlay at redhat dot com
                   ` (2 preceding siblings ...)
  2004-08-03 22:24 ` mckinlay at redhat dot com
@ 2004-08-09 10:04 ` pinskia at gcc dot gnu dot org
  2004-08-09 10:29 ` steven 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-08-09 10:04 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-08-09 10:04 -------
*** Bug 16930 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fw at deneb dot enyo dot de


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


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

* [Bug tree-optimization/16867] [3.5 Regression] Inline array initializer miscompilation at -O
  2004-08-03 20:47 [Bug java/16867] New: Inline array initializer miscompilation at -O mckinlay at redhat dot com
                   ` (3 preceding siblings ...)
  2004-08-09 10:04 ` pinskia at gcc dot gnu dot org
@ 2004-08-09 10:29 ` steven at gcc dot gnu dot org
  2004-08-09 11:32 ` fw at deneb dot enyo dot de
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: steven at gcc dot gnu dot org @ 2004-08-09 10:29 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From steven at gcc dot gnu dot org  2004-08-09 10:29 -------
Pinski, will you _please_ stop making unfounded comments on
the cause of bugs?  You've done this many times now and you
are usually wrong.  Please _check_ before you blame someone.

This is _NOT_ a CDDCE bug.  CDDCE is only enabled at -O2 and
higher, so if this bug already shows at -O then it's not a
CDDCE bug, simple as that.



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


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


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

* [Bug tree-optimization/16867] [3.5 Regression] Inline array initializer miscompilation at -O
  2004-08-03 20:47 [Bug java/16867] New: Inline array initializer miscompilation at -O mckinlay at redhat dot com
                   ` (4 preceding siblings ...)
  2004-08-09 10:29 ` steven at gcc dot gnu dot org
@ 2004-08-09 11:32 ` fw at deneb dot enyo dot de
  2004-08-09 20:11 ` mckinlay at redhat dot com
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: fw at deneb dot enyo dot de @ 2004-08-09 11:32 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From fw at deneb dot enyo dot de  2004-08-09 11:32 -------
(In reply to comment #4)
> This is _NOT_ a CDDCE bug.  CDDCE is only enabled at -O2 and
> higher, so if this bug already shows at -O then it's not a
> CDDCE bug, simple as that.

Just to clarify, the store is removed during the second DCE pass (which is
labeled "cddce", but only performs normal, non-aggressive DCE at -O1).

-- 


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


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

* [Bug tree-optimization/16867] [3.5 Regression] Inline array initializer miscompilation at -O
  2004-08-03 20:47 [Bug java/16867] New: Inline array initializer miscompilation at -O mckinlay at redhat dot com
                   ` (5 preceding siblings ...)
  2004-08-09 11:32 ` fw at deneb dot enyo dot de
@ 2004-08-09 20:11 ` mckinlay at redhat dot com
  2004-08-12 14:34 ` cvs-commit at gcc dot gnu dot org
  2004-08-12 14:39 ` dnovillo at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: mckinlay at redhat dot com @ 2004-08-09 20:11 UTC (permalink / raw)
  To: java-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |dnovillo at redhat dot com
                   |dot org                     |
             Status|NEW                         |ASSIGNED


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


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

* [Bug tree-optimization/16867] [3.5 Regression] Inline array initializer miscompilation at -O
  2004-08-03 20:47 [Bug java/16867] New: Inline array initializer miscompilation at -O mckinlay at redhat dot com
                   ` (6 preceding siblings ...)
  2004-08-09 20:11 ` mckinlay at redhat dot com
@ 2004-08-12 14:34 ` cvs-commit at gcc dot gnu dot org
  2004-08-12 14:39 ` dnovillo at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-08-12 14:34 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-08-12 14:34 -------
Subject: Bug 16867

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	dnovillo@gcc.gnu.org	2004-08-12 14:34:12

Modified files:
	gcc            : ChangeLog tree-dfa.c tree-flow-inline.h 
	                 tree-gimple.c tree-ssa-alias.c tree-ssa-dce.c 
	                 tree-ssa-operands.c tree.c tree.h 
	libjava        : ChangeLog 
Added files:
	libjava/testsuite/libjava.lang: PR16867.java PR16867.out 

Log message:
	PR tree-optimization/16867
	* tree.c (is_global_var): New function.
	(needs_to_live_in_memory): Check for TREE_ADDRESSABLE.
	Call is_global_var.
	* tree.h (DECL_NEEDS_TO_LIVE_IN_MEMORY_INTERNAL): Remove.
	Update all users.
	(is_global_var): Declare.
	* tree-dfa.c (dump_variable): Display global and addressable
	attributes.
	(add_referenced_var): Clarify documentation when marking
	variables call-clobbered.
	* tree-flow-inline.h (is_call_clobbered): Call is_global_var
	instead of needs_to_live_in_memory.
	(mark_call_clobbered): If the variable is a tag, mark it
	DECL_EXTERNAL.
	* tree-gimple.c (is_gimple_reg): Don't check for
	TREE_ADDRESSABLE.
	(is_gimple_non_addressable): Likewise.
	* tree-ssa-alias.c (get_nmt_for): Always check whether the tag
	needs to be marked call-clobbered.
	(setup_pointers_and_addressables): Call is_global_var instead
	of needs_to_live_in_memory.
	* tree-ssa-dce.c (need_to_preserve_store): Remove.
	Update all users with is_global_var.
	(mark_stmt_if_obviously_necessary): Fix processing of aliased
	stores.  Don't check the virtual definitions.  Rather, check
	whether the store is going into global memory.
	(find_obviously_necessary_stmts): Get the symbol from the PHI
	result.
	* tree-ssa-operands.c (get_call_expr_operands): Do not add
	clobbering may-defs if the call does not have side effects.
	
	libjava/ChangeLog
	
	PR tree-optimization/16867
	* testsuite/libjava.lang/PR16867.java: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.4879&r2=2.4880
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-dfa.c.diff?cvsroot=gcc&r1=2.22&r2=2.23
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-flow-inline.h.diff?cvsroot=gcc&r1=2.19&r2=2.20
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-gimple.c.diff?cvsroot=gcc&r1=2.20&r2=2.21
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-alias.c.diff?cvsroot=gcc&r1=2.22&r2=2.23
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-dce.c.diff?cvsroot=gcc&r1=2.11&r2=2.12
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-operands.c.diff?cvsroot=gcc&r1=2.28&r2=2.29
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree.c.diff?cvsroot=gcc&r1=1.408&r2=1.409
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree.h.diff?cvsroot=gcc&r1=1.586&r2=1.587
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/ChangeLog.diff?cvsroot=gcc&r1=1.2996&r2=1.2997
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/testsuite/libjava.lang/PR16867.java.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/testsuite/libjava.lang/PR16867.out.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

* [Bug tree-optimization/16867] [3.5 Regression] Inline array initializer miscompilation at -O
  2004-08-03 20:47 [Bug java/16867] New: Inline array initializer miscompilation at -O mckinlay at redhat dot com
                   ` (7 preceding siblings ...)
  2004-08-12 14:34 ` cvs-commit at gcc dot gnu dot org
@ 2004-08-12 14:39 ` dnovillo at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2004-08-12 14:39 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From dnovillo at gcc dot gnu dot org  2004-08-12 14:39 -------

It was a DCE bug exacerbated by confusing information given by the dataflow
framework.  Fixed with:

http://gcc.gnu.org/ml/gcc-patches/2004-08/msg00728.html

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2004-08-12 14:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-03 20:47 [Bug java/16867] New: Inline array initializer miscompilation at -O mckinlay at redhat dot com
2004-08-03 20:49 ` [Bug java/16867] " mckinlay at redhat dot com
2004-08-03 20:55 ` [Bug tree-optimization/16867] [3.5 Regression] " pinskia at gcc dot gnu dot org
2004-08-03 22:24 ` mckinlay at redhat dot com
2004-08-09 10:04 ` pinskia at gcc dot gnu dot org
2004-08-09 10:29 ` steven at gcc dot gnu dot org
2004-08-09 11:32 ` fw at deneb dot enyo dot de
2004-08-09 20:11 ` mckinlay at redhat dot com
2004-08-12 14:34 ` cvs-commit at gcc dot gnu dot org
2004-08-12 14:39 ` dnovillo 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).