This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fixing improper conversion from sin() to sinf() in optimization mode.
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Xinliang David Li <davidxl at google dot com>
- Cc: Cong Hou <congh at google dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 3 Sep 2013 21:43:07 +0000
- Subject: Re: [PATCH] Fixing improper conversion from sin() to sinf() in optimization mode.
- Authentication-results: sourceware.org; auth=none
- References: <CAK=A3=1b=qhx8u8Wz7je=KYUbvOQHyKaWP353ud7D7f8gF56Bw at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1308232046240 dot 12585 at digraph dot polyomino dot org dot uk> <CAK=A3=3=gLhTso3+AF-BmiONPsEpP3dGTFtOAZPbh+oteYPTNA at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1308302148230 dot 22363 at digraph dot polyomino dot org dot uk> <CAK=A3=0bQkcvprFZTtuJ0ZNbknSJixhMP559tiF3FFUL0zkmfw at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1308311615070 dot 20398 at digraph dot polyomino dot org dot uk> <CAK=A3=2PQh5RiuDWn9yGv-jxkC5G-s2JRSQTF0PEmaQSpsnyZg at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1309032123250 dot 27960 at digraph dot polyomino dot org dot uk> <CAAkRFZK1wL00=eU02LqEMVEpSxxgn8dFHhJEy6XbpYkB1T+X6g at mail dot gmail dot com>
On Tue, 3 Sep 2013, Xinliang David Li wrote:
> >From Joseph:
>
> "The
> conversion is not safe for sqrt if the two types are double and long
> double and long double is x86 extended, for example."
>
> This is not reflected in the patch.
No, the problem is that it tries to reflect it but hardcodes the specific
example I gave, rather than following the logic I explained regarding the
precisions of the types involved, which depend on the target. And since I
only gave a simplified analysis, for two types when this function deals
with cases involving three types, the patch submission needs to include
its own analysis for the full generality of three types to justify the
logic used (as inequalities involving the three precisions). (I suspect
it reduces to the case of two types so you don't need to go into the
details of reasoning about floating point to produce the more general
analysis. But in any case, it's for the patch submitter to give the full
explanation.)
--
Joseph S. Myers
joseph@codesourcery.com