Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: unknown constraint 'x' (x86_64) #1

Open
absop opened this issue Oct 14, 2019 · 0 comments
Open

error: unknown constraint 'x' (x86_64) #1

absop opened this issue Oct 14, 2019 · 0 comments

Comments

@absop
Copy link

absop commented Oct 14, 2019

I tried to use tcc run the following code on x86_64, it threw the following error.
gcc done it well.

double glibc_sqrt(double x)
{
    double res;

    asm("sqrtsd %1, %0" : "=x" (res) : "xm" (x));

    return res;
}

error: unknown constraint 'x'

MXEBot pushed a commit that referenced this issue Mar 7, 2023
we activate code (CODE_ON) only when the target labels are used,
which doesn't happen during nocode_wanted regions.  So, we cannot
just switch off code either during nocode_wanted regions, nothing
would switch it on again (except in the happy coincidences when we
outright save/restore nocode_wanted).  See the testcase for one
example, reduced from code generated by yarpgen: in
  ext = (xxx || 1)           // #1
        || ((xxx && 1) || 1) // #2
code is first suppressed in #1 normally, then (before this commit)
was suppressed via CODE_OFF during #2 (via indirect gjmp),
then the suppression from #1 was undone, but nothing undoes the
suppression from #2 anymore as everything therein was generated
while nocode_wanted was active.

So, we would either need to save/restore nocode_wanted around
some more expressions, activate CODE_ON also with unused labels (breaks
some optimizations we want), or deactivate CODE_OFF only when not
already in nocode_wanted state.  This does the latter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant