public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/31385]  New: gcc fails to find spill register for decimal arithmetic
@ 2007-03-28 18:01 beebe at math dot utah dot edu
  2007-08-17 18:21 ` [Bug target/31385] " janis at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: beebe at math dot utah dot edu @ 2007-03-28 18:01 UTC (permalink / raw)
  To: gcc-bugs

In compilation of a large library of code for decimal floating-point
arithmetic, I found that compilations with -g would succeed, but most
would fail with -O1, -O2, or -O3 on IA-32.  I've taken a single example
and chopped away extraneous code to produce a standalone file
that exhibits the compiler error:

% cat bug002.c
typedef _Decimal32 fp_t;

extern fp_t g(fp_t);

fp_t
bug(fp_t x)
{
    fp_t result;
    int n;
    fp_t f, f3, y, z;

    n = 0;
    y = 1.DF;
    f = g(x);

    if (f < 0.DF)
        f = -f;

    f3 = 2.DF;

    z = (y + y + f / (y * y));
    y = (z + z) / (9.DF) + f3 / (z * z);

    result = y;

    return (result);
}

% gcc --version
gcc (GCC) 4.3.0 20070316 (experimental)

% gcc -c -O1 bug002.c
bug002.c: In function 'bug':
bug002.c:27: error: unable to find a register to spill in class 'GENERAL_REGS'
bug002.c:27: error: this is the insn:
(insn 25 24 26 3 (set (subreg:SI (reg/v:SD 59 [ f ]) 0)
        (plus:SI (subreg:SI (reg/v:SD 59 [ f ]) 0)
            (const_int -2147483648 [0x80000000]))) 144 {*lea_1} (nil)
    (nil))
bug002.c:27: internal compiler error: in spill_failure, at reload1.c:1944


-- 
           Summary: gcc fails to find spill register for decimal arithmetic
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: beebe at math dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

end of thread, other threads:[~2007-08-27 14:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-28 18:01 [Bug c/31385] New: gcc fails to find spill register for decimal arithmetic beebe at math dot utah dot edu
2007-08-17 18:21 ` [Bug target/31385] " janis at gcc dot gnu dot org
2007-08-18 16:47 ` hjl at lucon dot org
2007-08-27 14:15 ` hjl at gcc dot gnu dot org
2007-08-27 14:17 ` hjl at lucon 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).