[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] [bootstrappable] Re: wip-full-source-bootstrap: from
From: |
grischka |
Subject: |
Re: [Tinycc-devel] [bootstrappable] Re: wip-full-source-bootstrap: from a 357-byte `hex0' to 'hello' |
Date: |
Fri, 08 Jan 2021 08:16:29 +0100 |
User-agent: |
Thunderbird 2.0.0.23 (Windows/20090812) |
Danny Milosavljevic wrote:
int main() {
double f = 1.0;
return 0;
}
...
I get a bus error here:
│ 0x24698 <init_putv+1688> vstr d0, [r0]
│
...
And indeed, (0x24b01e % 8) == 6, not 0.
...
*(double *)ptr = vtop->c.d
(the latter of which emits VFP instructions that expect double-aligned
pointers).
It seems that in fact, on certain systems, initializing intentionally
misaligned (packed) structure members could crash tcc already during
compilation.
But no such thing happens in this case. The 'ptr' in init_putv()
comes from
ptr = sec->data + c;
and it seems that if tcc is doing the right thing then 'c' cannot
be misaligned, and if malloc/realloc on that system is doing the
right thing, then sec->data cannot be misaligned either. So...?
--- grischka