Skip to content

Commit cdfb1bd

Browse files
author
Artur Zakirov
committed
Added some comment
1 parent 6ecaed9 commit cdfb1bd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

contrib/pg_trgm/trgm_gist.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,11 @@ gtrgm_distance(PG_FUNCTION_ARGS)
471471
*recheck = strategy == SubwordDistanceStrategyNumber;
472472
if (GIST_LEAF(entry))
473473
{ /* all leafs contains orig trgm */
474+
/*
475+
* Prevent gcc optimizing the sml variable using volatile
476+
* keyword. Otherwise res can differ from the
477+
* subword_similarity_dist_op() function.
478+
*/
474479
float4 volatile sml = cnt_sml(qtrg, key, *recheck);
475480
res = 1.0 - sml;
476481
}

0 commit comments

Comments
 (0)