public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/10878] miscompilation of boolean parameters from bytecode
       [not found] <20030520081601.10878.szabo.daniel@dpg.hu>
@ 2003-05-25  2:49 ` pinskia@physics.uc.edu
  2003-06-02 16:33 ` pinskia@physics.uc.edu
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: pinskia@physics.uc.edu @ 2003-05-25  2:49 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia@physics.uc.edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


------- Additional Comments From pinskia@physics.uc.edu  2003-05-25 02:33 -------
Can you provide the source file?



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug java/10878] miscompilation of boolean parameters from bytecode
       [not found] <20030520081601.10878.szabo.daniel@dpg.hu>
  2003-05-25  2:49 ` [Bug java/10878] miscompilation of boolean parameters from bytecode pinskia@physics.uc.edu
@ 2003-06-02 16:33 ` pinskia@physics.uc.edu
  2003-06-03  9:02 ` szabo.daniel@dpg.hu
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: pinskia@physics.uc.edu @ 2003-06-02 16:33 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From pinskia@physics.uc.edu  2003-06-02 16:33 -------
I do not think it matters because because gcc always will load in it by a byte.
What do you think?

_ZN3bug2g1Eb:
        pushl   %ebp
        movl    %esp, %ebp        ; ebp = esp
        subl    $40, %esp             ; esp - = $40
        movl    12(%ebp), %eax ; eax = 12(ebp)
        movb    %al, -1(%ebp)    ;  -1(ebp) = al
        movl    8(%ebp), %eax   ; eax = 8(ebp)
        movl    %eax, -12(%ebp) ; -12(ebp) = eax
        cmpl    $0, -12(%ebp)
        jne     .L12
        call    _Jv_ThrowNullPointerException
.L12:
        movl    -12(%ebp), %eax   ; eax = -12(ebp)
        movl    %eax, (%esp)   ;(esp) = eax
        call    _ZN3bug2f1Ev
        movzbl  %al, %eax   eax = extend (al)
        testl   %eax, %eax    
        jne     .L13
        jmp     .L9
.L13:
        movl    $1, -8(%ebp)   -8(ebp) = 1
.L9:
        movl    8(%ebp), %eax    eax = 8(ebp)
        movl    -8(%ebp), %edx    edx = -8(ebp)
        movl    %edx, -16(%ebp)   -16(ebp) = edx
        movl    %eax, -20(%ebp)    -20(ebp) = eax
        cmpl    $0, -20(%ebp)       
        jne     .L15
        call    _Jv_ThrowNullPointerException
.L15:
        movl    -16(%ebp), %eax    eax = -16(ebp)
        movl    %eax, 4(%esp)         4(esp) = eax
        movl    -20(%ebp), %edx     -20(ebp) = edx
        movl    %edx, (%esp)     (esp) = edx
        call    _ZN3bug2g2Eb
        leave
        ret



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug java/10878] miscompilation of boolean parameters from bytecode
       [not found] <20030520081601.10878.szabo.daniel@dpg.hu>
  2003-05-25  2:49 ` [Bug java/10878] miscompilation of boolean parameters from bytecode pinskia@physics.uc.edu
  2003-06-02 16:33 ` pinskia@physics.uc.edu
@ 2003-06-03  9:02 ` szabo.daniel@dpg.hu
  2003-06-03 12:17 ` pinskia@physics.uc.edu
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: szabo.daniel@dpg.hu @ 2003-06-03  9:02 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3002 bytes --]

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From szabo.daniel@dpg.hu  2003-06-03 09:02 -------
Subject:   Re: miscompilation of boolean parameters from bytecode

It definitely matters. Compiled code runs with side effects (for sure, tested, that's why I was looking for what went wrong).
The problem is the _location_ on the stack:

storing parameter in local storage:

>         movb    %al, -1(%ebp)    ;  -1(ebp) = al

vs reading local storage and passing on:

>         movl    -8(%ebp), %edx    edx = -8(ebp)

setting the local storage _inside the function_ is correct:

>         movl    $1, -8(%ebp)   -8(ebp) = 1

the bogus code is the very first store op. it should read
movb    %al, -8(%ebp) 

just compare it to the second store op, where the second function parameter will be stored in local storage:

>         movl    %eax, -12(%ebp) ; -12(ebp) = eax


pinskia@physics.uc.edu  <gcc-bugzilla@gcc.gnu.org> 2003.06.02. 16:33:46-kor írta:

> PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10878
> 
> 
> 
> ------- Additional Comments From pinskia@physics.uc.edu  2003-06-02 16:33
> -------
> I do not think it matters because because gcc always will load in it by a
> byte.
> What do you think?
> 
> _ZN3bug2g1Eb:
>         pushl   %ebp
>         movl    %esp, %ebp        ; ebp = esp
>         subl    $40, %esp             ; esp - = $40
>         movl    12(%ebp), %eax ; eax = 12(ebp)
>         movb    %al, -1(%ebp)    ;  -1(ebp) = al
>         movl    8(%ebp), %eax   ; eax = 8(ebp)
>         movl    %eax, -12(%ebp) ; -12(ebp) = eax
>         cmpl    $0, -12(%ebp)
>         jne     .L12
>         call    _Jv_ThrowNullPointerException
> ..L12:
>         movl    -12(%ebp), %eax   ; eax = -12(ebp)
>         movl    %eax, (%esp)   ;(esp) = eax
>         call    _ZN3bug2f1Ev
>         movzbl  %al, %eax   eax = extend (al)
>         testl   %eax, %eax    
>         jne     .L13
>         jmp     .L9
> ..L13:
>         movl    $1, -8(%ebp)   -8(ebp) = 1
> ..L9:
>         movl    8(%ebp), %eax    eax = 8(ebp)
>         movl    -8(%ebp), %edx    edx = -8(ebp)
>         movl    %edx, -16(%ebp)   -16(ebp) = edx
>         movl    %eax, -20(%ebp)    -20(ebp) = eax
>         cmpl    $0, -20(%ebp)       
>         jne     .L15
>         call    _Jv_ThrowNullPointerException
> ..L15:
>         movl    -16(%ebp), %eax    eax = -16(ebp)
>         movl    %eax, 4(%esp)         4(esp) = eax
>         movl    -20(%ebp), %edx     -20(ebp) = edx
>         movl    %edx, (%esp)     (esp) = edx
>         call    _ZN3bug2g2Eb
>         leave
>         ret
> 
> 
> 
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.






------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug java/10878] miscompilation of boolean parameters from bytecode
       [not found] <20030520081601.10878.szabo.daniel@dpg.hu>
                   ` (2 preceding siblings ...)
  2003-06-03  9:02 ` szabo.daniel@dpg.hu
@ 2003-06-03 12:17 ` pinskia@physics.uc.edu
  2004-04-02  3:38 ` pinskia at gcc dot gnu dot org
  2004-07-04 23:45 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 6+ messages in thread
From: pinskia@physics.uc.edu @ 2003-06-03 12:17 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia@physics.uc.edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-06-03 12:17:38
               date|                            |


------- Additional Comments From pinskia@physics.uc.edu  2003-06-03 12:17 -------
I need to read the asm more cosely but you are right it does matter.



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug java/10878] miscompilation of boolean parameters from bytecode
       [not found] <20030520081601.10878.szabo.daniel@dpg.hu>
                   ` (3 preceding siblings ...)
  2003-06-03 12:17 ` pinskia@physics.uc.edu
@ 2004-04-02  3:38 ` pinskia at gcc dot gnu dot org
  2004-07-04 23:45 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-02  3:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-04-02 03:38 -------
I think this fixed on the tree-ssa.

-- 


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


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

* [Bug java/10878] miscompilation of boolean parameters from bytecode
       [not found] <20030520081601.10878.szabo.daniel@dpg.hu>
                   ` (4 preceding siblings ...)
  2004-04-02  3:38 ` pinskia at gcc dot gnu dot org
@ 2004-07-04 23:45 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-04 23:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-07-04 23:45 -------
This is fixed by the merge of the tree-ssa.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |3.5.0


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


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

end of thread, other threads:[~2004-07-04 23:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20030520081601.10878.szabo.daniel@dpg.hu>
2003-05-25  2:49 ` [Bug java/10878] miscompilation of boolean parameters from bytecode pinskia@physics.uc.edu
2003-06-02 16:33 ` pinskia@physics.uc.edu
2003-06-03  9:02 ` szabo.daniel@dpg.hu
2003-06-03 12:17 ` pinskia@physics.uc.edu
2004-04-02  3:38 ` pinskia at gcc dot gnu dot org
2004-07-04 23:45 ` 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).