[Tinycc-devel] Fwd: Miscompiled code (when building GCC)

2024-04-29 Thread Ekaitz Zarraga
(This is an email sent Andrius Štikonas but seems that it didn't do it to the mailing list) Hi, When trying to compile gcc, we stumbled upon strange segfault that seem to be coming from tcc. This is the reproducer: struct thing { unsigned index; char mem[1]; }; struct function {

Re: [Tinycc-devel] confused about reg_classes

2024-04-16 Thread Ekaitz Zarraga
Hi On 2024-04-16 20:21, Paul Moore wrote: I hope this helps, Ekaitz My original confusion stemmed from R_RET, I read it as returning what type of register to use for return values. Plus the fact that the upper level tccgen code deals in register types not registers (gv(rc), not gv(r)).

Re: [Tinycc-devel] Waiting for a release / Please delay any commits

2024-04-16 Thread Ekaitz Zarraga
Hi, On 2024-04-16 13:46, Detlef Riekenberg via Tinycc-devel wrote: My suggestions: * Please hold back any commit before the release. * If you think, you have an urgent change to fix an urgent bug, discuss it on the mailing list first. * Together, we decide, if we postpone the change after the

Re: [Tinycc-devel] confused about reg_classes

2024-04-16 Thread Ekaitz Zarraga
Hi, On 2024-04-16 01:50, Paul Moore wrote: Writing my own backend. I am trying to understand reg_classes On the face of it, it looks like a list of registers with flags saying what classes they are in (int , float..) So get_reg works down the table looking for registers of the right class,

[Tinycc-devel] RISC-V: Extended Asm support

2024-03-24 Thread Ekaitz Zarraga
. If anyone could review it, I'd be awesome. Thanks, Ekaitz From 97638d3e6a9b12bd7a209e16d28307b20edddfbb Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Sun, 17 Mar 2024 16:07:04 +0100 Subject: [PATCH] riscv: Add extended assembly support NOTE: In order to be able to deal with general

Re: [Tinycc-devel] recent riscv changes

2024-03-24 Thread Ekaitz Zarraga
Hi, Unfortunately, i do not know riscv assembly good enough to help here. Don't worry, I'll open a new thread here if someone else can help. Thanks, Ekaitz ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org

Re: [Tinycc-devel] issue in the recent riscv change, which added the ".option" asm directive

2024-03-23 Thread Ekaitz Zarraga
code in `subst_asm_operand` that I'm not sure about. -- Regards ... Detlef Thanks, Ekaitz From a62179bfcf8b4d4ac816b0227a894fa94f4cbc69 Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Sun, 17 Mar 2024 16:07:04 +0100 Subject: [PATCH] riscv: Add extended assembly support NOTE: In order

Re: [Tinycc-devel] Jump optimization questions - commit: 8227db3a

2022-08-26 Thread Ekaitz Zarraga
Hi, > > I have not other chance at the moment but make this backport, as well as I > > already did with GCC. > > > > Maybe this makes some more sense to you now you know. > > Actually no, it doesn't. I'm not the best person to clarify it further. I didn't take this decision. > > Could you

Re: [Tinycc-devel] Jump optimization questions - commit: 8227db3a

2022-08-25 Thread Ekaitz Zarraga
Hi grischka, > > vtop->r and vtop->cmp_r are used interchangeably in some parts of the > > codebase and I don't really understand why. > > I don't know where you see this? I'm probably mistaken by the code I read. I'm having a hard time reading it honestly. > Also, what is "all the C

Re: [Tinycc-devel] Jump optimization questions - commit: 8227db3a

2022-08-25 Thread Ekaitz Zarraga
. Thanks a lot, Ekaitz --- Original Message --- On Thursday, August 11th, 2022 at 1:36 PM, Ekaitz Zarraga wrote: > Hi, > > I think I have it mostly working following your advice but I cannot find how > to map v->cmp_r to the field that was storing that informat

Re: [Tinycc-devel] Jump optimization questions - commit: 8227db3a

2022-08-11 Thread Ekaitz Zarraga
int b = (vtop->cmp_r >> 8) & 0xff; switch (op) { ``` What do I need to replace `a` and `b` with to use the previous register access but I can't find how to do that. Could you please help me? Thank you, Ekaitz --- Original Message --- On Wednesday, August 10th, 2022 at

Re: [Tinycc-devel] Jump optimization questions - commit: 8227db3a

2022-08-10 Thread Ekaitz Zarraga
Hi, On Wednesday, August 10th, 2022 at 1:43 PM, grischka wrote: > On 09.08.2022 20:39, Ekaitz Zarraga wrote: > > > Hi all, > > > > I'm working on the RISC-V bootstrapping efforts for Guix, and I have to > > backport the RISC-V backend to an older TinyCC version

[Tinycc-devel] [SOLVED] Where are preprocessor macros set?

2022-08-10 Thread Ekaitz Zarraga
I finally found them. They are nowadays defined in the X-gen.c files, but in the past were inserted in libtcc.c using tcc_define_symbol. Thanks a lot anyway! Cheers, Ekaitz ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org

[Tinycc-devel] Jump optimization questions - commit: 8227db3a

2022-08-09 Thread Ekaitz Zarraga
Hi all, I'm working on the RISC-V bootstrapping efforts for Guix, and I have to backport the RISC-V backend to an older TinyCC version we have patched in order to be able to build it with a simpler compiler. The process worked mostly ok, but I can't understand very well the `gtst` function in

[Tinycc-devel] Where are preprocessor macros set?

2022-08-08 Thread Ekaitz Zarraga
Hi, I'm adding some features to TinyCC and I'm having trouble finding where are the preprocessor macros defined. For example: __riscv_xlen I searched through the codebase and I didn't find them. Can anyone gide me a little bit throught the codebase? Thanks!

Re: [Tinycc-devel] Cross-tinycc riscv64 assembler

2022-06-07 Thread Ekaitz Zarraga
Looks like it's working now! Thanks a ton! --- Original Message --- On Tuesday, June 7th, 2022 at 9:05 PM, Herman ten Brugge via Tinycc-devel wrote: > I pushed a fix. > > Please try again. > > Herman > > > On 6/7/22 12:46, Ekaitz Zarraga wrote: > >

[Tinycc-devel] Cross-tinycc riscv64 assembler

2022-06-07 Thread Ekaitz Zarraga
Hi, I've been trying to assemble small riscv64 programs with a cross compiler built by `make cross-riscv64` and I get weird errors. It's like instructions like `add a0,zero,zero` are not available, because it's asking for another argument. Am I doing something wrong? Thanks, Ekaitz

Re: [Tinycc-devel] rv32 support in tcc

2022-02-27 Thread Ekaitz Zarraga
> With that in mind, I suppose that the differences between these two will be > the length of the registers. So someone should be able to modify the TCC's > "RISC-V64" version and make it support the 32-bit RISC-V with a couple of > changes to both the backend and in the frontend (I suppose

Re: [Tinycc-devel] Can a biggener (and idiot) like me read and understand TCC's backend so I can create my own frontend with it?

2022-01-28 Thread Ekaitz Zarraga
Hi there, > I tried to read the Tiger Book with examples. I tried to learn Bison. I > tried to learn Lemon Parser. I could not write the grammar for a for-loop. > I don't know if that's because if stupid, if it wasn't well explained or if > it's difficult. There are various books that explain