public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/32939]  New: (int) cast return different results beetween .class and native
@ 2007-07-30 22:42 julian at casadesus dot com dot ar
  2007-07-30 23:12 ` [Bug libgcj/32939] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: julian at casadesus dot com dot ar @ 2007-07-30 22:42 UTC (permalink / raw)
  To: java-prs

This is an example code to reproduce the problem:
//---------------------------------------------
public class Test {
        public static void main(String[] s){
                log2( 1 );
                log2( 2 );
                log2( 4 );
                log2( 8 );
                log2( 16 );
                log2( 32 );
                log2( 64 );
        }

    public static void log2( int value ){
        double aux = (Math.log( value ) / Math.log(2.0) );
        int value1 = (int)aux;
        int value2 = (int)(Math.log( value ) / Math.log(2.0) );
        System.out.println( value1 + "  " + value2 );
    }
}
//---------------------------------------------

if i build it as .class file, it give that results:
gcj -C Test.java
gij Test
0  0
1  1
2  2
3  3
4  4
5  5
6  6

but if i build it as native:
gcj -c -o Test.o Test.java
gcj --main=Test -o Test Test.o
./Test
0  0
1  1
2  2
3  2
4  4
5  5
6  5


-- 
           Summary: (int) cast return different results beetween .class and
                    native
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcj
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: julian at casadesus dot com dot ar


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


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

* [Bug libgcj/32939] (int) cast return different results beetween .class and native
  2007-07-30 22:42 [Bug libgcj/32939] New: (int) cast return different results beetween .class and native julian at casadesus dot com dot ar
@ 2007-07-30 23:12 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-07-30 23:12 UTC (permalink / raw)
  To: java-prs



------- Comment #1 from pinskia at gcc dot gnu dot org  2007-07-30 23:12 -------
I think this was fixed for the trunk by removing the source code compiler.


-- 


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


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

end of thread, other threads:[~2007-07-30 23:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-30 22:42 [Bug libgcj/32939] New: (int) cast return different results beetween .class and native julian at casadesus dot com dot ar
2007-07-30 23:12 ` [Bug libgcj/32939] " 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).