CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PCD 5.122 issues with division (revert to 5.118 to fix)

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
allenhuffman



Joined: 17 Jun 2019
Posts: 648
Location: Des Moines, Iowa, USA

View user's profile Send private message Visit poster's website

PCD 5.122 issues with division (revert to 5.118 to fix)
PostPosted: Mon Jan 19, 2026 9:27 am     Reply with quote

Just a heads up. We encountered an issue with the 5.122 compiler that caused one of our four PIC24 projects to fail. Reverting to 5.118 worked.

Thanks to the excellent support from CCS, they were able to identify the issue with some division code. I had to do with using U16 integers and U32s, such as when you have something like this:

Code:
uint32_t sum;
uint16_t average;

average = (sum / x);


(I may not fully understand the issue, but it has something to do with how the smaller ints are supposed to expand for the calculation.

We caught this in a 24EP256GP202 and (using an updated DLL they sent me for testing) 24FJ256GA106.

Just a heads up.
_________________
Allen C. Huffman, Sub-Etha Software (est. 1990) http://www.subethasoftware.com
Embedded C, Arduino, MSP430, ESP8266/32, BASIC Stamp and PIC24 programmer.
http://www.whywouldyouwanttodothat.com ?

Using: 24FJ256GA106, 24EP256GP202 and 24FJ64GA002.
Ttelmah



Joined: 11 Mar 2010
Posts: 20025

View user's profile Send private message

PostPosted: Mon Jan 19, 2026 11:12 am     Reply with quote

Try one thing.
Recompile with the new compiler, with the optimisation turned down.
If this fixes it, it sounds as if they may have re-introduced a problem they
has with optimisation a while ago:
[url]
https://www.ccsinfo.com/forum/viewtopic.php?t=59695
[/url]
temtronic



Joined: 01 Jul 2010
Posts: 9619
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Jan 19, 2026 8:19 pm     Reply with quote

just curious... why did you install the upgrade ? Did it fix a 'bug' for you ?
allenhuffman



Joined: 17 Jun 2019
Posts: 648
Location: Des Moines, Iowa, USA

View user's profile Send private message Visit poster's website

PostPosted: Mon Jan 26, 2026 4:40 pm     Reply with quote

temtronic wrote:
just curious... why did you install the upgrade? Did it fix a 'bug' for you ?


Co-worker at HQ set up their system to build PIC24 code and had to install the compiler. The setup program downloads the current stuff, which is how we found the issue. (I save out all the DLLs as updates come in, and was able to provide them with the 5.118 to use, and CCS was able to provide me with several I missed updating to so I could archive those as well.)

We have had numerous compiler quirks over the years that CCS has quickly resolved and provided an update, including this time with them giving me a pre-release 5.123 to test out.

This is the first time we've encountered a "new" issue after an update, at least. Usually we have some code that trips up the compiler and we have to upgrade to get the fix ;-)

5.123 is out, though I have not tested it on the original code. The pre-release 5.123 seemed to cause an unrelated issue elsewhere, but I haven't had time to diff the list files and see what changed (beyond the division code).
_________________
Allen C. Huffman, Sub-Etha Software (est. 1990) http://www.subethasoftware.com
Embedded C, Arduino, MSP430, ESP8266/32, BASIC Stamp and PIC24 programmer.
http://www.whywouldyouwanttodothat.com ?

Using: 24FJ256GA106, 24EP256GP202 and 24FJ64GA002.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group