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

Close

#537 Comparing the addres of a variable with a constant address

closed-fixed
Bernhard Held
5
2013-05-25
2003-06-25
No

int v;

int f(void ){
if (&v == (int *)0) {
return 1;
}
return 0;
}

/**
* Comparing the addres of a variable with a constant
address generates
* wrong code
*
* $ sdcc -c gencjne.c
* ?ASxxxx-Error-<a> in line 86 of gencjne.asm
* <a> machine specific addressing or addressing mode
error
* ?ASxxxx-Error-<a> in line 87 of gencjne.asm
* <a> machine specific addressing or addressing mode
error
* ?ASxxxx-Error-<a> in line 88 of gencjne.asm
* <a> machine specific addressing or addressing mode
error
* removing gencjne.rel
*
* The code generated for the if is:
*
* cjne #_v,#0x00,00102$
* cjne #(_v >> 8),#0x00,00102$
* cjne #0x00,#0x00,00102$
*
**/

Discussion

  • Bernhard Held
    Bernhard Held
    2003-06-25

    Logged In: YES
    user_id=203539

    Fixed in mcs51/gen.c 1.160

     
  • Bernhard Held
    Bernhard Held
    2003-06-25

    • labels: 355283 --> mcs51(8051) target
    • milestone: --> fixed
    • assigned_to: nobody --> bernhardheld
    • status: open --> closed-fixed