public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/59405] New: Incorrect FP<->MMX transition during call/ret
@ 2013-12-06 11:05 kirill.yukhin at intel dot com
  2013-12-06 11:17 ` [Bug target/59405] " ubizjak at gmail dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: kirill.yukhin at intel dot com @ 2013-12-06 11:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 59405
           Summary: Incorrect FP<->MMX transition during call/ret
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kirill.yukhin at intel dot com

Hello,
Attached test reproduces the error:
  $ gcc -m32 -mmmx 1.c
  $ ./a.out
  Aborted (core dumped)

Disassembly of the foo is:
foo32x2_be:
.LFB0:
        pushl   %ebp    # 22    *pushsi2        [length = 1]
        movl    %esp, %ebp      # 23    *movsi_internal/1       [length = 2]
        subl    $16, %esp       # 24    pro_epilogue_adjust_stack_si_add/1     
[length = 3]
        movq    %mm0, -8(%ebp)  # 3     *movv2sf_internal/9     [length = 4]
        movl    -4(%ebp), %eax  # 7     *movsf_internal/4       [length = 3]
        movl    %eax, -12(%ebp) # 14    *movsf_internal/5       [length = 3]
        flds    -12(%ebp)       # 21    *movsf_internal/1       [length = 3]
        leave   # 27    leave   [length = 1]
        ret     # 28    simple_return_internal  [length = 1]

We're passing v2sf vector using MMX register, which aliased to x87 stack.
Then we're trying to load FP to it, which leds to NaN.

As far as I understand, we need `emms' instruction between last MMX use and
before first x87 use.

Reproduces everywhere, up to 4.7.2 (may be earlier, I have no such).


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

end of thread, other threads:[~2013-12-08 14:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-06 11:05 [Bug target/59405] New: Incorrect FP<->MMX transition during call/ret kirill.yukhin at intel dot com
2013-12-06 11:17 ` [Bug target/59405] " ubizjak at gmail dot com
2013-12-06 11:18 ` kirill.yukhin at intel dot com
2013-12-06 11:19 ` kirill.yukhin at intel dot com
2013-12-06 11:25 ` ubizjak at gmail dot com
2013-12-06 11:47 ` kirill.yukhin at intel dot com
2013-12-06 12:00 ` hjl.tools at gmail dot com
2013-12-06 12:30 ` ubizjak at gmail dot com
2013-12-06 17:16 ` uros at gcc dot gnu.org
2013-12-06 17:27 ` ubizjak at gmail dot com
2013-12-08 14:20 ` uros at gcc dot gnu.org
2013-12-08 14:22 ` 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).