public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: apl@alum.mit.edu
Cc: "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>
Subject: Re: Looking at UNSUPPORTED dejagnu tests for a port...
Date: Tue, 30 Mar 2021 20:35:10 +0100	[thread overview]
Message-ID: <CAH6eHdSdbZjEfOjmVGPEAxy0W-+MJJRvXt6ywJpgVoG6QnW13Q@mail.gmail.com> (raw)
In-Reply-To: <A8DE0FEC-B3E3-4F3C-BDEC-151227ED4C00@codegentllc.com>

On Tue, 30 Mar 2021 at 20:23, Alan Lehotsky <alehotsky@codegentllc.com> wrote:
>
> I’m doing some final polishing on a gcc 8.3 upgrade and taking a look at the unsupported tests.   Most of them are completely sensible (my port doesn’t support trampolines, for example).  But gcc.c-torture/execute/pr78622.c is marked as unsupported.  That appears to be due to the line
>
>    { dg-require-effective-target c99_runtime }
>
> I’m using newlib, and if I manually compile the test case with or without an explicit —std=c99, it compiles and links without error.
> Do I need to set something in the baseboards file or in a local .exp file to indicate that c99 is okay?

That effective-target is defined by this check:

# Return 1 if the target provides a full C99 runtime.

proc check_effective_target_c99_runtime { } {
    return [check_cached_effective_target c99_runtime {
    global srcdir

    set file [open "$srcdir/gcc.dg/builtins-config.h"]
    set contents [read $file]
    close $file
    append contents {
        #ifndef HAVE_C99_RUNTIME
        #error !HAVE_C99_RUNTIME
        #endif
    }
    check_no_compiler_messages_nocache c99_runtime assembly $contents
    }]
}

So it comes from the gcc/testsuite/gcc.dg/builtins-config.h header, which says:

/* Define HAVE_C99_RUNTIME if the entire C99 runtime is available on
   the target system.  The value of HAVE_C99_RUNTIME should be the
   same as the value of TARGET_C99_FUNCTIONS in the GCC machine
   description.  (Perhaps GCC should predefine a special macro
   indicating whether or not TARGET_C99_FUNCTIONS is set, but it does
   not presently do that.)  */

and then later:

/* Newlib has the "f" variants of the math functions, but not the "l"
   variants.  TARGET_C99_FUNCTIONS is only defined if all C99
   functions are present.  Therefore, on systems using newlib, tests
   of builtins will fail the "l" variants, and we should therefore not
   define HAVE_C99_RUNTIME.  Including <sys/types.h> gives us a way of
   seeing if _NEWLIB_VERSION is defined.  Including <math.h> would work
   too, but the GLIBC math inlines cause us to generate inferior code,
   which causes the test to fail, so it is not safe.  Including <limits.h>
   also fails because the include search paths are ordered such that GCC's
   version will be found before the newlib version.  Similarly, uClibc
   lacks the C99 functions.  */

      reply	other threads:[~2021-03-30 19:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-30 19:23 Alan Lehotsky
2021-03-30 19:35 ` Jonathan Wakely [this message]

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=CAH6eHdSdbZjEfOjmVGPEAxy0W-+MJJRvXt6ywJpgVoG6QnW13Q@mail.gmail.com \
    --to=jwakely.gcc@gmail.com \
    --cc=apl@alum.mit.edu \
    --cc=gcc@gcc.gnu.org \
    /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).