On 27/04/11 09:44, Barry Song wrote:
Thanks. I am totally thinking it is a gcc bug not an optimization feature. in fact, __aeabi_uldivmod is never called as seen by objdump. It only exists in symbol reference list.
Your code contains "Nmod = target % source" so the only reason divmod wouldn't get called is if it got optimized away somehow.
If that were the case then it would be a compiler bug somehow, but when I build the test case in Michael's bug report it looks like __aeabi_uidivmod does get called, AFAICT.
I don't see any reference to __aeabi_uldivmod so you must have different compiler or testcase?
Andrew