[llvm-commits] [llvm-gcc-4.0] r43735 - in /llvm-gcc-4.0/trunk/gcc: c-common.c llvm-convert.cpp
Dale Johannesen
dalej at apple.com
Mon Nov 5 13:26:34 PST 2007
Author: johannes
Date: Mon Nov 5 15:26:34 2007
New Revision: 43735
URL: http://llvm.org/viewvc/llvm-project?rev=43735&view=rev
Log:
Make labels in asm blocks work.
Modified:
llvm-gcc-4.0/trunk/gcc/c-common.c
llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp
Modified: llvm-gcc-4.0/trunk/gcc/c-common.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/c-common.c?rev=43735&r1=43734&r2=43735&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/gcc/c-common.c (original)
+++ llvm-gcc-4.0/trunk/gcc/c-common.c Mon Nov 5 15:26:34 2007
@@ -7899,12 +7899,18 @@
tree
iasm_label (tree labid, int atsign)
{
+/* LLVM LOCAL begin */
+/* Unused variables resulting from code change below. */
+#if 1
+ tree stmt, label;
+#else
tree sexpr;
tree inputs = NULL_TREE, outputs = NULL_TREE, clobbers = NULL_TREE;
tree stmt;
tree label, l;
tree str, one;
-
+#endif
+/* LLVM LOCAL end */
STRIP_NOPS (labid);
if (iasm_buffer == NULL)
@@ -7924,7 +7930,9 @@
iasm_buffer[0] = '\0';
label = iasm_get_label (labid);
-#if 0
+/* LLVM LOCAL begin */
+#if 1
+/* LLVM LOCAL end */
/* Ideally I'd like to do this, but, it moves the label in:
nop
Modified: llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp?rev=43735&r1=43734&r2=43735&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp Mon Nov 5 15:26:34 2007
@@ -4029,7 +4029,13 @@
Value *Op = 0;
if (LLVMTy->isFirstClassType()) {
- Op = Emit(Val, 0);
+ if (TREE_CODE(Val)==ADDR_EXPR &&
+ TREE_CODE(TREE_OPERAND(Val,0))==LABEL_DECL) {
+ // Emit the label, but do not assume it is going to be the target
+ // of an indirect branch.
+ Op = getLabelDeclBlock(TREE_OPERAND(Val, 0));
+ } else
+ Op = Emit(Val, 0);
} else {
LValue LV = EmitLV(Val);
assert(!LV.isBitfield() && "Inline asm can't have bitfield operand");
More information about the llvm-commits
mailing list