Strange Problems
Posted: 01 August 2008, 20:27 PM
I am seeing some strange problems with some of my native mode code. Here are two examples:
1. Doesn't WorkWorks
2. Doesn't WorkWorksIn this second example if the Debug statement is commented out then the whole block is not executed. If the Debug statement is moved down a couple of lines then the whole block is not executed.
The generated code looks ok. The stack all seems ok. Trying to generate a simpler example is unsuccessful. It seems like this could be the GCC compiler. I have seen it generate "over-optimized" code before. Has anyone else seen "inexplicable" problems like this?
1. Doesn't Work
Code: Select all
If msgTotal = 0 And previousMsgTotal <> 0 Then
' do work
End If
Code: Select all
If msgTotal = 0 Then
If previousMsgTotal <> 0 Then
' do work
End If
End If
Code: Select all
If seqNumber <> 0 Then
packet(2) = controllerType
packet(4) = HiByte(seqNumber)
'Debug.Print CStrHex(seqNumber); " Sent"
packet(5) = LoByte(seqNumber)
Call sendPayload(packet, 5)
End If
Code: Select all
If seqNumber <> 0 Then
packet(2) = controllerType
packet(4) = HiByte(seqNumber)
Debug.Print CStrHex(seqNumber); " Sent"
packet(5) = LoByte(seqNumber)
Call sendPayload(packet, 5)
End If
The generated code looks ok. The stack all seems ok. Trying to generate a simpler example is unsuccessful. It seems like this could be the GCC compiler. I have seen it generate "over-optimized" code before. Has anyone else seen "inexplicable" problems like this?