public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mark Mitchell <mark@codesourcery.com>
To: Mark Mitchell <mark@codesourcery.com>,   "Weddington\,
	Eric" <eweddington@cso.atmel.com>,
	 gcc-patches@gcc.gnu.org, rdsandiford@googlemail.com
Subject: Re: [PATCH] MIPS function attributes for interrupt handlers
Date: Wed, 22 Oct 2008 17:43:00 -0000	[thread overview]
Message-ID: <48FF550D.4060901@codesourcery.com> (raw)
In-Reply-To: <87vdvlhyv6.fsf@firetop.home>

Richard Sandiford wrote:

>> For example, writing:
>>
>>   void mylock()
>>     __attribute__((hidden))
>>     __attribute__((naked)) {
>>     ARCH_MYLOCK;
>>   }
>>
>> where ARCH_MYLOCK is a macro that expands to the CPU-specific assembly
>> implementation of a locking primitive seems likely to be useful.  Much
>> better than lots of #ifdef __linux__ and #ifdef __mips__ goo in a pure
>> assembler file.
> 
> I'm not convinced by this example.  GCC already provides a much
> more powerful way of doing this: extended asms.  Such an extended
> asm has many benefits over naked functions:

Sure, but it has one serious drawback: you can't use a non-standard
calling convention.

> I agree with what Thiemo said about defining these assembly macros.
> You said in reply that they were hard to write, but the point is that,
> for the ports we're talking about, you don't need to.

I'm sure they exist for MIPS GNU/Linux, for example.  But, I doubt they
exist for all architectures and all operating systems targeted by GCC,
in some convenient location where everyone can find them, under
licensing terms that everyone can use.

My argument here is that we have an opportunity to move towards making
this an architecture-independent feature.  But, if you block that
direction on MIPS, then we can't make it architecture-independent.
Whether or not the feature is most useful on MIPS or not is not the
point; the point is that it may be useful on many architectures, and
having MIPS be consistent is advantageous.

I feel the same way about the interrupt attribute.  Even on machines
where there is no special interrupt calling convention, supporting the
interrupt attribute -- and spelling it in the same way -- is useful,
since it allows people to write interrupt handlers without
conditionalizing for that.

> It just seems to me that we're trying to introduce a feature in the name
> of cross-platform consistency in cases where (a) in the foreseeable
> future, "cross-platform" will mean "across a handful of targets" and
> (b) we already have a better feature that is genuinely cross-platform.
> (I say "foreseeable future" because we can't of course predict what
> people will contribute.)

GCC is always incremental; it's relatively rare that something that
requires target support appears in all ports at once.  So, I agree that
it would take time to get consistency, but I don't see why that's a good
reason not to put this attribute into more ports.

If we really think this attribute is so harmful, we should be
deprecating it and removing it from other ports.  But, as defined now,
it doesn't seem linguistically problematic, and there is a use case for
it.

What is the harm in allowing it for MIPS?

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

  reply	other threads:[~2008-10-22 16:30 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-14 20:29 Fu, Chao-Ying
2008-10-15 23:47 ` Richard Sandiford
2008-10-20 23:03   ` Mark Mitchell
2008-10-20 23:24     ` Adam Nemet
2008-10-21 16:15     ` Weddington, Eric
2008-10-21 17:01       ` Mark Mitchell
2008-10-21 23:11         ` Richard Sandiford
2008-10-21 23:49           ` Mark Mitchell
2008-10-22  0:16             ` Thiemo Seufer
2008-10-22  1:05               ` Mark Mitchell
2008-10-22  6:36                 ` Thiemo Seufer
2008-10-22  6:54                   ` Mark Mitchell
2008-10-22  7:30                     ` Weddington, Eric
2008-10-22 10:03             ` Richard Sandiford
2008-10-22 17:43               ` Mark Mitchell [this message]
2008-10-22 20:28                 ` Richard Sandiford
2008-10-28  5:07   ` Fu, Chao-Ying
2008-10-29  8:05     ` Richard Sandiford
2008-10-16 22:34 ` Adam Nemet
2009-02-25  7:01 ` Fu, Chao-Ying
2009-02-25  9:35   ` Adam Nemet
2009-02-25 17:51   ` Daniel Jacobowitz
2009-02-26  9:48     ` Fu, Chao-Ying
2009-02-27 20:46       ` Maciej W. Rozycki
2009-02-28 10:15         ` Fu, Chao-Ying
2009-02-28 18:39           ` Maciej W. Rozycki
2008-10-17 11:40 Fu, Chao-Ying
2008-10-23  9:06 Ross Ridge

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=48FF550D.4060901@codesourcery.com \
    --to=mark@codesourcery.com \
    --cc=eweddington@cso.atmel.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rdsandiford@googlemail.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).