public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Schwinge <thomas@codesourcery.com>
To: Nathan Sidwell <nathan@codesourcery.com>,
	Bernd Schmidt	<bschmidt@redhat.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [ptx] Fix sso tests
Date: Tue, 24 Nov 2015 08:20:00 -0000	[thread overview]
Message-ID: <87k2p7rf9n.fsf@kepler.schwinge.homeip.net> (raw)
In-Reply-To: <5653740C.9010507@acm.org>

[-- Attachment #1: Type: text/plain, Size: 935 bytes --]

Hi!

On Mon, 23 Nov 2015 15:16:12 -0500, Nathan Sidwell <nathan@acm.org> wrote:
> The gcc.dg/sso tests gratuitously fail on PTX because they use IO facilities 
> that don't exist there.  This  patch changes the dumping to use the putchar 
> function call (and not a macro), and not use fputs.

>  void put (const char s[])
>  {
> +#ifdef  __nvptx__
> +  int i;
> +  for (i = 0; s[i]; i++)
> +    putchar (s[i]);
> +#else
>    fputs (s, stdout);
> +#endif
>  }

Doesn't __builtin_printf work?


More generally, I've been wondering before, whether we should improve the
I/O support in nvptx' newlib.  I suppose (but have not verified) that the
_stdout member of _REENT (struct _reent) will by default be initilized to
&__sf_fake_stdout (and similar for stderr), which we could detect in
nvptx I/O functions, and in such cases use the PTX printf function.  Or
something along these lines.


Grüße
 Thomas

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

      parent reply	other threads:[~2015-11-24  8:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-23 20:20 Nathan Sidwell
2015-11-23 20:45 ` Jeff Law
2015-11-23 21:00   ` Nathan Sidwell
2015-11-24  5:38     ` Jeff Law
2015-11-24 14:03       ` Nathan Sidwell
2015-11-24  8:20 ` Thomas Schwinge [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=87k2p7rf9n.fsf@kepler.schwinge.homeip.net \
    --to=thomas@codesourcery.com \
    --cc=bschmidt@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nathan@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).