Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#415 Missing bank switch in one bit and/or

closed-works-for-me
Scott Dattalo
7
2013-05-25
2002-11-13
Rasmus Kjeldsen
No

When doing _one_ bit bitwise and/or, needed bank
switches is not inserted. Example:

PORTA|=0x01;
TRISA|=0x01; // or TRISA&=0xfe;

Compiles to:

; PORTA|=0x01;
BSF _PORTA,0
;#CSRC test.c 51
; TRISA|=0x01;
BSF _TRISA,0

It should have compiled to:

; PORTA|=0x01;
BSF _PORTA,0
BSF _STATUS,5
;#CSRC test.c 51
; TRISA|=0x01;
BSF _TRISA,0
BCF _STATUS,5

Below is a patch agains the CVS from 13/11-02, which
fixes the bug. I don't fully understand the compiler
code yet, so it might have unpleasent side effects though.

--- sdcc/src/pic/pcode.c 2002-08-09
16:28:53.000000000 +0200
+++ sdcc.oneBitAndOrPatch/src/pic/pcode.c
2002-11-13 20:11:31.000000000 +0100
@@ -3268,7 +3268,8 @@
//return NULL; // PCOR(PCI(pc)->pcop)->r;

case PO_GPR_BIT:
- return PCOR(PCI(pc)->pcop)->r;
+ return dirregWithName(PCI(pc)->pcop->name);
+// return PCOR(PCI(pc)->pcop)->r;

case PO_DIR:
//fprintf(stderr, "getRegFromInstruction - dir\n");

Discussion

  • Johan Knol
    Johan Knol
    2003-01-15

    • priority: 5 --> 7
    • assigned_to: nobody --> sdattalo
     
  • Raphael Neider
    Raphael Neider
    2005-07-01

    • milestone: --> unreproducable
    • status: open --> open-works-for-me
     
  • Raphael Neider
    Raphael Neider
    2005-07-01

    Logged In: YES
    user_id=1115835

    Works with SDCC 2.5.1 #1053. I will close this in less than
    two years time if nobody disagrees ;-)

     
  • Raphael Neider
    Raphael Neider
    2005-07-22

    • status: open-works-for-me --> closed-works-for-me