#1481 Compiler uses cjne (which is out of range, 130+ bytes jump)

closed-fixed
5
2013-05-25
2008-09-17
Zoran
No

In some cases the compiler uses cjne but it has to jump to a 130+ bytes,which cjne doesn't support, but the compiler has used cjne instead of ljmp...

The error is: "?ASxxxx-Error-<a> in line 1786 of Source\code\command_mode.asm
removing Source\code\command_mode.rel
<a> machine specific addressing or addressing mode error"

Discussion

  • Zoran

    Zoran - 2008-09-17

    The source file in which the error has occured

     
  • Zoran

    Zoran - 2008-09-17
    • labels: --> 355282
    • priority: 5 --> 6
     
  • Maarten Brock

    Maarten Brock - 2008-09-17
    • labels: 355282 --> 101550
     
  • Maarten Brock

    Maarten Brock - 2008-09-17

    Are you using any inline assembler?

     
  • Zoran

    Zoran - 2008-09-18

    No, there isn't any inline assembler in this file...
    SDCC version 2.8.0.0.

     
  • Maarten Brock

    Maarten Brock - 2008-09-19

    Can you please upload either the source and explain the compiler switches you used? It would also help to reproduce the asm with --verbose-asm so we can examine what the compiler did.

    Maarten

     
  • Zoran

    Zoran - 2008-09-22

    The .c source file, the error happens around line 234

     
  • Zoran

    Zoran - 2008-09-22

    Here you go. The error happens on line 234 in .C source. I solved the bug of compiler not using ljmp by putting "printf("\r");" in front of the code that is supposed to do something, so the assembly code lengthens and the compiler is forced to use ljmp. The "printf" does not have any actual implication, it is only a fix...

    Compiler switches are: "SDCC --debug -c --model-large

    File Added: command_mode.c

     
  • Maarten Brock

    Maarten Brock - 2008-09-22
    • priority: 6 --> 5
     
  • Maarten Brock

    Maarten Brock - 2008-09-22

    Without the needed header files I cannot recompile this, now can I?

     
  • Zoran

    Zoran - 2008-09-23

    I'm really sorry. It's just I am currently involved in 3 prototype projects and the deadline is very close... So I can't think strait.

    The header file has only this definitions:

    #ifdef COMMAND_MODE
    unsigned char cmd_buff[64];
    #else
    extern unsigned char chk_cmd(unsigned int timeout);
    extern void command_mode(void);
    extern BOOL refresh_param(unsigned char *param, unsigned int len, unsigned int ee_adresa, char hard_switch);
    #endif

     
  • Maarten Brock

    Maarten Brock - 2008-09-23

    Then what is in the other 8 header files?

     
  • Zoran

    Zoran - 2008-09-23

    I'm sorry but I can't give the other files to you since the other files require that I give you 80% of the program... which by company policy I cant do.

    You can freely comment every line that requires some external function... Because the error happens in the "if(strstr(...".
    So the error doesn't happen in any definition or usage of external functions... You jsut have to keep all lines of string manipulation which only use standard C functions, so no other files are neccesary...

     
  • Maarten Brock

    Maarten Brock - 2008-09-24

    stripped source code

     
  • Maarten Brock

    Maarten Brock - 2008-09-24

    So you were too lazy to strip the file yourself of unrelated code.
    You also could not be bothered to provide the asm with --verbose-asm on.
    Instead you decided that setting a higher than average priority would suit you best.

    Attached is the stripped source file.
    File Added: bug2115959.c

     
  • Maarten Brock

    Maarten Brock - 2008-09-24
    • labels: 101550 --> peephole optimizer
     
  • Maarten Brock

    Maarten Brock - 2008-09-24

    The bug is due to peephole rules 193.x upto 198.x not checking if the label is in range. In this case it was rule 196.

    This is the generated verbose asm file.
    File Added: bug2115959.asm

     
  • Maarten Brock

    Maarten Brock - 2008-09-24

    verbose generated asm

     
  • Maarten Brock

    Maarten Brock - 2008-10-05
    • assigned_to: nobody --> maartenbrock
    • milestone: --> fixed
    • status: open --> closed-fixed
     
  • Maarten Brock

    Maarten Brock - 2008-10-05

    Fixed in SDCC 2.8.4 #5248.

     

Log in to post a comment.