Menu

#2592 compiler hangs for 32-bit left shift given int shift value

closed-fixed
None
Z80
5
2017-03-13
2017-03-10
alvin
No

This bug prevents coremark from compiling.

sdcc -v
3.6.5 #9842 (MINGW64)

Test program:

extern int printf(char *fmt, ...);

void main(void)
{
    unsigned int i;

    for (i=0; i<20; ++i)
        printf("%lu\n", 1<<(unsigned long)i);
}

sdcc -mz80 -S test.c

The compiler just hangs.

Combinations of the shift expression with the same type on both sides of the << operator do compile successfully:

(unsigned long)1<<(unsigned long)i
1<<i

Discussion

  • alvin

    alvin - 2017-03-10

    I put in "Front End" but this seems to be a z80-related problem.

     
  • Philipp Klaus Krause

    • Category: Front-end --> Z80
     
  • Philipp Klaus Krause

    Áccording to a few stacktraces from gdb, it seems SDCC hangs in genLeftShift in code generation in the Z80 backend.

    Philipp

     
  • Philipp Klaus Krause

    • assigned_to: Philipp Klaus Krause
     
  • Philipp Klaus Krause

    • status: open --> closed-fixed
     
  • Philipp Klaus Krause

    Fixed in revision #9852.

    Philipp

     

Log in to post a comment.