public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/19295] New: Incorrect bytecode produced for bitwise AND
@ 2005-01-06 19:14 overholt at redhat dot com
  2005-01-06 19:15 ` [Bug java/19295] " overholt at redhat dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: overholt at redhat dot com @ 2005-01-06 19:14 UTC (permalink / raw)
  To: java-prs

This is a boiled-down test case from part of Eclipse.  gcj produces this bytecode:

Method name:"isArrayType" public final Signature: ()boolean
Attribute "Code", length:35, max_stack:3, max_locals:1, code_length:11
  0: aload_0
  1: getfield <Field Test2.tagBits long>
  4: i2l

which results in a verification failure because it's producing an i2l
instruction when there's a long on the stack.

gcj4 --version
gcj4 (GCC) 4.0.0 20041228 (Red Hat 4.0.0-0.17) (i686-pc-linux)

$ gcj4 -C Test2.java; gcj4 -findirect-dispatch -c Test2.class
Test2.java: In class 'Test2':
Test2.java: In method 'Test2.isArrayType()':
Test2.java:5: error: verification failed: incompatible type on stack
Test2.java:5: error: expected type 'int' but stack contains 'void'
Test2.java:5: confused by earlier errors, bailing out

-- 
           Summary: Incorrect bytecode produced for bitwise AND
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: overholt 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=19295


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

* [Bug java/19295] Incorrect bytecode produced for bitwise AND
  2005-01-06 19:14 [Bug java/19295] New: Incorrect bytecode produced for bitwise AND overholt at redhat dot com
@ 2005-01-06 19:15 ` overholt at redhat dot com
  2005-01-06 20:00 ` [Bug java/19295] [4.0 regression] " tromey at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: overholt at redhat dot com @ 2005-01-06 19:15 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From overholt at redhat dot com  2005-01-06 19:15 -------
Created an attachment (id=7884)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7884&action=view)
test case


-- 


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


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

* [Bug java/19295] [4.0 regression] Incorrect bytecode produced for bitwise AND
  2005-01-06 19:14 [Bug java/19295] New: Incorrect bytecode produced for bitwise AND overholt at redhat dot com
  2005-01-06 19:15 ` [Bug java/19295] " overholt at redhat dot com
@ 2005-01-06 20:00 ` tromey at gcc dot gnu dot org
  2005-01-06 20:04 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tromey at gcc dot gnu dot org @ 2005-01-06 20:00 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From tromey at gcc dot gnu dot org  2005-01-06 20:00 -------
I've investigated this a little.

The bug does not occur with gcj 3.3 or 3.4, so I am marking
it as a regression.

The trouble starts in fold_single_bit_test().  Here we transform
"tagBits & IsArrayType" into a new expression involving some
casts and an RSHIFT_EXPR.

The immediate problem seems to be that one of the casts looks like:
<nop_expr <unsigned long> <long>>
In this situation jcf-write emits i2l, which is incorrect.

Overall this is another instance of "we shouldn't use fold in gcj".
One possible fix might be to make fold_single_bit_test conditional
on the can_use_bit_fields_p langhook.
Another might be to change jcf-write to handle this sort of cast,
though I wonder if this can really be done safely.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Incorrect bytecode produced |[4.0 regression] Incorrect
                   |for bitwise AND             |bytecode produced for
                   |                            |bitwise AND


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


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

* [Bug java/19295] [4.0 regression] Incorrect bytecode produced for bitwise AND
  2005-01-06 19:14 [Bug java/19295] New: Incorrect bytecode produced for bitwise AND overholt at redhat dot com
  2005-01-06 19:15 ` [Bug java/19295] " overholt at redhat dot com
  2005-01-06 20:00 ` [Bug java/19295] [4.0 regression] " tromey at gcc dot gnu dot org
@ 2005-01-06 20:04 ` pinskia at gcc dot gnu dot org
  2005-01-19 18:52 ` mmitchel at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-06 20:04 UTC (permalink / raw)
  To: java-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |wrong-code
   Last reconfirmed|0000-00-00 00:00:00         |2005-01-06 20:04:12
               date|                            |
   Target Milestone|---                         |4.0.0


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


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

* [Bug java/19295] [4.0 regression] Incorrect bytecode produced for bitwise AND
  2005-01-06 19:14 [Bug java/19295] New: Incorrect bytecode produced for bitwise AND overholt at redhat dot com
                   ` (2 preceding siblings ...)
  2005-01-06 20:04 ` pinskia at gcc dot gnu dot org
@ 2005-01-19 18:52 ` mmitchel at gcc dot gnu dot org
  2005-01-19 19:24 ` steven at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-01-19 18:52 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2005-01-19 18:52 -------
Ada and Java bugs are not release-critical; therefore, I've removed the target
milsetone.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.0                       |---


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


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

* [Bug java/19295] [4.0 regression] Incorrect bytecode produced for bitwise AND
  2005-01-06 19:14 [Bug java/19295] New: Incorrect bytecode produced for bitwise AND overholt at redhat dot com
                   ` (3 preceding siblings ...)
  2005-01-19 18:52 ` mmitchel at gcc dot gnu dot org
@ 2005-01-19 19:24 ` steven at gcc dot gnu dot org
  2005-01-19 22:37 ` tromey at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-01-19 19:24 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From steven at gcc dot gnu dot org  2005-01-19 19:24 -------
Mark, can we keep known wrong-code bugs targeted for 4.0 please?  Java/Ada 
or other languages shouldn't make a difference for wrong code bugs.  They 
are the most serious kind we have. 
 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mark at codesourcery dot com


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


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

* [Bug java/19295] [4.0 regression] Incorrect bytecode produced for bitwise AND
  2005-01-06 19:14 [Bug java/19295] New: Incorrect bytecode produced for bitwise AND overholt at redhat dot com
                   ` (4 preceding siblings ...)
  2005-01-19 19:24 ` steven at gcc dot gnu dot org
@ 2005-01-19 22:37 ` tromey at gcc dot gnu dot org
  2005-01-19 22:44 ` mark at codesourcery dot com
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tromey at gcc dot gnu dot org @ 2005-01-19 22:37 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From tromey at gcc dot gnu dot org  2005-01-19 22:37 -------
I'm working on this.


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


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


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

* [Bug java/19295] [4.0 regression] Incorrect bytecode produced for bitwise AND
  2005-01-06 19:14 [Bug java/19295] New: Incorrect bytecode produced for bitwise AND overholt at redhat dot com
                   ` (5 preceding siblings ...)
  2005-01-19 22:37 ` tromey at gcc dot gnu dot org
@ 2005-01-19 22:44 ` mark at codesourcery dot com
  2005-01-24 14:34 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mark at codesourcery dot com @ 2005-01-19 22:44 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From mark at codesourcery dot com  2005-01-19 22:44 -------
