public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* internal error asm
@ 1998-02-23 15:08 Ulrich Drepper
  1998-02-24  5:07 ` Jeffrey A Law
  0 siblings, 1 reply; 2+ messages in thread
From: Ulrich Drepper @ 1998-02-23 15:08 UTC (permalink / raw)
  To: egcs

Hi,

the following little piece of code crashed all gcc versions on ix86
which I could test:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include <stdio.h>

extern double bar (double);

int
baz (double d)
{
  double e = bar (d);
#ifdef BROKEN
  asm volatile ("" : : : "st");
#else
  asm volatile ("" : : : "memory");
#endif
  return printf ("%lg\n", e);
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

drepper@happy drepper$ gcc -Wa,-al -c v.c -O3 -DBROKEN
gcc: Internal compiler error: program cc1 got fatal signal 11

Not defining BROKEN lets the compiler finish but the result is not the
same (I want to force `e' being written to memory before calling
printf).  It's necessary to compile libm correctly.

-- Uli
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-02-24  5:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-02-23 15:08 internal error asm Ulrich Drepper
1998-02-24  5:07 ` Jeffrey A Law

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).