public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "gcc-bugzilla at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/16819] New: internal error (non-static function call, empty struct as arg)
Date: Thu, 29 Jul 2004 12:32:00 -0000	[thread overview]
Message-ID: <20040729123210.16819.lindig@cs.uni-sb.de> (raw)


Compilic the code below with -O3 results in an internal compiler
error. The error is most likely corellated with empty structs
and and non-static functions. If functions are declared static
it does not occur, also it only occurs with empty structs passed by
value..

The code was generated with my test-code generator Quest:
http://www.st.cs.uni-sb.de/~lindig/src/quest/index.html

foo.c: In function `main':
foo.c:124: error: unable to find a register to spill in class `AREG'
foo.c:124: error: this is the insn:
(jump_insn:HI 32 170 37 0 (parallel [
            (set (pc)
                (if_then_else (eq (reg:DF 9 st(1) [orig:79 x002vg.x002vd ] [79])
                        (reg:DF 8 st [orig:80 x002pc ] [80]))
                    (label_ref 46)
                    (pc)))
            (clobber (reg:CCFP 18 fpsr))
            (clobber (reg:CCFP 17 flags))
            (clobber (scratch:HI))
        ]) 355 {*fp_jcc_5} (insn_list 30 (insn_list 31 (nil)))
    (expr_list:REG_UNUSED (scratch:HI)
        (expr_list:REG_UNUSED (reg:CCFP 17 flags)
            (expr_list:REG_UNUSED (reg:CCFP 18 fpsr)
                (expr_list:REG_DEAD (reg:DF 9 st(1) [orig:79 x002vg.x002vd ] [79])
                    (expr_list:REG_DEAD (reg:DF 8 st [orig:80 x002pc ] [80])
                        (expr_list:REG_UNUSED (scratch:HI)
                            (expr_list:REG_UNUSED (reg:CCFP 17 flags)
                                (expr_list:REG_UNUSED (reg:CCFP 18 fpsr)
                                    (expr_list:REG_BR_PROB (const_int 7000 [0x1b58])
                                        (nil)))))))))))
foo.c:124: internal compiler error: in spill_failure, at reload1.c:1887
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

Environment:
System: Linux jacobs 2.4.26-1-686 #1 Sat May 1 18:04:05 EST 2004 i686 GNU/Linux
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc-snapshot/configure --enable-languages=c --prefix=/tmp/lindig/gcc

How-To-Repeat:

    gcc -O3 foo.c
    

# 1 "foo.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "foo.c"





extern int printf (char *, ...);

static int errors = 0;

static void failed( int line )
{ printf ("failed in %s: %d\n", "foo.c", line); errors++; }

static struct x002tf { } x002vj = { };

static struct x002te { } x002ve = { };

static unsigned int *x002vf = (unsigned int *) 936956372U;

static union x002td { double x002vd[1]; } x002vg = { { 88192.222629 } };

static
struct x002tc
{
    double (**x002vc)[1];
    union x002tb { } x002vb;
    struct x002ta { } *x002va;
}
x002vh
=
    { (double (**)[1]) 221053595U, { }, (struct x002ta *) 215342829U };

static unsigned short int *x002vi = (unsigned short int *) 1191863793U;

struct x002tf
x002fa(
    struct x002te x002pa,
    unsigned int *x002pb,
    union x002td x002pc,
    struct x002tc x002pd,
    unsigned short int *x002pe
)
{
    if (x002vf != x002pb) failed (43);
    if (x002vg.x002vd[0] != x002pc.x002vd[0]) failed (44);
    if (x002vh.x002vc != x002pd.x002vc) failed (45);
    if (x002vh.x002va != x002pd.x002va) failed (46);
    if (x002vi != x002pe) failed (47);
    return x002vj;
}

static void x002fb( )
{
    struct x002tf x002vk;
    x002vk = x002fa (x002ve, x002vf, x002vg, x002vh, x002vi);
}

static struct x001th { } **x001vr = (struct x001th **) 282125612U;

static
union x001tg
{
    unsigned char x001vm;
    struct x001tf { char x001vk; float x001vj; } *x001vl;
    union x001te { unsigned char x001vh; struct x001td { } x001vg; } *x001vi;
}
x001vn
=
    { '\x77' };

static
struct x001tc
{ unsigned char x001vf; char **x001ve; unsigned int x001vd[2]; }
x001vo[2]
=
    {
        { '\x4f', (char **) 447267482U, { 17134777U, 449880647U } },
        { '\x3', (char **) 1576399922U, { 1846818777U, 928825020U } }
    };

static
struct x001tb
{ unsigned int *x001vc; unsigned char x001vb; double x001va[2][1]; }
x001vp
=
    {
        (unsigned int *) 2102563535U,
        '\x8',
        { { 36299.571769 }, { 62135.529636 } }
    };

static union x001ta { } x001vq = { };

struct x001th **
x001fa(
    union x001tg x001pa,
    struct x001tc x001pb[2],
    struct x001tb x001pc,
    union x001ta x001pd
)
{
    if (x001vn.x001vm != x001pa.x001vm) failed (101);
    if (x001vo[1].x001vf != x001pb[1].x001vf) failed (102);
    if (x001vo[0].x001vf != x001pb[0].x001vf) failed (103);
    if (x001vo[1].x001ve != x001pb[1].x001ve) failed (104);
    if (x001vo[0].x001ve != x001pb[0].x001ve) failed (105);
    if (x001vo[1].x001vd[1] != x001pb[1].x001vd[1]) failed (106);
    if (x001vo[1].x001vd[0] != x001pb[1].x001vd[0]) failed (107);
    if (x001vo[0].x001vd[1] != x001pb[0].x001vd[1]) failed (108);
    if (x001vo[0].x001vd[0] != x001pb[0].x001vd[0]) failed (109);
    if (x001vp.x001vc != x001pc.x001vc) failed (110);
    if (x001vp.x001vb != x001pc.x001vb) failed (111);
    if (x001vp.x001va[1][0] != x001pc.x001va[1][0]) failed (112);
    if (x001vp.x001va[0][0] != x001pc.x001va[0][0]) failed (113);
    return x001vr;
}

static void x001fb( )
{
    struct x001th **x001vs;
    x001vs = x001fa (x001vn, x001vo, x001vp, x001vq);
    if (x001vr != x001vs) failed (121);
}

int main( int argc, char **argv ) { x002fb (); x001fb (); return errors; }

-- 
           Summary: internal error (non-static function call, empty struct
                    as arg)
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: lindig at cs dot uni-sb dot de
                CC: gcc-bugs at gcc dot gnu dot org
 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=16819


             reply	other threads:[~2004-07-29 12:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-29 12:32 gcc-bugzilla at gcc dot gnu dot org [this message]
2004-07-29 13:21 ` [Bug c/16819] [3.4/3.5 regression] " bangerth at dealii dot org
2004-07-29 13:37 ` bangerth at dealii dot org
2004-07-29 14:32 ` [Bug target/16819] " pinskia at gcc dot gnu dot org
2004-08-02 22:40 ` [Bug target/16819] [3.4/3.5 regression] ICE with empty struct as arg reichelt at gcc dot gnu dot org
2004-10-07 16:22 ` [Bug target/16819] [3.4/4.0 " pinskia at gcc dot gnu dot org
2004-11-01  0:47 ` mmitchel at gcc dot gnu dot org
2004-12-22  5:45 ` aoliva at gcc dot gnu dot org
2004-12-22 16:34 ` pinskia at gcc dot gnu dot org
2004-12-23 16:09 ` cvs-commit at gcc dot gnu dot org
2004-12-23 16:26 ` [Bug target/16819] [3.4 " pinskia at gcc dot gnu dot org
2004-12-23 21:39 ` cvs-commit at gcc dot gnu dot org
2004-12-23 23:09 ` pinskia at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040729123210.16819.lindig@cs.uni-sb.de \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).