public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/36090]  New: [4.3/4.4 Regression] ppc64 cacoshl miscompilation
@ 2008-04-30 20:16 jakub at gcc dot gnu dot org
  2008-04-30 20:16 ` [Bug target/36090] " jakub at gcc dot gnu dot org
                   ` (44 more replies)
  0 siblings, 45 replies; 46+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-04-30 20:16 UTC (permalink / raw)
  To: gcc-bugs

extern void abort (void);

long double __attribute__ ((noinline)) foo (long double x)
{
  return __builtin_signbit (x) ? 3.1415926535897932384626433832795029L : 0.0;
}

int
main (void)
{
  if (foo (-1.0L) != 3.1415926535897932384626433832795029L)
    abort ();
  return 0;
}

is miscompiled with -O2 -m64 -mlong-double-128.
Both doubles of the long double return value from foo as the high double
of PI.
The assembly loads this long double value into 0/11 register pair using:
        ld 11,.LC1@toc(2)
        ld 0,.LC1@toc(2)
In RTL there is actually the +8 for the first insn present, but with double
negation:
(insn:TI 40 20 39 t.c:5 (set (reg:DI 11 11 [orig:132 D.1237+8 ] [132])
        (mem/u/c/i:DI (plus:DI (reg:DI 2 2)
                (const:DI (minus:DI (symbol_ref/u:DI ("*.LC1") [flags 0x2])
                        (const:DI (plus:DI (symbol_ref:DI ("*.LCTOC1"))
                                (const_int -8 [0xfffffffffffffff8])))))) [2 S8
A64])) 334 {*movdi_internal64} (nil))

(insn 39 40 23 t.c:5 (set (reg:DI 0 0 [orig:131 D.1237 ] [131])
        (mem/u/c/i:DI (plus:DI (reg:DI 2 2)
                (const:DI (minus:DI (symbol_ref/u:DI ("*.LC1") [flags 0x2])
                        (symbol_ref:DI ("*.LCTOC1"))))) [2 S8 A128])) 334
{*movdi_internal64} (expr_list:REG_DEAD (reg:DI 2 2)
        (nil)))
So, either the output routines need to be fixed to handle even this weirdo
addressing correctly and output 8+.LC1@toc(2), or the pass that generate this
needs to be changed to generate something better.


-- 
           Summary: [4.3/4.4 Regression] ppc64 cacoshl miscompilation
           Product: gcc
           Version: 4.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org
GCC target triplet: powerpc64-linux


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


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

end of thread, other threads:[~2008-05-18 20:25 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-30 20:16 [Bug target/36090] New: [4.3/4.4 Regression] ppc64 cacoshl miscompilation jakub at gcc dot gnu dot org
2008-04-30 20:16 ` [Bug target/36090] " jakub at gcc dot gnu dot org
2008-04-30 20:26 ` jakub at gcc dot gnu dot org
2008-04-30 20:39 ` jakub at gcc dot gnu dot org
2008-04-30 21:18 ` dje at gcc dot gnu dot org
2008-05-01  2:33 ` dje at gcc dot gnu dot org
2008-05-01  2:41 ` dje at gcc dot gnu dot org
2008-05-01  7:14 ` jakub at gcc dot gnu dot org
2008-05-01 15:08 ` dje at gcc dot gnu dot org
2008-05-01 15:47 ` dje at gcc dot gnu dot org
2008-05-01 17:16 ` jakub at gcc dot gnu dot org
2008-05-01 17:34 ` dje at gcc dot gnu dot org
2008-05-02  9:35 ` jakub at gcc dot gnu dot org
2008-05-02  9:47 ` jakub at gcc dot gnu dot org
2008-05-02 12:42 ` dje at gcc dot gnu dot org
2008-05-02 15:11 ` dje at gcc dot gnu dot org
2008-05-02 15:44 ` dje at gcc dot gnu dot org
2008-05-02 15:46 ` dje at gcc dot gnu dot org
2008-05-02 16:30 ` bonzini at gnu dot org
2008-05-02 17:37 ` dje at gcc dot gnu dot org
2008-05-02 21:08 ` bonzini at gnu dot org
2008-05-02 21:24 ` dje at gcc dot gnu dot org
2008-05-03  7:13 ` bonzini at gnu dot org
2008-05-03 13:22 ` dje at gcc dot gnu dot org
2008-05-03 13:26 ` bonzini at gnu dot org
2008-05-03 14:21 ` dje at gcc dot gnu dot org
2008-05-03 15:48 ` bonzini at gnu dot org
2008-05-04 19:48 ` jakub at gcc dot gnu dot org
2008-05-04 20:09 ` dje at gcc dot gnu dot org
2008-05-08 16:37 ` dje at gcc dot gnu dot org
2008-05-08 16:41 ` dje at gcc dot gnu dot org
2008-05-09  5:37 ` cnstar9988 at gmail dot com
2008-05-09 14:19 ` jakub at gcc dot gnu dot org
2008-05-09 14:33 ` jakub at gcc dot gnu dot org
2008-05-09 15:52 ` bonzini at gnu dot org
2008-05-09 17:15 ` dje at gcc dot gnu dot org
2008-05-12 15:51 ` bonzini at gnu dot org
2008-05-12 16:33 ` dje at gcc dot gnu dot org
2008-05-12 16:48 ` bonzini at gnu dot org
2008-05-12 16:52 ` dje at gcc dot gnu dot org
2008-05-12 16:55 ` bonzini at gnu dot org
2008-05-16 19:45 ` rguenth at gcc dot gnu dot org
2008-05-18 18:32 ` jakub at gcc dot gnu dot org
2008-05-18 20:20 ` jakub at gcc dot gnu dot org
2008-05-18 20:21 ` jakub at gcc dot gnu dot org
2008-05-18 20:25 ` jakub at gcc dot 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).