Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit11b91fa

Browse files
author
Artur Zakirov
committed
Fix the tmpsml optimization by gcc
1 parentcdfb1bd commit11b91fa

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎contrib/pg_trgm/trgm_gist.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,12 @@ gtrgm_consistent(PG_FUNCTION_ARGS)
296296

297297
if (GIST_LEAF(entry))
298298
{/* all leafs contains orig trgm */
299-
float4tmpsml=cnt_sml(qtrg,key,*recheck);
299+
/*
300+
* Prevent gcc optimizing the tmpsml variable using volatile
301+
* keyword. Otherwise comparison of nlimit and tmpsml may give
302+
* wrong results.
303+
*/
304+
float4volatiletmpsml=cnt_sml(qtrg,key,*recheck);
300305

301306
/* strange bug at freebsd 5.2.1 and gcc 3.3.3 */
302307
res= (*(int*)&tmpsml==*(int*)&nlimit||tmpsml>nlimit);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp