hoisted expression

When I compiled some code with pgcc I got the following expression several times, but just one should be enough to show it

85, -O4 optimization: guarded floating point expression hoisted

Now the first line, the for statement, is line 85. It has an expression hoisted. I know what it is doing “moving some constant expression out of the for loop”. That is constant in order to optimize it must be placed out of the loop.

I just do not see what part of it is hoisted).

for(Rint=0 ; Rint < (*(WPP).Env).NtargetR ; Rint=Rint+1){
RRAYbp[Rint] = (
if( RRAYap > (*WPP).RNGMAXi ){
printf(“PRC_BRN2: source beyond max range\n”);

Please explain.

Any help appreciated.


Sorry Newport_j, I can’t tell for what you posted. Can you post a reproducing example?

  • Mat