Re: Fuzzy substring searching with the pg_trgm extension
От | Teodor Sigaev |
---|---|
Тема | Re: Fuzzy substring searching with the pg_trgm extension |
Дата | |
Msg-id | 5694C914.8030103@sigaev.ru обсуждение исходный текст |
Ответ на | Re: Fuzzy substring searching with the pg_trgm extension (Alvaro Herrera <alvherre@2ndquadrant.com>) |
Список | pgsql-hackers |
>> ! float4 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) ? true : false; > > What's the compiler bug about? This code and comment were introduced in > cbfa4092bb (May 2004) without any explanation. Do we still need to keep > it, if &nlimit is now a local variable instead of a global? FWIW the > oldest GCC in the buildfarm is 3.4.2/3.4.3 (except for Gaur which uses As I remeber, the problem was with x87 math coprocessor. Compiler (suppose, modern compiler could do it too) keeps tmpsml in internal 80-bit wide register and compares with 32-bit wide float. Of course, it depends on level of optimization and so, result of comparison was differ in optimization enabled and disabled instances. Such strange way I choose to force compiler to use main memory for tmpsml variable. Actually, I don't know better way even now. -- Teodor Sigaev E-mail: teodor@sigaev.ru WWW: http://www.sigaev.ru/
В списке pgsql-hackers по дате отправления: