Pelles C > Announcements

Version 10.00 (RC2) is now available

<< < (3/4) > >>

TimoVJL:
A small project to test that.

Stop build doesn't work.

Pelle:

--- Quote from: TimoVJL on July 04, 2020, 09:16:54 AM ---A small project to test that.

--- End quote ---
Thanks! I will have a look...

John Z:
Thanks TimoVJL - I should have done that.  I will in the future.

Regards,
John Z

John Z:
Hi,

Back on RC1 I mentioned a possible bug using optimizations.  V10 was/is giving me different results compared to V9.  I have a small portion of code, from a huge program, that either demonstrates the possible bug, or demonstrates I need to be a better programmer (undoubtedly true regardless ;) ).

This program will run 'correctly' using no optimizations, optimize for size, and optimize for size more in V10 RC2. However it will fail to run correctly when using optimize for speed or optimize for speed more in V10 RC2.  Using V9.009 it always works with all original code as written and any optimization desired.  I have stripped out many, many, lines of code to get a small example for V10.

It 'appears' that a pointer changes.  A statement
memset(p_ext,0,49); // clear extension storage is clearing a different pointer space that belonging to p_LineIn. 

If I change this one line to clear by writing nothing
swprintf(p_ext,49,L"%s",""); // clear extension storage then the optimizations ALL work and the program runs correctly.

There are other lines of code that can be removed and the result changes as well, but they seem unrelated to clearing p_ext.  Also using wmemset has the same issue as memset.  If there is a programmer pointer error I've gone blind to it.....

At the top of mainc. there are some instructions on what lines to comment out to try it. When it works correctly two message boxes will show with identical strings and the program will quit.  When it fails the second message box is blank, a third box will indicate that it failed.

I will really appreciate any help, or tips, and your time to look this over, hopefully I won't be too embarrassed!

John

Pelle:
It's a compiler bug, due to imprecise alias/liveness info. The compiler thinks ext[] and LineIn[] can share stack space, which they can't.
The quick fix is to add

--- Code: ---#pragma pack_stack(off)
--- End code ---
but a proper fix looks much harder. I'm out of ideas at the moment...

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version