#479 Bit assignment unefficient code

closed-fixed
5
2013-05-25
2003-03-14
Jarek Zych
No

I think it may bee a bug.
Considrer thise two functoins:

bit by, bx1, bx2;
...
void f1(void)
{
by=bx1;
}

void f2(void)
{
by=bx1 && bx2;
}

The very simple function f1 creates unefictient code:

_f1:
clr a
mov c,_bx1
rlc a
mov r2,a
add a,#0xff
mov _by,c
ret

when function f2 - very much complicated :-) - does well !!!

_f2:
mov c,_bx1
anl c,_bx2
mov _by,c
ret

(compiled by SDCC : FreeWare ANSI-C Compiler; Version 2.3.4)

Discussion

  • Bernhard Held

    Bernhard Held - 2003-03-15

    Logged In: YES
    user_id=203539

    Fixed in mcs51/ralloc.c 1.103

    Johan, could you please have a look on my work? Thanks!

     
  • Bernhard Held

    Bernhard Held - 2003-03-15
    • milestone: --> fixed
    • assigned_to: nobody --> bernhardheld
    • status: open --> closed-fixed
     
  • Jarek Zych

    Jarek Zych - 2003-03-19
    • status: closed-fixed --> wont-fix-fixed
     
  • Jarek Zych

    Jarek Zych - 2003-03-19
    • status: wont-fix-fixed --> closed-fixed
     

Log in to post a comment.