public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: pgw99@doc.ic.ac.uk
To: gcc-gnats@gcc.gnu.org
Subject: inline-asm/9637: arguments passed/return to asm block via mmx registers trigger failure
Date: Sun, 09 Feb 2003 18:56:00 -0000	[thread overview]
Message-ID: <20030209185425.12549.qmail@sources.redhat.com> (raw)


>Number:         9637
>Category:       inline-asm
>Synopsis:       arguments passed/return to asm block via mmx registers trigger failure
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Feb 09 18:56:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Philip Graham Willoughby
>Release:        gcc-3.2.2
>Organization:
>Environment:
SuSE Linux 7.2, glibc 2.2.2, binutils 2.13.1
>Description:
This error occurs with -O:
test.c: In function `AMD_sqrt':
test.c:18: Internal compiler error in fixup_var_refs_1, at function.c:1966

and this error without:
test.c: In function `AMD_sqrt':
test.c:18: Internal compiler error in instantiate_virtual_regs_1, at function.c:3971

When attempting to compile the following:

float
AMD_sqrt (float param)
{
  long long a, b, c;
  memcpy (&c, &param, sizeof (float));
  c >>= 32;
  asm("pfrsqrt    %y1, %y0 \n\t"
      "movq       %y2, %y1 \n\t"
      "pfmul      %y1, %y1 \n\t"
      "pfrsqit1   %y1, %y0 \n\t"
      "pfrcpit2   %y1, %y2 \n\t"
      "pfmul      %y0, %y1 \n\t"
      : "=y" (c), "=y" (a), "=y" (b)
      :"0" (c));
  memcpy (&param, &c, sizeof (float));
  c <<= 32;
  return param;
}

I have not used MMX assembler in GCC before, so I am willing to be told I'm responsible for this error.  However, I think it'd be best if it didn't fail in quite so dramatic a way.
>How-To-Repeat:
gcc -c -o test.o test.c

Where test.c contains the above code.  Adding/removing -O will let you see both cases.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2003-02-09 18:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-09 18:56 pgw99 [this message]
2003-05-10 21:16 Dara Hazeghi
2003-05-12 11:16 giovannibajo
2003-05-12 12:34 steven
2003-05-12 12:36 Philip Graham Willoughby

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=20030209185425.12549.qmail@sources.redhat.com \
    --to=pgw99@doc.ic.ac.uk \
    --cc=gcc-gnats@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).