Evelyn the modified dog

Anonymous
2003-05-02
2004-09-19
  • Anonymous - 2003-05-02

    Well I've had "caught signal 11" & resolved that so what or who is "Evelyn the modified dog" which appears to have left out a line of code with which I can find nothing wrong.Do I assume that there is more info in the Linux version so I wouldn't have to keep asking daft questions??

     
    • Bernhard Held

      Bernhard Held - 2003-05-04

      We're always interested in short source snippets, which cause such an error.
      I'm sure, there's "something wrong" with your source, if it's modified by sdcc. If you don't post your source, we can't help you.
      The info is the same on all platforms.

       
      • James Davis

        James Davis - 2004-09-15

        Ok, I'm getting the same message while trying to compile the following piece of code
        warning: conditional flow changed by optimizer: so said EVELYN the modified DOG.

        code:
        int FAT_ChangeDir(char *NDir)
        {
          int found = 0;
          int i;
          unsigned long CurFATDir;
          unsigned long FATPage  = ((FAT_CurFATDir-FAT_LBA_ClusBegin)/(long)128);
          unsigned char FATIndex = (FAT_CurFATDir-FAT_LBA_ClusBegin)-((long)128*FATPage);
          char NewDir[80];
          char *tmp;
          strcpy(NewDir,NDir);
          NewDir[strlen(NDir)]='\0';
          printf("Checking for DIR :%s:\r\n",NewDir);
          CurFATDir = FAT_CurFATDir;
        //  do
        //  {
            FATPage  = ((CurFATDir-FAT_LBA_ClusBegin)/(long)128);
            FATIndex = (CurFATDir-FAT_LBA_ClusBegin)-((long)128*FATPage);
            FAT_FT_Load(FATPage,FATIndex);
            for (i=0;i<16;i++)
            {
              FAT_GetDirEntry(CurFATDir,i*16);
              if ((FAT_CurDirEntry.DIR_Attr&A_DIRECTORY)==A_DIRECTORY)
              {
                tmp=getToken(FAT_CurDirEntry.DIR_Name);
        //        tmp[strlen(tmp)]='\0';
                   printf("Dir Test: :%s: :%s: %d\r\n",NewDir,tmp,strcmp(NewDir,tmp));
                if (strcmp(NewDir,tmp)==0)
                {
                  FAT_CurFATDir=((long)FAT_CurDirEntry.DIR_FstClusHi<<(long)16)|((long)FAT_CurDirEntry.DIR_FstClusLo);
                  printf("Directory exists at cluster %lu %u %u %lu\r\n",FAT_CurFATDir, FAT_CurDirEntry.DIR_FstClusHi,FAT_CurDirEntry.DIR_FstClusLo,((long)FAT_CurDirEntry.DIR_FstClusHi<<(long)16)|((long)FAT_CurDirEntry.DIR_FstClusLo));
                  FAT_CurFATDir+=FAT_LBA_ClusBegin;
                  if (FAT_CurFATDir==FAT_LBA_ClusBegin)
                    FAT_CurFATDir+=(long)2;
                  found=1;
                  return 1;
                }
              }
            }
            if (FAT_CurFATEntry<((long)0x0FFFFFF8))
            {
              CurFATDir = FAT_LBA_ClusBegin+(FAT_CurFATEntry);    
            }
        //  }  
        //  while (FAT_CurFATEntry<(long)0x0FFFFFF8);
          return 0;
        }

        The line it idicates (149 in my file) is:
        if (FAT_CurFATEntry<((long)0x0FFFFFF8))

        This error does not occur if I have the do-while loop uncommented.
        I'm using SDCC 2.4.0 Feb23-2004

         
    • Anonymous - 2003-05-05

      o.k. thanks. I'll have another look

       
    • Frieder Ferlemann

      Hi James,

      the body of your while loop never writes to FAT_CurFATEntry,
      so if FAT_CurFATEntry is a variable and doesn't happen to
      be a MACRO (I dislike C, did I mention that recently?) then
      SDCC might use a previously evaluated value for FAT_CurFATEntry. With this value it might generate a shortcut
      for the if and/or the while clause and issue a warning.

      Or FAT_CurFATEntry is a 16 bit variable and thus always smaller
      than 0x0FFFFFF8. Hard to tell without compilable source.

      If providing compilable source is not an option for you
      (and the problem cannot be reproduced with a smaller code snippet) you should look at the .asm file specifically with focus on
      the generated code at the if clause and before the jump for the
      while statement.

       
    • James Davis

      James Davis - 2004-09-19

      FAT_CurFATEntry is a variable that is initialized in another function.  My point here is that it only generates this message if I take out the while loop.  Adding the do-while loop back in removes the warning.  The code functions correctly either way, but I am just attaching a snippet of the code that causes this message as per post above:
      By: Bernhard Held - bernhardheld
      RE: Evelyn the modified dog  
      2003-05-04 02:48 

      We're always interested in short source snippets, which cause such an error.
      I'm sure, there's "something wrong" with your source, if it's modified by sdcc. If you don't post your source, we can't help you.
      The info is the same on all platforms. 
      -----------------------------
      as I have modified the file since then and made changes to the above routine, I cannot attach the whole file at this point... besides, this file is dependent on other files -- the whole project is getting very large, so it is not easily attachable.

       

Log in to post a comment.