This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Multiple call to segment warning

I am seeing this warning when I try to compile my code

Warning L15: multiple call to segment
segment: ?pr?_nvmwrit?nvmem_cc
caller1: ?pr?spicommisr?spi_com_cc
caller2: ?c_c51startup

I looked through my code, I don't call nvmwrite in spicommisr routine. And what is this c51startup file?

thanks,
DG

Parents
  • Maybe the compiler performs common-subexpression optmization, but not on sub-expressions but instead analyses functions with common code and then join the two code chains?

    I don't work with the Keil C51 compiler, but quite funny things can happen when a compiler starts doing global optimization.

    But a question asked earlier in this thread: Have you made sure that you have erased every single object file, so that the linker doesn't link in one object file from before the change?

Reply
  • Maybe the compiler performs common-subexpression optmization, but not on sub-expressions but instead analyses functions with common code and then join the two code chains?

    I don't work with the Keil C51 compiler, but quite funny things can happen when a compiler starts doing global optimization.

    But a question asked earlier in this thread: Have you made sure that you have erased every single object file, so that the linker doesn't link in one object file from before the change?

Children
  • I did rebuild all target files and I also tried delete all object files in my hard drive, then compile again. It does not seems to make any difference.

    For the time being, I made the nvmwrite to be reentrant so I can keep working on my code. Now I am having a new "multiple call to segment" warning on a different function, but two callers are the same, ISR and C51startup.

    Only when I change optimization level to 1, I wouldn't have that warning, but my code is, of course, much bigger.

    I can post my code here, but it is kind long...