Hi all,
While working on netconsole for ROMCC I noticed following:
int main(void) { /* volatile */ union { unsigned char byte[2]; unsigned short word; } value;
value.byte[1] = 1; }
./build/util/romcc/romcc -mcpu=p2 a.c
a.c:9.18: 0x86bb968 tuple Internal compiler error: tuple used Aborted
Second problem is more complex:
romstage.c:74.0: Internal compiler error: constant for unknown type
The romstage 74 is end... I will try to come with some testcase for the second problem later or with the a patch that exhibits the problem.
Please Eric can you help,
Thanks, Rudolf
On Tue, Jun 15, 2010 at 4:27 PM, Rudolf Marek r.marek@assembler.cz wrote:
Hi all,
While working on netconsole for ROMCC I noticed following:
int main(void) { /* volatile */ union { unsigned char byte[2]; unsigned short word; } value;
value.byte[1] = 1; }
./build/util/romcc/romcc -mcpu=p2 a.c
a.c:9.18: 0x86bb968 tuple Internal compiler error: tuple used
This case looks familiar.
From this message:
http://www.mail-archive.com/coreboot@coreboot.org/msg22555.html
Looking at the rest fragment that has been passed around I think the actual bug is that romcc allows non-static non-const arrays to be declared. I can not find any indication that I ever added support for this when I wrote romcc.
Thanks, Myles
Myles Watson mylesgw@gmail.com writes:
On Tue, Jun 15, 2010 at 4:27 PM, Rudolf Marek r.marek@assembler.cz wrote:
Hi all,
While working on netconsole for ROMCC I noticed following:
int main(void) { /* volatile */ union { unsigned char byte[2]; unsigned short word; } value;
value.byte[1] = 1; }
./build/util/romcc/romcc -mcpu=p2 a.c
a.c:9.18: 0x86bb968 tuple Internal compiler error: tuple used
This case looks familiar.
From this message:
http://www.mail-archive.com/coreboot@coreboot.org/msg22555.html
Looking at the rest fragment that has been passed around I think the actual bug is that romcc allows non-static non-const arrays to be declared. I can not find any indication that I ever added support for this when I wrote romcc.
That would be it.
Unions where you write a value in as one type, and read it out as another type also will not work with romcc.
It does looks like I need a better error check at the declaration of variables, I missed dealing with an array inside a union ick.
Eric
Hi all,
Second problem is very strange:
marekr2@kiur:~/dilna/coreboot$ make GEN build.h ROMCC romstage.inc ne2k.c:83.0: warning: "comment next line causes stuff to compile again" ne2k.c:126.0: warning: "Add timeout" romstage.c:74.0: Internal compiler error: constant for unknown type make: *** [build/mainboard/soyo/sy-6ba-plus-iii/romstage.inc] Aborted
The board is Soyo, you need to apply the attached patch.
If you comment out in ne2k.c line 84 it will compile again :/
I tried to isolate the problem but i was able to compile the ne2k.c just fine. I suspect romcc runs out of some resources.
Please let me know if you are able to reproduce the problem,
Thanks, Rudolf
On Wed, Jun 16, 2010 at 2:41 PM, Rudolf Marek r.marek@assembler.cz wrote:
Hi all,
Second problem is very strange:
marekr2@kiur:~/dilna/coreboot$ make GEN build.h ROMCC romstage.inc ne2k.c:83.0: warning: "comment next line causes stuff to compile again" ne2k.c:126.0: warning: "Add timeout" romstage.c:74.0: Internal compiler error: constant for unknown type make: *** [build/mainboard/soyo/sy-6ba-plus-iii/romstage.inc] Aborted
The board is Soyo, you need to apply the attached patch.
If you comment out in ne2k.c line 84 it will compile again :/
This is what I get: Internal compiler error: constant for unknown type
If I comment out lines 83 & 84 I get:
src/lib/ne2k.c:71: warning: no previous prototype for 'eth_pio_write_byte' src/lib/ne2k.c:125:2: warning: #warning "Add timeout" src/lib/ne2k.c:89: warning: 'eth_pio_read_byte' defined but not used CC lib/compute_ip_checksum.initobj.o CC console/vtxprintf.initobj.o CC arch/i386/lib/printk_init.initobj.o CC arch/i386/lib/cbfs_and_run.initobj.o LINK coreboot OBJCOPY coreboot.bootblock CC arch/i386/lib/c_start.o CC lib/ne2k.driver.o src/lib/ne2k.c:71: warning: no previous prototype for 'eth_pio_write_byte' src/lib/ne2k.c:125:2: warning: #warning "Add timeout" src/lib/ne2k.c:89: warning: 'eth_pio_read_byte' defined but not used CC console/uart8250_console.driver.o make: *** No rule to make target `build/console/ne2k_console.driver.o', needed by `build/coreboot_ram.o'. Stop.
Thanks, Myles
Ah sorry I forgot one more file. Now it should be better.
But yes I got same error.
Thanks, Rudolf
Sorry Rudolf, I forgot to copy the list.
It looks like romcc doesn't support unsigned char there. I did this:
- outb(datxa, eth_nic_base + NE_ASIC_OFFSET + NE_DATA); + outb((char)datxa, eth_nic_base + NE_ASIC_OFFSET + NE_DATA);
And it compiles again.
Here's the code from romcc.c:
static struct triple *int_const( struct compile_state *state, struct type *type, ulong_t value) { struct triple *result; switch(type->type & TYPE_MASK) { case TYPE_CHAR: case TYPE_INT: case TYPE_UINT: case TYPE_LONG: case TYPE_ULONG: break; default: internal_error(state, 0, "constant for unknown type"); } result = triple(state, OP_INTCONST, type, 0, 0); result->u.cval = value; return result; }
Thanks, Myles
Hm,
It does not work here. If i change it I still got
marekr2@kiur:~/dilna/coreboot$ make GEN build.h ROMCC romstage.inc ne2k.c:83.0: warning: "comment next line causes stuff to compile again" ne2k.c:126.0: warning: "Add timeout" romstage.c:74.0: Internal compiler error: constant for unknown type make: *** [build/mainboard/soyo/sy-6ba-plus-iii/romstage.inc] Aborted
outb((char)datxa, eth_nic_base + NE_ASIC_OFFSET + NE_DATA);
this is how it looks now. Maybe you changed more?
Thanks,
Rudolf
On Wed, Jun 16, 2010 at 4:03 PM, Rudolf Marek r.marek@assembler.cz wrote:
Hm,
It does not work here. If i change it I still got
You're right. I added TYPE_UCHAR:
before: case TYPE_CHAR: case TYPE_INT: case TYPE_UINT:
after: case TYPE_CHAR: case TYPE_UCHAR: case TYPE_INT: case TYPE_UINT:
I don't know how safe that is, but it seems like it should work. I don't know the difference between constants that are unsigned or signed characters. In the past it's been better to work around romcc than modify it unless Eric helps.
Sorry for the confusion. I thought I changed it back before I tried it last.
Thanks, Myles