public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libffi/41908]  New: closures fail for some structure arguments containing floats
@ 2009-11-02 15:55 rfm at gnu dot org
  2009-11-02 15:58 ` [Bug libffi/41908] " rfm at gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: rfm at gnu dot org @ 2009-11-02 15:55 UTC (permalink / raw)
  To: gcc-bugs

For a closure, when an argument is a structure containing multiple floats, it
seems that all but the first  two floats are lost (on my machine they seem to
consistently be set to zeros).

This is a big problem in GNUstep where we pass NSRect structures (containing
four floats), but I managed to reproduce it by changing one of the libffi
testsuite files to pass a structure containing four floats.

I have reproduced this problem with libffi from the 4.? series of gcc and have
also found it with libffi-3.0.9rc3


-- 
           Summary: closures fail for some structure arguments containing
                    floats
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libffi
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rfm at gnu dot org
 GCC build triplet: x86_64-linux-gnu
  GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu


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


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

* [Bug libffi/41908] closures fail for some structure arguments containing floats
  2009-11-02 15:55 [Bug libffi/41908] New: closures fail for some structure arguments containing floats rfm at gnu dot org
@ 2009-11-02 15:58 ` rfm at gnu dot org
  2009-11-02 21:18 ` andreast at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rfm at gnu dot org @ 2009-11-02 15:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rfm at gnu dot org  2009-11-02 15:58 -------
Created an attachment (id=18950)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18950&action=view)
test code for bug 419087

This is test code adapted from the libffi testsuite ... it could be added as a
new regression test.


-- 


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


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

* [Bug libffi/41908] closures fail for some structure arguments containing floats
  2009-11-02 15:55 [Bug libffi/41908] New: closures fail for some structure arguments containing floats rfm at gnu dot org
  2009-11-02 15:58 ` [Bug libffi/41908] " rfm at gnu dot org
@ 2009-11-02 21:18 ` andreast at gcc dot gnu dot org
  2009-11-02 21:19 ` andreast at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: andreast at gcc dot gnu dot org @ 2009-11-02 21:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from andreast at gcc dot gnu dot org  2009-11-02 21:18 -------
Subject: Bug 41908

Author: andreast
Date: Mon Nov  2 21:18:17 2009
New Revision: 153824

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153824
Log:
2009-11-02  Andreas Tobler  <a.tobler@schweiz.org>

        PR libffi/41908
        * testsuite/libffi.call/testclosure.c: New test.

Added:
    trunk/libffi/testsuite/libffi.call/testclosure.c
Modified:
    trunk/libffi/ChangeLog


-- 


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


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

* [Bug libffi/41908] closures fail for some structure arguments containing floats
  2009-11-02 15:55 [Bug libffi/41908] New: closures fail for some structure arguments containing floats rfm at gnu dot org
  2009-11-02 15:58 ` [Bug libffi/41908] " rfm at gnu dot org
  2009-11-02 21:18 ` andreast at gcc dot gnu dot org
@ 2009-11-02 21:19 ` andreast at gcc dot gnu dot org
  2009-11-03 17:47 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: andreast at gcc dot gnu dot org @ 2009-11-02 21:19 UTC (permalink / raw)
  To: gcc-bugs



-- 

andreast at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-11-02 21:19:18
               date|                            |


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


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

* [Bug libffi/41908] closures fail for some structure arguments containing floats
  2009-11-02 15:55 [Bug libffi/41908] New: closures fail for some structure arguments containing floats rfm at gnu dot org
                   ` (2 preceding siblings ...)
  2009-11-02 21:19 ` andreast at gcc dot gnu dot org
@ 2009-11-03 17:47 ` pinskia at gcc dot gnu dot org
  2009-11-12 11:48 ` rfm at gnu dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-11-03 17:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2009-11-03 17:46 -------
*** Bug 41923 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hjl dot tools at gmail dot
                   |                            |com


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


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

* [Bug libffi/41908] closures fail for some structure arguments containing floats
  2009-11-02 15:55 [Bug libffi/41908] New: closures fail for some structure arguments containing floats rfm at gnu dot org
                   ` (3 preceding siblings ...)
  2009-11-03 17:47 ` pinskia at gcc dot gnu dot org
@ 2009-11-12 11:48 ` rfm at gnu dot org
  2009-12-03 20:40 ` ubizjak at gmail dot com
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rfm at gnu dot org @ 2009-11-12 11:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rfm at gnu dot org  2009-11-12 11:48 -------
I'm a bit disappointed at the lack of activity on this bug report.

I've been looking at the libffi code myself (though I'm certainly no expert at
this low-level stuff) and have come up with two issues:

1. If I edit libffi-3.0.9rc3/src/x86/ffi64.c and comment out the condition
|| (n == 2 && SSE_CLASS_P (classes[0]) == SSE_CLASS_P (classes[1])) in
ffi_closure_unix64_inner()
then this bug goes away (and the change does not appear to break anything in
the testsuite).
Perhaps someone who understands this stuff could look at this and see why this
change appears to fix things (and what it might be breaking).

2. In the classify_argument() function in the same file, there is a comment
which reads:

/*  X86_64_X87UP_CLASS should be preceded by X86_64_X87_CLASS.  */

This doesn't match what the code does ... perhaps the code needs to be changed
to match the comment...
              classes[i] = X86_64_X87_CLASS;


-- 


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


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

* [Bug libffi/41908] closures fail for some structure arguments containing floats
  2009-11-02 15:55 [Bug libffi/41908] New: closures fail for some structure arguments containing floats rfm at gnu dot org
                   ` (4 preceding siblings ...)
  2009-11-12 11:48 ` rfm at gnu dot org
@ 2009-12-03 20:40 ` ubizjak at gmail dot com
  2009-12-03 21:05 ` ubizjak at gmail dot com
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ubizjak at gmail dot com @ 2009-12-03 20:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from ubizjak at gmail dot com  2009-12-03 20:39 -------
I have a patch.


-- 

ubizjak at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |ubizjak at gmail dot com
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2009-11-30 07:49:04         |2009-12-03 20:39:54
               date|                            |
   Target Milestone|---                         |4.5.0
            Version|unknown                     |4.5.0


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


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

* [Bug libffi/41908] closures fail for some structure arguments containing floats
  2009-11-02 15:55 [Bug libffi/41908] New: closures fail for some structure arguments containing floats rfm at gnu dot org
                   ` (5 preceding siblings ...)
  2009-12-03 20:40 ` ubizjak at gmail dot com
@ 2009-12-03 21:05 ` ubizjak at gmail dot com
  2009-12-04 18:42 ` uros at gcc dot gnu dot org
  2009-12-04 18:44 ` ubizjak at gmail dot com
  8 siblings, 0 replies; 10+ messages in thread
