public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jan Hubicka <hubicka@ucw.cz>
To: Mikael Morin <mikael.morin@sfr.fr>
Cc: Jan Hubicka <hubicka@ucw.cz>, Richard Biener <rguenther@suse.de>,
	Joseph Myers <joseph@codesourcery.com>,
	gcc-patches@gcc.gnu.org,	burnus@net-b.de
Subject: Re: Fortran's C_CHAR type
Date: Thu, 11 Jun 2015 18:19:00 -0000	[thread overview]
Message-ID: <20150611175847.GB51916@kam.mff.cuni.cz> (raw)
In-Reply-To: <557864E5.3020008@sfr.fr>

> I have had a look at the table and the text around, and first I should
> correct myself.
> C_CHAR is 1, C_SIGNED_CHAR is 1, and the default values for len= and
> kind= are 1 as well.
> So, even if CHARACTER(KIND=C_CHAR) is what should be used as it's not
> dependent on the implementation's default kind choice, it boils down to
> the same as CHARACTER(C_CHAR), namely CHARACTER(len=1, kind=1) actually.

Thanks for explanation - as I said I hardly wrote any Fortran code except
for these few testcases :))
> 
> 
> And about the line saying CHARACTER(KIND=C_CHAR) interoperable with char
> in table 15.2:
> You're right, while I would myself prefer to use an
> INTEGER(KIND=C_SIGNED_CHAR) type, CHARACTER(KIND=C_CHAR) should be
> supported as well.
> That means that char should be compatible with char[1], I think.
> You said there is no guarantee they are passed the same way?

With LTO we definitely don't consider the types compatible, so we produce bogus
warning.  Things may work on TBAA side because it basically ignores arrays, but
I am not 100% sure - will double check.

For passing conventions, it is definitely not a requirement of C ABI to pass arrays
of size 1 and scalars same way. I think there are ABIs passing scalars in registers
and everything else in memory (PPC SYSV ABI?).

If we consider my testcase defined, I would suggest simply adding it to testsuite
and lets see if something breaks.
> 
> 
> > If you can look at the other c-bind testcases I produced, I would really appreachiate that.
> I have looked at:
> https://gcc.gnu.org/ml/gcc-patches/2015-06/msg00693.html
> https://gcc.gnu.org/ml/gcc-patches/2015-06/msg00713.html
> I saw nothing wrong with the tests.
> Avoiding character interoperability avoids most of the pain. ;-)

Hehe, quite on the contrary, I would say that both Richard and me had quite some pain from
the rest of interoperability rules, too ;))

Honza
> 
> Mikael

  reply	other threads:[~2015-06-11 17:58 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-08  1:23 Fix more of C/fortran canonical type issues Jan Hubicka
2015-06-08  5:45 ` Jan Hubicka
2015-06-08  7:25   ` Jan Hubicka
2015-06-08 13:43     ` Richard Biener
2015-06-08 14:07       ` Joseph Myers
2015-06-08 14:32         ` Richard Biener
2015-06-08 14:44           ` Joseph Myers
2015-06-08 14:52             ` Jan Hubicka
2015-06-08 14:54               ` Richard Biener
2015-06-08 15:11                 ` Jan Hubicka
2015-06-08 15:32                   ` Fortran's C_CHAR type Jan Hubicka
2015-06-10 11:50                     ` Mikael Morin
2015-06-10 14:55                       ` Jan Hubicka
2015-06-10 16:37                         ` Mikael Morin
2015-06-11 18:19                           ` Jan Hubicka [this message]
2015-06-09  9:50                   ` Fix more of C/fortran canonical type issues Richard Biener
2015-06-09 17:24                     ` Jan Hubicka
2015-06-11 17:58                       ` Jan Hubicka
2015-06-22  7:25                       ` Jan Hubicka
2015-06-22 15:09                         ` Richard Biener
2015-06-22 16:17                           ` Jan Hubicka
2015-06-08 15:08       ` Jan Hubicka
2015-06-08 16:54         ` Joseph Myers
2015-06-08 16:57           ` Jan Hubicka
2015-06-08 17:03             ` Joseph Myers
2015-06-08 22:06               ` Jan Hubicka
2015-06-08 23:01       ` Jan Hubicka
2015-10-08  3:47     ` Jan Hubicka
2015-10-08  7:44       ` Richard Biener
2015-10-08 16:17         ` Jan Hubicka
2015-10-10 19:45         ` Jan Hubicka
2015-06-08 13:37   ` Richard Biener

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=20150611175847.GB51916@kam.mff.cuni.cz \
    --to=hubicka@ucw.cz \
    --cc=burnus@net-b.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    --cc=mikael.morin@sfr.fr \
    --cc=rguenther@suse.de \
    /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).