compiler removes code it wrongly believes to be unreachable
Original Reporter info from Mantis: 440bx @440bx
-
Reporter name:
Original Reporter info from Mantis: 440bx @440bx
- Reporter name:
Description:
The compiler wrongly assumes that some code is unreachable and removes it. This causes the code to produce wrong results.
Steps to reproduce:
It seems the problem is associated with subranges and types dependent on previously defined subranges. The compiler seems to believe that the subrange cannot be violated and removes any code that ensures values are in the proper range.
Additional information:
The compiler emits warning stating that the code is unreachable when it is apparent that such warnings are incorrect.
Attached is a test program - including an executable - that exhibits the problem.
Mantis conversion info:
- Mantis ID: 34140
- OS: Win 7
- OS Build: 64bit
- Version: 3.0.4
- Monitored by: » Vincent (Vincent Snijders)