public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Michael Matz <matz@suse.de>
To: Jan Hubicka <hubicka@ucw.cz>
Cc: Richard Guenther <richard.guenther@gmail.com>,
	Richard Henderson <rth@redhat.com>,
	Stephan Bergmann <sbergman@redhat.com>,
	gcc@gcc.gnu.org
Subject: Re: C++: Letting compiler know asm block can call function that can throw?
Date: Mon, 02 Apr 2012 14:08:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.64.1204021603570.25409@wotan.suse.de> (raw)
In-Reply-To: <20120330154537.GB1340@kam.mff.cuni.cz>

Hi,

On Fri, 30 Mar 2012, Jan Hubicka wrote:

> > Motion across hardreg sets/uses are not restricted.  And I would not expect
> > an optimizing compiler to do that (it's your own fault to use hardregs in
> > complex C code).
> 
> Well, the syscall sequence is an example of somehting that should be 
> inlined into arbitrary code w/o potential risk of ICEs.

The syscall sequence doesn't consist of multiple independend instructions, 
but rather is one asm with the right constraints.  So gcc has no chance to 
move something between the register setup (which only is explicit after 
reload) and the syscall instruction.  If syscall sequences were 
implemented like this:

inline int syscall1(int number, long arg1) {
  register int ax __asm__("eax");
  register long di __asm__("rdi");
  ax = number;
  di = arg1;
  __asm__ volatile ("syscall");
}

_then_ we would probably get miscompilations here and there.


Ciao,
Michael.

  reply	other threads:[~2012-04-02 14:08 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-29  7:05 Stephan Bergmann
2012-03-29  7:44 ` Jakub Jelinek
2012-03-29  8:48   ` Stephan Bergmann
2012-03-29  9:16     ` Richard Guenther
2012-03-29 12:51       ` Stephan Bergmann
2012-03-29 13:59         ` Michael Matz
2012-03-29 14:12           ` Andrew Haley
2012-03-29 15:10             ` Stephan Bergmann
2012-03-29 15:43             ` Michael Matz
2012-03-29 20:38               ` Eric Botcazou
2012-03-30  8:23           ` Richard Guenther
2012-03-29 16:14 ` Richard Henderson
2012-03-29 17:16   ` Jan Hubicka
2012-03-29 18:34     ` Richard Henderson
2012-03-30  8:19       ` Richard Guenther
2012-03-30 12:21         ` Jan Hubicka
2012-03-30 12:23           ` Richard Guenther
2012-03-30 15:46             ` Jan Hubicka
2012-04-02 14:08               ` Michael Matz [this message]
2012-04-02 14:17                 ` Jakub Jelinek
2012-04-02 16:04                   ` Michael Matz
2012-04-16 20:01                     ` Hans-Peter Nilsson

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=Pine.LNX.4.64.1204021603570.25409@wotan.suse.de \
    --to=matz@suse.de \
    --cc=gcc@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=richard.guenther@gmail.com \
    --cc=rth@redhat.com \
    --cc=sbergman@redhat.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).