public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Sandra Loosemore <sandra@codesourcery.com>
To: Jakub Jelinek <jakub@redhat.com>,
	Tobias Burnus <tobias@codesourcery.com>
Cc: Gerald Pfeifer <gerald@pfeifer.com>,
	Andreas Tobler <andreast@freebsd.org>, <gcc-patches@gcc.gnu.org>,
	<fortran@gcc.gnu.org>
Subject: Re: [PATCH, Fortran] Revert to non-multilib-specific ISO_Fortran_binding.h
Date: Mon, 13 Sep 2021 10:59:05 -0600	[thread overview]
Message-ID: <b6c3cc69-7973-c7de-3540-1c38fcffdfa0@codesourcery.com> (raw)
In-Reply-To: <20210913165105.GJ304296@tucnak>

On 9/13/21 10:51 AM, Jakub Jelinek wrote:
> On Mon, Sep 13, 2021 at 06:32:56PM +0200, Tobias Burnus wrote:
>> On 13.09.21 17:56, Gerald Pfeifer wrote:
>>> This broke bootstrap on i586-unknown-freebsd11:
>>>
>>>     In file included from .../GCC-HEAD/libgfortran/runtime/ISO_Fortran_binding.c:30:
>>>     .../GCC-HEAD/libgfortran/ISO_Fortran_binding.h:255:2:
>>>     error: #error "Can't determine kind of long double"
>>>     255 | #error "Can't determine kind of long double"
>>>         |  ^~~~~
>>>
>>> Does this work on i586-*-linux?
>>>
>>>
>>> % egrep -r '#define.*LDBL_(MANT_DIG|MIN_EXP|MAX_EXP)' /usr/include/
>>> /usr/include/x86/float.h:#define LDBL_MANT_DIG  64
>>> /usr/include/x86/float.h:#define LDBL_MIN_EXP   (-16381)
>>> /usr/include/x86/float.h:#define LDBL_MAX_EXP   16384
>>>
>>> This looks like it matches existing Linux case already in place?
>>
>> Can you run 'echo | cpp -E -g3|grep DBL' to (or in the build dir: echo |
>> ./gcc/cc1 -E -g3 -dD|grep DBL) to check what's the output?
>>
>> It might be that /usr/include/x86/float.h is not used; e.g. there is
>> $(gcc-src)/ginclude/float.h which undef's the LDBL_MAX_EXP to replace it
>> by a #define using __LDBL_MAX_EXP. Thus, if those are different from the
>> values under /usr/include, it might be the reason for the fail?
>>
>> I think it works under Linux, at least the "x86-64 -m32"
>> libgfortran.{so,a}  build and the -m32 testsuite runs do work.
> 
> Wouldn't it be better to use the __LDBL_* macros anyway and not rely on
> float.h?  The header doesn't want to test what float.h tells about the
> long double type, but what the compiler knows about it.

I originally wrote the code to use the internal GCC __LDBL_* macros as 
you suggest, but Tobias complained that then the gfortran-provided .h 
file could not be used to compile the C parts of the program with some 
other C compiler.  (I guess there are people out in the real world who 
want to mash up clang-compiled C code with gfortran programs).  Maybe it 
needs to first check the internal macros and then look for the float.h 
versions if it can't find them?

-Sandra

  reply	other threads:[~2021-09-13 16:59 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19  2:57 Sandra Loosemore
2021-09-03  2:05 ` PING " Sandra Loosemore
2021-09-06 19:29 ` Tobias Burnus
2021-09-10 15:39 ` Andreas Schwab
2021-09-13  7:51   ` Tobias Burnus
2021-09-13 15:56 ` Gerald Pfeifer
2021-09-13 16:32   ` Tobias Burnus
2021-09-13 16:51     ` Jakub Jelinek
2021-09-13 16:59       ` Sandra Loosemore [this message]
2021-09-13 17:07         ` Tobias Burnus
2021-09-13 17:20           ` Jakub Jelinek
2021-09-14  3:39           ` Sandra Loosemore
2021-09-14  7:39             ` Tobias Burnus
2021-09-14 16:34             ` Gerald Pfeifer
2021-09-14 14:50     ` Gerald Pfeifer
2021-09-14 15:16       ` Tobias Burnus
2021-09-14 15:17       ` Andreas Schwab
2021-09-14 15:23         ` Jakub Jelinek
2021-09-14 15:30           ` Andreas Schwab
2021-09-15  1:05             ` Joseph Myers
2021-09-14 19:27           ` Gerald Pfeifer
2021-09-17  6:03             ` Gerald Pfeifer
2021-09-17 14:10               ` [committed] Fortran: Prefer GCC internal macros to float.h in ISO_Fortran_binding.h (was: [PATCH, Fortran] Revert to non-multilib-specific ISO_Fortran_binding.h) Tobias Burnus
2021-09-18  4:51                 ` Gerald Pfeifer
2021-09-13 17:39   ` [PATCH, Fortran] Revert to non-multilib-specific ISO_Fortran_binding.h Andreas Schwab
2021-09-13 18:07   ` Jakub Jelinek

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=b6c3cc69-7973-c7de-3540-1c38fcffdfa0@codesourcery.com \
    --to=sandra@codesourcery.com \
    --cc=andreast@freebsd.org \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gerald@pfeifer.com \
    --cc=jakub@redhat.com \
    --cc=tobias@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).