tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] [RFC] tinycc and rock compiler


From: Sergey Korshunoff
Subject: [Tinycc-devel] [RFC] tinycc and rock compiler
Date: Sun, 30 Aug 2015 04:53:49 +0300

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]