From: ubizjak at gmail dot com @ 2009-12-03 21:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from ubizjak at gmail dot com  2009-12-03 21:05 -------
Patch at http://gcc.gnu.org/ml/gcc-patches/2009-12/msg00216.html.


-- 

ubizjak at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |http://gcc.gnu.org/ml/gcc-
                   |                            |patches/2009-
                   |                            |12/msg00216.html


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


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

* [Bug libffi/41908] closures fail for some structure arguments containing floats
  2009-11-02 15:55 [Bug libffi/41908] New: closures fail for some structure arguments containing floats rfm at gnu dot org
                   ` (6 preceding siblings ...)
  2009-12-03 21:05 ` ubizjak at gmail dot com
@ 2009-12-04 18:42 ` uros at gcc dot gnu dot org
  2009-12-04 18:44 ` ubizjak at gmail dot com
  8 siblings, 0 replies; 10+ messages in thread
From: uros at gcc dot gnu dot org @ 2009-12-04 18:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from uros at gcc dot gnu dot org  2009-12-04 18:42 -------
Subject: Bug 41908

Author: uros
Date: Fri Dec  4 18:41:59 2009
New Revision: 154988

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154988
Log:
        PR libffi/41908
        * src/x86/ffi64.c (classify_argument): Update from
        gcc/config/i386/i386.c.
        (ffi_closure_unix64_inner): Do not use the address of two consecutive
        SSE registers directly.
        * testsuite/libffi.call/cls_dbls_struct.c (main): Remove xfail
        for x86_64 linux targets.


Modified:
    trunk/libffi/ChangeLog
    trunk/libffi/src/x86/ffi64.c
    trunk/libffi/testsuite/libffi.call/cls_dbls_struct.c


-- 


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


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

* [Bug libffi/41908] closures fail for some structure arguments containing floats
  2009-11-02 15:55 [Bug libffi/41908] New: closures fail for some structure arguments containing floats rfm at gnu dot org
                   ` (7 preceding siblings ...)
  2009-12-04 18:42 ` uros at gcc dot gnu dot org
@ 2009-12-04 18:44 ` ubizjak at gmail dot com
  8 siblings, 0 replies; 10+ messages in thread
From: ubizjak at gmail dot com @ 2009-12-04 18:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from ubizjak at gmail dot com  2009-12-04 18:43 -------
Fixed.


-- 

ubizjak at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2009-12-04 18:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-02 15:55 [Bug libffi/41908] New: closures fail for some structure arguments containing floats rfm at gnu dot org
2009-11-02 15:58 ` [Bug libffi/41908] " rfm at gnu dot org
2009-11-02 21:18 ` andreast at gcc dot gnu dot org
2009-11-02 21:19 ` andreast at gcc dot gnu dot org
2009-11-03 17:47 ` pinskia at gcc dot gnu dot org
2009-11-12 11:48 ` rfm at gnu dot org
2009-12-03 20:40 ` ubizjak at gmail dot com
2009-12-03 21:05 ` ubizjak at gmail dot com
2009-12-04 18:42 ` uros at gcc dot gnu dot org
2009-12-04 18:44 ` ubizjak at gmail dot com

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