tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] tcc grammar problems


From: jiang
Subject: Re: [Tinycc-devel] tcc grammar problems
Date: Mon, 18 Aug 2014 20:39:26 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0

Hi,Thomas

fixstruct.patch
Let tcc compile yasm software

fixsym.patch
Make the following code to compile
int foo();
int main()
{
    int foo();
    return 0;
}

fixbitfields.patch
Nothing bug

Patch above, I request to join mob

pass test: gnumake yasm

在 2014年08月13日 21:43, Thomas Preud'homme 写道:
Le lundi 11 août 2014, 00:39:17 jiang a écrit :
+/* gen_ctrl */
+enum {
+    CTRL_NONE,
+    CTRL_CALL,
+    CTRL_FOCE,
+    CTRL_ARGS,
+    CTRL_RETS,
+    CTRL_INIT,
+    CTRL_USED,
+};
+ST_DATA int gen_ctrl;


This is  one of my  local branch  code,  want to join the  mob  after
Alright, I don't really want to see your local branch as long as it's not
ready. Just remove the unused enum for now and add them later in the patches
that add the pieces you are still working on.

Why this vtop > (vstack + 1)? What's so special about a stack with 3
entries or more? It looks fishy.
For example  the following expression:
a = b = c; -> (a = (b = c));
Requires  three  SValue,  will  be greater than  vstack + 1, ret  equal to
1. Return  right  value

a = b
Less than or equal  vstack + 1, ret  equal to  0.
Does not return  the right  value

Generate  less  machine code
Maybe but that seems wrong. Why not have some code for when you have 3
assignments? It's inelegant as it is now.

You should only deal with one assignment at a time so 2 Svalue. In the first
example you give, it means dealing with b = c, then return the Svalue that
correspond to it and then process the a = result assignment that has only 2
Svalue. Improving the right way would mean not generating the code right away
and doing a pass after that.

The final result of your patch should be quite small. If not, either I
underestimate the difficulty of this bug fix (it's quite possible) or you
overcomplicated things.

Cheers,

Thomas

Attachment: fixbitfields.patch
Description: Text Data

Attachment: fixstruct.patch
Description: Text Data

Attachment: fixsym.patch
Description: Text Data


reply via email to

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