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

* [Bug target/39949] [4.5 regression] Revision 146874 breaks %z on x87 insns
  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 ` ubizjak at gmail dot com
  2009-04-28 16:45 ` hjl dot tools at gmail dot com
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ubizjak at gmail dot com @ 2009-04-28 16:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from ubizjak at gmail dot com  2009-04-28 16:39 -------
Wontfix, the code uses undocumented operand modifier.


-- 

ubizjak at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |WONTFIX


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


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

* [Bug target/39949] [4.5 regression] Revision 146874 breaks %z on x87 insns
  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
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-04-28 16:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from hjl dot tools at gmail dot com  2009-04-28 16:45 -------
None of x86 insn modifiers are documented and %z comments in gcc
source codes on 4.3/4.4 branches are simply incorrect. %z has been
working on x87 insns since day 1 on gcc.gnu.org back to 1992. Why
do we have to break existing user codes with few benefits to anyone?


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|WONTFIX                     |


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


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

* [Bug target/39949] [4.5 regression] Revision 146874 breaks %z on x87 insns
  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
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: bonzini at gnu dot org @ 2009-04-28 18:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from bonzini at gnu dot org  2009-04-28 18:12 -------
H.J., please do not make up testcases and tell us who was actually using %z for
x87 as of March 31st, 2009.

Otherwise, this bug has the same level of seriousness as the one I'm closing it
as duplicate of.

*** This bug has been marked as a duplicate of 5 ***


-- 

bonzini at gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bonzini at gnu dot org
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


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

* [Bug target/39949] [4.5 regression] Revision 146874 breaks %z on x87 insns
  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
                   ` (2 preceding siblings ...)
  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
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: bonzini at gnu dot org @ 2009-04-28 18:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from bonzini at gnu dot org  2009-04-28 18:13 -------
reopening...


-- 

bonzini at gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|DUPLICATE                   |


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


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

* [Bug target/39949] [4.5 regression] Revision 146874 breaks %z on x87 insns
  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
                   ` (3 preceding siblings ...)
  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
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: bonzini at gnu dot org @ 2009-04-28 18:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from bonzini at gnu dot org  2009-04-28 18:14 -------
... to mark as waiting.


-- 

bonzini at gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


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


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

* [Bug target/39949] [4.5 regression] Revision 146874 breaks %z on x87 insns
  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
                   ` (4 preceding siblings ...)
  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
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-04-28 18:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from hjl dot tools at gmail dot com  2009-04-28 18:22 -------
(In reply to comment #3)
> H.J., please do not make up testcases and tell us who was actually using %z for
> x87 as of March 31st, 2009.
> 

If I had told you that we had had several internal applications
which use %z on x87 since 1998, would it make a difference?


-- 


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


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

* [Bug target/39949] [4.5 regression] Revision 146874 breaks %z on x87 insns
  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
                   ` (5 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-04-28 18:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pinskia at gcc dot gnu dot org  2009-04-28 18:23 -------
Considering this is all undocumened no.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |WONTFIX


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


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

* [Bug target/39949] [4.5 regression] Revision 146874 breaks %z on x87 insns
  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
                   ` (6 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: bonzini at gnu dot org @ 2009-04-28 19:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from bonzini at gnu dot org  2009-04-28 19:33 -------
Subject: Re:  [4.5 regression] Revision 146874 breaks %z on 
        x87 insns

> If I had told you that we had had several internal applications
> which use %z on x87 since 1998, would it make a difference?

Maybe no, but it wouldn't sound so kafkian.


-- 


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


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

* [Bug target/39949] [4.5 regression] Revision 146874 breaks %z on x87 insns
  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
                   ` (7 preceding siblings ...)
  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
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-04-28 20:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from rguenth at gcc dot gnu dot org  2009-04-28 20:47 -------
FWIW I agree.  Relying on undocumented behavior is as invalid as any other
invalid asm that happened to work in the past.


-- 


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


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

* [Bug target/39949] [4.5 regression] Revision 146874 breaks %z on x87 insns
  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
                   ` (8 preceding siblings ...)
  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
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-04-28 23:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from jakub at gcc dot gnu dot org  2009-04-28 23:51 -------
I disagree, while the modifiers are perhaps undocumented, there is tons of
software in the wild that uses them heavily (I don't know about %z, but many
other modifiers) and breaking that all would be a terrible idea.
Look at longlong.h for examples, glibc, Linux kernel just to name a few.  Just
do
find . -name \*.[ch] | xargs grep '[^%]%[a-zA-Z][0-9]'
and you'll see lots of those (of course with some false positives, but those
are
easily recognizable), on many different targets.
The right thing is just to document them.


-- 


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


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

* [Bug target/39949] [4.5 regression] Revision 146874 breaks %z on x87 insns
  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
                   ` (9 preceding siblings ...)
  2009-04-28 23:51 ` jakub at gcc dot gnu dot org
@ 2009-04-29  5:10 ` bonzini at gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: bonzini at gnu dot org @ 2009-04-29  5:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from bonzini at gnu dot org  2009-04-29 05:09 -------
Subject: Re:  [4.5 regression] Revision 146874 breaks %z on 
        x87 insns

> The right thing is just to document them.

Agreed.  But the question is whether to break %z and all but one
person reckon it would be actually *fixing* it.

Paolo


-- 


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