On Intel-Macs, the result is 7fc56270e7a70fa81a5935b72eacbe29 both with Debug/Release settings.
But the result is not correct when compilied as PPC with Release setting. The result is always 00000000000000000000000000000000 regardless of the value. With Debug setting, the result is correct, it’s the same as Intel-Macs.
I’m using the .xcconfig file comes with juce v1.38.
I saw the source code of MD5 in juce but there seems be no difference between Debug/Release…
Are there any endian issue or am I missing something?
Ugh! This is a compiler bug - it’s trying too hard to optimise, and putting things into the wrong order, so it’s calculating the result before the work has actually been done…
I’m a bit stumped for a workaround… the problem seems to be mostly in the finish() method, and adding debugging printouts fixes it, but sometimes makes it produce other, random results, depending on where the printfs are. I’ve not found any other tricks that make any difference though.
Apart from turning off optimisation, I’m a bit puzzled by what to do. I guess this is fixed in gcc4.0, which is why it works in the intel builds.
By specifying “-O0” option to juce_MD5.cpp, I got the same result on PPC.
(in Xcode, press Command-I on juce_MD5.cpp in the groups and files, then click the “build” tab then write “-O0”)
However, the code is not optimized on both PPC and Intel…
It seems there are no way to specify “GCC_OPTIMIZATION_LEVEL_ppc = 0” for each file.
It’s a really annoying problem, especially in this file, which you want to be optimised. I tried splitting parts of the code into different functions to try to persuade it not to optimise, but had no luck.