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: Cong Hou <congh at google dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, David Li <davidxl at google dot com>
- Date: Wed, 23 Oct 2013 20:13:49 +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> <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> <Pine dot LNX dot 4 dot 64 dot 1309032137370 dot 27960 at digraph dot polyomino dot org dot uk> <CAK=A3=35nZpFVe=Y1J1mnWA==CtiMSifwBrvPmDt7G0c8Pz0AQ at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1309032232360 dot 27960 at digraph dot polyomino dot org dot uk> <CAK=A3=1m5Q1gAe0Ga+kQc9Cmaf1yoL7XXgi0GKB+7msvfznQrg at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1309042057520 dot 16060 at digraph dot polyomino dot org dot uk> <CAAkRFZKPxgjwHdM34kk2yOsXsVzqWHzfPGcaoViQyshGcLwfJw at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1309042141500 dot 16060 at digraph dot polyomino dot org dot uk> <CAK=A3=2jYZBkyhHM=5__s6DCqKv1Af_PmOHZLANpj1OOXoUEPA at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1310032340580 dot 7552 at digraph dot polyomino dot org dot uk> <CAK=A3=0tVUfdwLG=s6DSXna9y0qTbFo1oQdHXJiFe7PQci422A at mail dot gmail dot com>
On Mon, 7 Oct 2013, Cong Hou wrote:
> + if (type != newtype)
> + break;
That comparison would wrongly treat as different cases where the types
differ only in one being a typedef, having qualifiers, etc. - or if in
future GCC implemented proposed TS 18661-3, cases where they differ in
e.g. one being float and the other _Float32 (defined as distinct types
that are not compatible although they have the same representation and
alignment). I think the right test here, bearing in mind the _Float32
case where types may not be compatible, is TYPE_MODE (type) != TYPE_MODE
(newtype) - if the types have the same mode, they have the same set of
values and so are not different in any way that matters for this
optimization. OK with that change.
--
Joseph S. Myers
joseph@codesourcery.com