Menu

[z80] --fomit-frame-pointer seems to break code

Help
sverx
2015-02-16
2015-02-23
  • sverx

    sverx - 2015-02-16

    I've spent a good hour trying to understand what was going wrong in this piece of code.

      for (i=0;i<level->height;i++) {
        for (j=0;j<level->width;j++) {
    
          t=level->tMap[i*level->width+j];
          t1=level->t2Map[i*level->width+j];
    
          k=((t/6)*24)+(t%6)*2;
          k1=((t1/6)*24)+(t1%6)*2;
    
          rBuffer[j*2+i*4*level->width]=((t1==0) || (((short *)tilemap__bin)[k1]==0))?
                 ((short *)tilemap__bin)[k]:TILE_PRIORITY|((short *)tilemap__bin)[k1];
    
          rBuffer[1+j*2+i*4*level->width]=((short *)tilemap__bin)[k+1];
    
        }
      }
    

    The first write to rBuffer[] in the loop was never happening, I could only make that happen by removing the second write to rBuffer[]. Completely insane.

    Then I tried removing --fomit-frame-pointer from the compiler switches. Now it works :|
    I'm really not sure it's a bug, but I wanted you to know of this problem.

     

    Last edit: sverx 2015-02-16
  • Philipp Klaus Krause

    --fomit-frame-pointer is not as well-tested as the default. If you can separete out your code into a compileable function that reproduces the issue, please file a bug report.

    Philipp

     
  • sverx

    sverx - 2015-02-23

    OK. Not easy BTW.
    Thanks Philipp! :)

     

Log in to post a comment.