* c-typeck.c (c_expand_asm_operands): Fix typo.
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 20 Oct 1999 00:18:10 +0000 (00:18 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 20 Oct 1999 00:18:10 +0000 (00:18 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30095 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/c-typeck.c
gcc/testsuite/gcc.dg/asm-1.c [new file with mode: 0644]

index dcc0393..83d0ae9 100644 (file)
@@ -1,3 +1,7 @@
+Tue Oct 19 17:22:39 1999  Mark Mitchell  <mark@codesourcery.com>
+
+       * c-typeck.c (c_expand_asm_operands): Fix typo.
+
 Tue Oct 19 18:42:58 1999  Bernd Schmidt  <bernds@cygnus.co.uk>
 
        * arm.c (fpu_rhs_operand): Verify modes.
index 0d6ec00..71d8262 100644 (file)
@@ -6538,7 +6538,7 @@ c_expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
             || TREE_CODE (output) == FIX_FLOOR_EXPR
             || TREE_CODE (output) == FIX_ROUND_EXPR
             || TREE_CODE (output) == FIX_CEIL_EXPR)
-       output = TREE_OPERAND (output, 1);
+       output = TREE_OPERAND (output, 0);
 
       lvalue_or_else (o[i], "invalid lvalue in asm statement");
     }
diff --git a/gcc/testsuite/gcc.dg/asm-1.c b/gcc/testsuite/gcc.dg/asm-1.c
new file mode 100644 (file)
index 0000000..1f50942
--- /dev/null
@@ -0,0 +1,11 @@
+/* { dg-do compile { target i?86-*-* } } */
+
+struct x {
+  int selector;
+};
+
+void f()
+{
+  struct x* addr;
+  __asm__("mov %%gs,%0":"=r" ((unsigned short)addr->selector)); /* { dg-error "lvalue" "casts make rvalues" } */
+}