Page 4 of 5
Re: BricxCC/NBC test release 2011-07-19
Posted: 05 Aug 2011, 01:54
by muntoo
I know this won't help, but my attached program fails at OptLevel3. There's some problem in
WordWrapOut()
. If you remove my
#if 0
s in
WordWrapOut()
, you'll notice some more strange behaviour.
Everything works OK if you comment out line 242 in
NXTFileManager.nxc
:
Re: BricxCC/NBC test release 2011-07-19
Posted: 05 Aug 2011, 11:49
by afanofosc
Can you be more specific about how it fails? If you comment out that particular line then the entire function is optimized out and that completely changes the resulting dataspace so it makes it hard to sort out what it is about the program without this code that works vs not working when the code is compiled into the RXE. If you could make some small additions to your code that adjust the contents of the dataspace and make it work at level 3 optimizations then that might help me. Unless you are talking specifically about an unsafe compiler optimization that is breaking the code rather than revealing a long existing very low level bug in the compiler having to do with the organization of the dataspace.
Can you also elaborate on the more strange behavior that I should notice if I took out your #if 0? You'd be amazed at the things in other people's program's behavior that I simply do not notice since I have no idea what its correct behavior is supposed to be.
Maybe one of the changes I made to speed up optimization has had an unexpected side effect that is the root cause of these strange problems. I will check into this possibility.
John Hansen
Re: BricxCC/NBC test release 2011-07-19
Posted: 05 Aug 2011, 11:51
by afanofosc
I apologize for the delay. I will try to remember to upload a new test release tonight.
John Hansen
Re: BricxCC/NBC test release 2011-07-19
Posted: 05 Aug 2011, 23:12
by muntoo
More detailed error report:
nbc -Z3
-
NXTFileManager.rxe
gave a
File Error! -5
when running the program, so I
nexttool -clear
ed all the files off my NXT, and recompiled/downloaded the program. Now, if I press the right button, the program freezes and the display clears halfway. (The screen was refreshing while
WordWrapOut()
executed and froze the NXT?)
nbc -Z1
- It works fine - the program doesn't freeze/crash. At least, not while navigating through the file list.
It sounds like a firmware bug (in addition to the compiler): the firmware shouldn't freeze no matter what the .rxe file's input is ...right? Instead, it should've returned a File Error, or something.
EDIT: Also, the output NBC code has a lot of duplicate identifiers. You might wanna fix that.
EDIT 2: Attached shorter version (still a bit long) that still gives me trouble.
Re: BricxCC/NBC test release 2011-07-19
Posted: 06 Aug 2011, 11:02
by pbenco
Dear afanofosc
I have a digital scope too, 200MHz capable, how could I help?
Could you provide a test firmware with the speedy i2c, and a test program able to expose the behaviour you try to catch.
Best regards
ben
Re: BricxCC/NBC test release 2011-07-19
Posted: 06 Aug 2011, 21:12
by muntoo
Found a little bug! (-Z3
. I don't know about -Z2
, though.)
The __strToLines_7qG2_szOut_7qG2_000
variable's value never changes during the program! It's always 0x0
.
This is why I can't see LCD_LINE4
text in WordWrapOut()
. (One of the #if 0
s.)
Re: BricxCC/NBC test release 2011-07-19
Posted: 07 Aug 2011, 23:56
by afanofosc_99
muntoo wrote:
EDIT: Also, the output NBC code has a lot of duplicate identifiers. You might wanna fix that.
EDIT 2: Attached shorter version (still a bit long) that still gives me trouble.
There should not be any duplicate identifiers. Can you elaborate?
John Hansen
Re: BricxCC/NBC test release 2011-07-19
Posted: 07 Aug 2011, 23:58
by afanofosc_99
pbenco wrote:Dear afanofosc
I have a digital scope too, 200MHz capable, how could I help?
Could you provide a test firmware with the speedy i2c, and a test program able to expose the behaviour you try to catch.
Best regards
ben
I've been feverishly trying to finish up a project that has delayed posting a new test firmware and compiler/IDE. I apologize for the delay. I will post here when I have uploaded a new test release zip with the firmware image and a compiler and test program.
John Hansen
Re: BricxCC/NBC test release 2011-07-19
Posted: 08 Aug 2011, 19:54
by schodet
afanofosc_99 wrote:I've been feverishly trying to finish up a project that has delayed posting a new test firmware and compiler/IDE. I apologize for the delay. I will post here when I have uploaded a new test release zip with the firmware image and a compiler and test program.
No problem
Re: BricxCC/NBC test release 2011-07-19
Posted: 12 Aug 2011, 20:27
by muntoo
afanofosc_99 wrote:There should not be any duplicate identifiers. Can you elaborate?
I meant duplicate definitions like this:
Code: Select all
dseg segment
;------- definitions -------
// ...
Location_def struct
X sword
Y sword
Location_def ends
// ... Later ...
Location_def struct
X sword
Y sword
Location_def ends
// ...
dseg ends