This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

inline asm and multi-alternative constraints


Does gcc's inline asm support multi-alternative constraints? Or are they only supported for md?

The fact that it is doc'ed with the other constraints (https://gcc.gnu.org/onlinedocs/gcc/Constraints.html) says it works for inline. But https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10396#c17 says it only works for md.

I've got a patch ready to remove this section from the non-md docs (attached). But there probably needs to be more support than a 11 year old comment to approve it.

Dropping a supported feature is always controversial. But if it doesn't work, perhaps less so. After all, doc'ing something that doesn't work is just as bad.

dw

PS If it *is* supported, then the docs need some work.
Index: extend.texi
===================================================================
--- extend.texi	(revision 229293)
+++ extend.texi	(working copy)
@@ -7902,9 +7902,6 @@
 When supported, the target will define the preprocessor symbol
 @code{__GCC_ASM_FLAG_OUTPUTS__}.
 
-Because of the special nature of the flag output operands, the constraint
-may not include alternatives.
-
 Most often, the target has only one flags register, and thus is an implied
 operand of many instructions.  In this case, the operand should not be
 referenced within the assembler template via @code{%0} etc, as there's
Index: md.texi
===================================================================
--- md.texi	(revision 229293)
+++ md.texi	(working copy)
@@ -1093,7 +1093,6 @@
 @ifclear INTERNALS
 @menu
 * Simple Constraints::  Basic use of constraints.
-* Multi-Alternative::   When an insn has two alternative constraint-patterns.
 * Modifiers::           More precise control over effects of constraints.
 * Machine Constraints:: Special constraints for some particular machines.
 @end menu
@@ -1450,6 +1449,7 @@
 @code{sign_extend}.
 @end ifset
 
+@ifset INTERNALS
 @node Multi-Alternative
 @subsection Multiple Alternative Constraints
 @cindex multiple alternative constraints
@@ -1530,6 +1530,8 @@
 the first, 1 for the second alternative, etc.).  @xref{Output Statement}.
 @end ifset
 
+@end ifset
+
 @ifset INTERNALS
 @node Class Preferences
 @subsection Register Class Preferences

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]