public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/39949]  New: [4.5 regression] Revision 146874 breaks %z on x87 insns
@ 2009-04-28 16:34 hjl dot tools at gmail dot com
  2009-04-28 16:40 ` [Bug target/39949] " ubizjak at gmail dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-04-28 16:34 UTC (permalink / raw)
  To: gcc-bugs

Revision 146874:

http://gcc.gnu.org/ml/gcc-cvs/2009-04/msg01518.html

breaks %z on x87 insns:

[hjl@gnu-16 float-1]$ cat foo.c
#define fp_to_int(func,ftype,itype) \
itype \
__attribute__((noinline)) \
func (ftype value) \
{ \
  itype res; \
  __asm__ __volatile__ ("fistp%z0 %0" : "=m" (res) : "t" (value) : "st"); \
  return res; \
}

#define int_to_fp(func,itype,ftype) \
ftype \
__attribute__((noinline)) \
func (itype value) \
{ \
  ftype res; \
  __asm__ __volatile__ ("fild%z1 %1" : "=t" (res) : "m" (value)); \
  return res; \
}

fp_to_int (float_to_short, float, short);
fp_to_int (float_to_int, float, int);
fp_to_int (float_to_long_long, float, long long);

int_to_fp (short_to_float, short, float);
int_to_fp (int_to_float, int, float);
int_to_fp (long_long_to_float, long long, float);

extern void abort (void);

int
main ()
{
  float f = -2.0;
  short s = float_to_short (f);
  int i = float_to_int (f);
  long long l = float_to_long_long (f);

  if (f != short_to_float (s)
      || f != int_to_float (i)
      || f != long_long_to_float (i))
    abort ();
  return 0;
}
[hjl@gnu-16 float-1]$ make
/export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -o foo -O2 -m32 foo.c
foo.c: Assembler messages:
foo.c:21: Error: suffix or operands invalid for `fistp'
foo.c:25: Error: suffix or operands invalid for `fild'
make: *** [foo] Error 1
[hjl@gnu-16 float-1]$


-- 
           Summary: [4.5 regression] Revision 146874 breaks %z on x87 insns
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hjl dot tools at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39949


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

end of thread, other threads:[~2009-04-29  5:10 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-28 16:34 [Bug target/39949] New: [4.5 regression] Revision 146874 breaks %z on x87 insns hjl dot tools at gmail dot com
2009-04-28 16:40 ` [Bug target/39949] " ubizjak at gmail dot com
2009-04-28 16:45 ` hjl dot tools at gmail dot com
2009-04-28 18:12 ` bonzini at gnu dot org
2009-04-28 18:13 ` bonzini at gnu dot org
2009-04-28 18:14 ` bonzini at gnu dot org
2009-04-28 18:22 ` hjl dot tools at gmail dot com
2009-04-28 18:23 ` pinskia at gcc dot gnu dot org
2009-04-28 19:33 ` bonzini at gnu dot org
2009-04-28 20:47 ` rguenth at gcc dot gnu dot org
2009-04-28 23:51 ` jakub at gcc dot gnu dot org
2009-04-29  5:10 ` bonzini at gnu dot org

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