This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

internal error asm


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   `------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]