public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: vladimir.mezentsev@oracle.com
To: Joseph Myers <joseph@codesourcery.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64
Date: Wed, 07 Feb 2018 00:25:00 -0000	[thread overview]
Message-ID: <3f48602b-e48e-a93a-e85c-92ffb0f61085@oracle.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1802061626000.15561@digraph.polyomino.org.uk>

On 02/06/2018 08:53 AM, Joseph Myers wrote:
> The files in libgcc/soft-fp must be verbatim copies of the master sources
> in glibc.  So you can't make any local changes to them, and if you think 
> changes are needed you need to patch things upstream in glibc first, with 
> a proper extended explanation of why the fix is needed and why it is safe 
> and the appropriate design for the fix.  There's nothing at all in this 
> patch submission to explain that change.

It is a bug/typo  in gcc/libgcc/soft-fp/quad.h when _FP_W_TYPE_SIZE is
64 (for example, on aarch64) .
It looks like a code after line 202 was never used.
% cat -n libgcc/soft-fp/quad.h
...
   201   
   202    #else   /* not _FP_W_TYPE_SIZE < 64 */
   203    union _FP_UNION_Q
   204    {
   205      TFtype flt /* __attribute__ ((mode (TF))) */ ;
   206      struct *_FP_STRUCT_LAYOUT*
   207      {
   208        _FP_W_TYPE a, b;
   209      } longs;
   210      struct *_FP_STRUCT_LAYOUT*
   211      {
   212    # if __BYTE_ORDER == __BIG_ENDIAN
   213        unsigned sign    : 1;
   214        unsigned exp     : _FP_EXPBITS_Q;
   215        _FP_W_TYPE frac1 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0) -
_FP_W_TYPE_SIZE;
   216        _FP_W_TYPE frac0 : _FP_W_TYPE_SIZE;
   217    # else
   218        _FP_W_TYPE frac0 : _FP_W_TYPE_SIZE;
   219        _FP_W_TYPE frac1 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0) -
_FP_W_TYPE_SIZE;
   220        unsigned exp     : _FP_EXPBITS_Q;
   221        unsigned sign    : 1;
   222    # endif
   223      } bits;
   224    };

We see 'struct _FP_STRUCT_LAYOUT' is declared twice (in lines 206 and
210) inside union _FP_UNION_Q.
Compiler reports warning.


-Vladimir

P.S.:
gcc/libgcc/soft-fp/ and  glibc/soft-fp/ are not synchronized now. For
example:

% diff gcc/libgcc/soft-fp/quad.h  glibc/soft-fp/
3c3
<    Copyright (C) 1997-2016 Free Software Foundation, Inc.
---
>    Copyright (C) 1997-2018 Free Software Foundation, Inc.
96c96
<   } bits __attribute__ ((packed));
---
>   } bits;

  reply	other threads:[~2018-02-07  0:25 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-06  7:20 vladimir.mezentsev
2018-02-06 16:53 ` Joseph Myers
2018-02-07  0:25   ` vladimir.mezentsev [this message]
2018-02-07  0:31     ` Joseph Myers
  -- strict thread matches above, loose matches on Subject: below --
2018-01-25 20:40 vladimir.mezentsev
2018-01-26  3:39 ` Joseph Myers
2018-01-29 20:54   ` vladimir.mezentsev
2018-01-29 21:01     ` Joseph Myers
2018-02-06  8:55       ` vladimir.mezentsev
2018-02-06 17:13         ` Joseph Myers
2017-10-25 17:29 vladimir.mezentsev
2017-10-25 17:29 ` Joseph Myers
2017-10-25 19:19   ` vladimir.mezentsev
2017-10-25 20:04     ` Joseph Myers
2017-10-19 13:20 Wilco Dijkstra
2017-10-19 13:52 ` Richard Earnshaw (lists)
2017-10-19 17:13   ` Vladimir Mezentsev
2017-10-19 17:24     ` Wilco Dijkstra
2017-10-25  3:26       ` vladimir.mezentsev
2017-10-18 21:32 vladimir.mezentsev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3f48602b-e48e-a93a-e85c-92ffb0f61085@oracle.com \
    --to=vladimir.mezentsev@oracle.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).