summaryrefslogtreecommitdiff
path: root/contrib/pg_trgm/trgm_gist.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/pg_trgm/trgm_gist.c')
-rw-r--r--contrib/pg_trgm/trgm_gist.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/contrib/pg_trgm/trgm_gist.c b/contrib/pg_trgm/trgm_gist.c
index 3a5aff9edee..f52867df324 100644
--- a/contrib/pg_trgm/trgm_gist.c
+++ b/contrib/pg_trgm/trgm_gist.c
@@ -296,16 +296,9 @@ gtrgm_consistent(PG_FUNCTION_ARGS)
if (GIST_LEAF(entry))
{ /* all leafs contains orig trgm */
+ double tmpsml = cnt_sml(qtrg, key, *recheck);
- /*
- * Prevent gcc optimizing the tmpsml variable using volatile
- * keyword. Otherwise comparison of nlimit and tmpsml may give
- * wrong results.
- */
- float4 volatile tmpsml = cnt_sml(qtrg, key, *recheck);
-
- /* strange bug at freebsd 5.2.1 and gcc 3.3.3 */
- res = (*(int *) &tmpsml == *(int *) &nlimit || tmpsml > nlimit);
+ res = (tmpsml >= nlimit);
}
else if (ISALLTRUE(key))
{ /* non-leaf contains signature */