Subject: Re:  [4.0 regression] Incorrect bytecode produced
 for bitwise AND

steven at gcc dot gnu dot org wrote:
> ------- Additional Comments From steven at gcc dot gnu dot org  2005-01-19 19:24 -------
> Mark, can we keep known wrong-code bugs targeted for 4.0 please?  Java/Ada 
> or other languages shouldn't make a difference for wrong code bugs.  They 
> are the most serious kind we have. 

I'm changing things so that only release-blockers have the 4.0 target. 
Java bugs are never release-blockers.  I'm writing up an email about 
this which I hope to send out today.

Thanks,



-- 


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


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

* [Bug java/19295] [4.0 regression] Incorrect bytecode produced for bitwise AND
  2005-01-06 19:14 [Bug java/19295] New: Incorrect bytecode produced for bitwise AND overholt at redhat dot com
                   ` (6 preceding siblings ...)
  2005-01-19 22:44 ` mark at codesourcery dot com
@ 2005-01-24 14:34 ` cvs-commit at gcc dot gnu dot org
  2005-01-24 14:41 ` pinskia at gcc dot gnu dot org
  2005-02-11 16:35 ` overholt at redhat dot com
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-01-24 14:34 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-01-24 14:34 -------
Subject: Bug 19295

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	sayle@gcc.gnu.org	2005-01-24 14:34:20

Modified files:
	gcc/java       : ChangeLog jcf-write.c 
	libjava        : ChangeLog 
Added files:
	libjava/testsuite/libjava.compile: PR19295.java 

Log message:
	PR java/19295
	* jcf-write.c (generate_bytecode_insns): Conversions between
	integer types of the same precision shouldn't generate widening
	or narrowing conversion bytecodes.
	
	* testsuite/libjava.compile/PR19295.java: New test case.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&r1=1.1532&r2=1.1533
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/jcf-write.c.diff?cvsroot=gcc&r1=1.159&r2=1.160
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/ChangeLog.diff?cvsroot=gcc&r1=1.3292&r2=1.3293
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/testsuite/libjava.compile/PR19295.java.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

* [Bug java/19295] [4.0 regression] Incorrect bytecode produced for bitwise AND
  2005-01-06 19:14 [Bug java/19295] New: Incorrect bytecode produced for bitwise AND overholt at redhat dot com
                   ` (7 preceding siblings ...)
  2005-01-24 14:34 ` cvs-commit at gcc dot gnu dot org
@ 2005-01-24 14:41 ` pinskia at gcc dot gnu dot org
  2005-02-11 16:35 ` overholt at redhat dot com
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-24 14:41 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-24 14:41 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.0.0


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


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

* [Bug java/19295] [4.0 regression] Incorrect bytecode produced for bitwise AND
  2005-01-06 19:14 [Bug java/19295] New: Incorrect bytecode produced for bitwise AND overholt at redhat dot com
                   ` (8 preceding siblings ...)
  2005-01-24 14:41 ` pinskia at gcc dot gnu dot org
@ 2005-02-11 16:35 ` overholt at redhat dot com
  9 siblings, 0 replies; 11+ messages in thread
From: overholt at redhat dot com @ 2005-02-11 16:35 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From overholt at redhat dot com  2005-02-10 23:46 -------
Verified.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |VERIFIED


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


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

end of thread, other threads:[~2005-02-10 23:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-06 19:14 [Bug java/19295] New: Incorrect bytecode produced for bitwise AND overholt at redhat dot com
2005-01-06 19:15 ` [Bug java/19295] " overholt at redhat dot com
2005-01-06 20:00 ` [Bug java/19295] [4.0 regression] " tromey at gcc dot gnu dot org
2005-01-06 20:04 ` pinskia at gcc dot gnu dot org
2005-01-19 18:52 ` mmitchel at gcc dot gnu dot org
2005-01-19 19:24 ` steven at gcc dot gnu dot org
2005-01-19 22:37 ` tromey at gcc dot gnu dot org
2005-01-19 22:44 ` mark at codesourcery dot com
2005-01-24 14:34 ` cvs-commit at gcc dot gnu dot org
2005-01-24 14:41 ` pinskia at gcc dot gnu dot org
2005-02-11 16:35 ` overholt at redhat dot com

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