public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/63607] New: run fail with -flto -mfloat-abi=softfp for armeb-linux-gnueabi-gcc
@ 2014-10-21  7:58 fei.yang0953 at gmail dot com
  2014-10-21  8:33 ` [Bug lto/63607] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: fei.yang0953 at gmail dot com @ 2014-10-21  7:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63607

            Bug ID: 63607
           Summary: run fail with -flto -mfloat-abi=softfp for
                    armeb-linux-gnueabi-gcc
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fei.yang0953 at gmail dot com

testsuite/gcc.dg/torture/stackalign/builtin-apply-4.c:

/* PR tree-optimization/20076 */
/* { dg-do run } */

extern void abort (void);

double
foo (int arg)
{
  if (arg != 116)
    abort();
  return arg + 1;
}

inline double
bar (int arg)
{
  foo (arg);
  __builtin_return (__builtin_apply ((void (*) ()) foo,
                                     __builtin_apply_args (), 16));
}

int
main (int argc, char **argv)
{
  if (bar (116) != 117.0)
    abort ();

  return 0;
}

Compile option: armeb-linux-gnueabi-gcc builtin-apply-4.c -static
-mfloat-abi=softfp -flto 

Disassembly:
0000076c <main>:
76c:  e92d4800     push   {fp, lr}
770:  e28db004     add    fp, sp, #4
774:  e3a02113     mov    r2, #-1073741820    ; 0xc0000004
778:  e30a3aaa     movw   r3, #43690   ; 0xaaaa
77c:  e34a3aaa     movt   r3, #43690   ; 0xaaaa
780:  e5823000     str    r3, [r2]
784:  e3a00074     mov    r0, #116     ; 0x74
788:  ebffffaa     bl     638 <bar.4066>
78c: eeb06b40    vmov.f64    d6, d0
790:  ed9f7b0a     vldr   d7, [pc, #40] ; 7c0 <main+0x54>
794:  eeb46b47     vcmp.f64     d6, d7

Analysis: Return value is not passed correctly. As we can see from line 790,
main gets the return value from d0 register, which is wrong as we use
-mfloat-abi=softfp here.


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

end of thread, other threads:[~2015-02-12 13:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-21  7:58 [Bug lto/63607] New: run fail with -flto -mfloat-abi=softfp for armeb-linux-gnueabi-gcc fei.yang0953 at gmail dot com
2014-10-21  8:33 ` [Bug lto/63607] " rguenth at gcc dot gnu.org
2014-10-23 12:31 ` fei.yang0953 at gmail dot com
2015-01-16 15:50 ` ramana at gcc dot gnu.org
2015-02-12 13:35 ` ramana at gcc dot gnu.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).