17 December 2015, 07:50 | #1 |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 828
|
VBCC 09d - bug in code generator ?
Hi
I have problem with vbcc 0.9d (cross - I compiled my own 64 bit version for windows). For following function (simplified a bit to show problem) Code:
void WindowSignals(void) { while (TRUE) { struct IntuiMessage* pMsg; pMsg = (struct IntuiMessage*)GetMsg(g_pWin->UserPort); if (pMsg == NULL) { break; } ULONG msg_class = pMsg->Class; ReplyMsg((struct Message*)pMsg); if (IDCMP_CLOSEWINDOW == msg_class) { return; } } } Code:
_WindowSignals movem.l l32,-(a7) l30 move.l _g_pWin(a4),a1 move.l (86,a1),a1 move.l _SysBase(a4),a6 move.l a1,a0 jsr -372(a6) move.l d0,a3 beq l31 move.l (20,a3),a2 move.l _SysBase(a4),a6 move.l a3,a1 jsr -378(a6) cmp.l #512,a2 bne l30 l31 l32 reg a2/a3/a6 movem.l (a7)+,a2/a3/a6 l34 equ 12 rts For vbcc 0.9b code generated is differ then above Code:
move.l d0,a3 move.l a3,d0 beq l31 Anyone noticed this bug too ? |
17 December 2015, 18:04 | #2 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Yeah I see it here too, you can fix it by compiling without optimizations.
|
17 December 2015, 19:25 | #3 |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 828
|
@Leffmann
Thanks a lot. I tried with -o0 and works fine and code looks Code:
subq.w #8,a7 movem.l l22,-(a7) l17 move.l _g_pWin(a4),a0 move.l (86,a0),a0 move.l _SysBase(a4),a6 jsr -372(a6) move.l d0,(0+l24,a7) bne l21 l20 bra l19 l21 move.l (0+l24,a7),a0 move.w (24,a0),(4+l24,a7) move.l (0+l24,a7),a1 move.l _SysBase(a4),a6 jsr -378(a6) ;rest code Thank you. |
03 January 2016, 15:51 | #4 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,510
|
Could be a known bug. I think it was fixed some time ago. In the list for the next vbcc version I have this:
Code:
- m68k: Fixed asm-peephole optimization of move.l dx,ay; move.l ay,dx when cc of ay is used. When you have a small source text for reproduction I could confirm that the bug is fixed. The source fragment above is not compilable. |
03 January 2016, 16:55 | #5 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
It's probably the same bug. It may happen if you use anything other than -O0. Simple way to reproduce it:
Code:
void* x(); int func() { void* p = x(); if (p) return 1; else return 2; } |
03 January 2016, 20:12 | #6 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,510
|
Confirmed. Then it's fixed.
|
04 January 2016, 10:43 | #7 |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 828
|
@phx
Great news. When should I expect a new version of vbcc ? |
04 January 2016, 13:46 | #8 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,510
|
This might take a while. Don't know if we release a new version this year. Maybe I should make another patch for 0.9d, regarding the severity of that bug.
Otherwise just write me a mail and you can get the current development version. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
vbcc code generation and dbf | Asman | Coders. C/C++ | 15 | 12 March 2016 01:51 |
Debugging vbcc code | tolkien | Coders. C/C++ | 5 | 14 February 2015 06:45 |
VBCC code generation | Asman | Coders. C/C++ | 9 | 17 August 2014 09:33 |
Mixed 68k / PPC code on VBCC. | Cowcat | Coders. General | 10 | 01 August 2013 16:01 |
|
|