Hi all!
I think there is a problem wiith using tcc for compiling a rock parser
sources. Some snippet (NagaQueen.c):

if (!yymatchClass(G, (const unsigned char
*)"\000\000\000\000\000\000\377\003\376\377\377\207\376\377\377\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000",
"a-zA-Z0-9_")) goto l920;

l921:;
{  int yypos922= G->pos, yythunkpos922= G->thunkpos;
if (!yymatchClass(G, (const unsigned char
*)"\000\000\000\000\000\000\377\003\376\377\377\207\376\377\377\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000",
"a-zA-Z0-9_")) goto l922;

And a test program:

#include <stdio.h>
int main()
{
    const char *const p1 = "1234567890qwertyuiopasdfghjklzxcvbnm";
    const char *const p2 = "1234567890qwertyuiopasdfghjklzxcvbnm";
    if (p1 == p2 )
        printf("OK\n");
    else
        printf("There is a problem\n");
}

A gcc output: OK
A tcc output:  There is a problem

A proposal: introduce a string constant cache in a function scope
level (like this is done for the identifers). Would this help for a
general purpose programs? How often this programming style is used?

PS: this is only a size of the produced exe problem

_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to