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

CBE produces calls to __builtin_stack_restore with C compilers that don't support them #1785

Closed
lattner opened this issue May 12, 2007 · 10 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla compile-fail Use [accepts-invalid] and [rejects-valid] instead

Comments

@lattner
Copy link
Collaborator

lattner commented May 12, 2007

Bugzilla Link 1413
Resolution FIXED
Resolved on Feb 22, 2010 12:47
Version 2.0
OS All
CC @asl

Extended Description

The CBE is unconditionally turning calls to llvm.stacksave into calls to __builtin_stack_restore. It should
only do this if the C compiler supports these. Worst case, it should emit a header that looks like this:

#if !gcc or gcc is too old
#define __builtin_stack_restore(X) 0
#endif

-Chris

@lattner
Copy link
Collaborator Author

lattner commented May 12, 2007

assigned to @lattner

@asl
Copy link
Collaborator

asl commented May 12, 2007

Can we just emit some inline assembler as an workaround?

@lattner
Copy link
Collaborator Author

lattner commented May 12, 2007

in the generated c code? No. I think we should just disable the offending builtins. In 1.9, these
codegen'd to nothing anyway.

-Chris

@tlattner
Copy link
Contributor

Here is the gcc version I was using when I get this error.

[zion]$ gcc --version
gcc (GCC) 3.4.6 20060404 (Red Hat 3.4.6-8)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@asl
Copy link
Collaborator

asl commented May 12, 2007

But is it safe?

@lattner
Copy link
Collaborator Author

lattner commented May 12, 2007

no, it isn't safe, but it's better that not linking :)

-Chris

@lattner
Copy link
Collaborator Author

lattner commented May 14, 2007

@nlewycky
Copy link
Contributor

This won't work in the future. Please see GCC's llvm/llvm-bugzilla-archive#31128 .
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31128

@lattner
Copy link
Collaborator Author

lattner commented May 28, 2007

We'll just have to add an upper limit on the gcc version if that patch goes in.

@llvmbot
Copy link
Member

llvmbot commented Nov 26, 2021

mentioned in issue llvm/llvm-bugzilla-archive#1416

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
kitano-metro added a commit to RIKEN-RCCS/llvm-project that referenced this issue Mar 7, 2023
- llvm#1777 loop001が翻訳時無限LOOP
 liverange重なりチェックの誤りを修正。
- llvm#1785 TSVC/s291.cで結果NG
 SwplRegAllocInfoTbl::getReusePReg()で、nousePhysRegsの
 レジスタをチェックしていなかったのを修正。
- llvm#1787 TSVC/s315で翻訳エラー
 processimpdefsにて、undefな物理レジスタを複数の
 MIで参照していても処理されなかったのを修正。
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla compile-fail Use [accepts-invalid] and [rejects-valid] instead
Projects
None yet
Development

No branches or pull requests

5 participants