[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] Assertion `(v >= TREG_XMM0) && (v <= TREG_XMM7)' fail
From: |
Michael Matz |
Subject: |
Re: [Tinycc-devel] Assertion `(v >= TREG_XMM0) && (v <= TREG_XMM7)' failed |
Date: |
Mon, 31 Mar 2014 18:00:49 +0200 (CEST) |
User-agent: |
Alpine 2.00 (LNX 1167 2008-08-23) |
Hi,
On Mon, 31 Mar 2014, Thomas Preudhomme wrote:
> Le 2014-03-31 22:36, Jay Foad a écrit :
> > Hi,
> >
> > I get an assertion failure on this small test case:
> >
> > $ cat f.c
> > struct s { double a, b; } z;
> > struct s f() { return 0 ? z : 0; }
> > $ ./tcc f.c
> > tcc: x86_64-gen.c:494: load: Assertion `(v >= TREG_XMM0) && (v <=
> > TREG_XMM7)' failed.
> > Aborted (core dumped)
>
> Must be me in fdb3b10d0693cf33ce5a0acf17f0f323d79ee5f1.
No no, not your fault. It's a pre-existing problem of not being able to
correctly load a multi-reg structure that's a temporary result from the
conditional operator. Actually with this testcase tcc has two bugs. The
testcase as above is invalid C, both arms of the cond-expression must be
the same type. But even with this fixed it's not working:
$ cat f2.c
struct s { double a, b; } z;
struct s f(int c) { return c ? z : (struct s){0.0,0.0}; }
Something is either wrong with evaluating the cond-expr: vtop is the
address of the relevant structure in reg, but not marked specially.
Somehow the lvalue-ness/address-ness goes lost in the expansion of the
cond-expression.
Ciao,
Michael.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Tinycc-devel] Assertion `(v >= TREG_XMM0) && (v <= TREG_XMM7)' failed,
Michael Matz <=