forked from OSchip/llvm-project
5c562f62a4
I noticed that the following case would compile in Clang but not GCC: void *x(void) { void *p = &&foo; asm goto ("# %0\n\t# %l1":"+r"(p):::foo); foo:; return p; } Changing the output template above from %l2 would compile in GCC but not Clang. This demonstrates that when using tied outputs (say via the "+r" output constraint), the hidden inputs occur or are numbered BEFORE the labels, at least with GCC. In fact, GCC does denote this in its documentation: https://gcc.gnu.org/onlinedocs/gcc-11.2.0/gcc/Extended-Asm.html#Goto-Labels > Output operand with constraint modifier ‘+’ is counted as two operands > because it is considered as one output and one input operand. For the sake of compatibility, I think it's worthwhile to just make this change. It's better to use symbolic names for compatibility (especially now between released version of Clang that support asm goto with outputs). ie. %l1 from the above would be %l[foo]. The GCC docs also make this recommendation. Also, I cleaned up some cruft in GCCAsmStmt::getNamedOperand. AFAICT, NumPlusOperands was no longer used, though I couldn't find which commit didn't clean that up correctly. Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98096 Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103640 Link: https://gcc.gnu.org/onlinedocs/gcc-11.2.0/gcc/Extended-Asm.html#Goto-Labels Reviewed By: void Differential Revision: https://reviews.llvm.org/D115471 |
||
---|---|---|
.. | ||
CommandGuide | ||
DataFlowAnalysisIntroImages | ||
analyzer | ||
tools | ||
APINotes.rst | ||
AddressSanitizer.rst | ||
AutomaticReferenceCounting.rst | ||
Block-ABI-Apple.rst | ||
BlockLanguageSpec.rst | ||
CMakeLists.txt | ||
ClangCheck.rst | ||
ClangCommandLineReference.rst | ||
ClangFormat.rst | ||
ClangFormatStyleOptions.rst | ||
ClangFormattedStatus.rst | ||
ClangNvlinkWrapper.rst | ||
ClangOffloadBundler.rst | ||
ClangPlugins.rst | ||
ClangStaticAnalyzer.rst | ||
ClangTools.rst | ||
ClangTransformerTutorial.rst | ||
ConstantInterpreter.rst | ||
ControlFlowIntegrity.rst | ||
ControlFlowIntegrityDesign.rst | ||
CrossCompilation.rst | ||
DataFlowAnalysisIntro.md | ||
DataFlowSanitizer.rst | ||
DataFlowSanitizerDesign.rst | ||
DriverArchitecture.png | ||
DriverInternals.rst | ||
ExternalClangExamples.rst | ||
FAQ.rst | ||
HardwareAssistedAddressSanitizerDesign.rst | ||
HowToSetupToolingForLLVM.rst | ||
InternalsManual.rst | ||
IntroductionToTheClangAST.rst | ||
ItaniumMangleAbiTags.rst | ||
JSONCompilationDatabase.rst | ||
LTOVisibility.rst | ||
LanguageExtensions.rst | ||
LeakSanitizer.rst | ||
LibASTImporter.rst | ||
LibASTMatchers.rst | ||
LibASTMatchersReference.html | ||
LibASTMatchersTutorial.rst | ||
LibFormat.rst | ||
LibTooling.rst | ||
MSVCCompatibility.rst | ||
MatrixTypes.rst | ||
MemorySanitizer.rst | ||
Modules.rst | ||
ObjectiveCLiterals.rst | ||
OpenCLSupport.rst | ||
OpenMPSupport.rst | ||
PCHInternals.rst | ||
PCHLayout.graffle | ||
PCHLayout.png | ||
RAVFrontendAction.rst | ||
README.txt | ||
RefactoringEngine.rst | ||
ReleaseNotes.rst | ||
SYCLSupport.rst | ||
SafeStack.rst | ||
SanitizerCoverage.rst | ||
SanitizerSpecialCaseList.rst | ||
SanitizerStats.rst | ||
ShadowCallStack.rst | ||
SourceBasedCodeCoverage.rst | ||
ThinLTO.rst | ||
ThreadSafetyAnalysis.rst | ||
ThreadSanitizer.rst | ||
Toolchain.rst | ||
Tooling.rst | ||
UndefinedBehaviorSanitizer.rst | ||
UsersManual.rst | ||
conf.py | ||
doxygen-mainpage.dox | ||
doxygen.cfg.in | ||
index.rst | ||
make.bat |
README.txt
See llvm/docs/README.txt