+2003-07-26 Richard Henderson <rth@redhat.com>
+
+ PR inline-asm/11676
+ * cse.c (count_reg_usage): Handle asm_operands properly.
+
2003-07-26 Roger Sayle <roger@eyesopen.com>
* builtins.def (DEF_FALLBACK_BUILTIN): Delete.
count_reg_usage (XEXP (x, 1), counts, NULL_RTX, incr);
return;
+ case ASM_OPERANDS:
+ /* If the asm is volatile, then this insn cannot be deleted,
+ and so the inputs *must* be live. */
+ if (MEM_VOLATILE_P (x))
+ dest = NULL_RTX;
+ /* Iterate over just the inputs, not the constraints as well. */
+ for (i = ASM_OPERANDS_INPUT_LENGTH (x) - 1; i >= 0; i--)
+ count_reg_usage (ASM_OPERANDS_INPUT (x, i), counts, dest, incr);
+ return;
+
case INSN_LIST:
abort ();
--- /dev/null
+/* PR inline-asm/11676 */
+/* { dg-do compile } */
+/* { dg-options "-O -Wall" } */
+
+void foo(void)
+{
+ long x = 0;
+ asm volatile ("" : "=r"(x) : "r"(x)); /* { dg-bogus "uninitialized" } */
+}
--- /dev/null
+/* PR inline-asm/11676 */
+/* { dg-do run { target i?86-*-* } } */
+/* { dg-options "-O2" } */
+
+static int bar(int x) __asm__("bar");
+static int __attribute__((regparm(1), noinline, used))
+bar(int x)
+{
+ if (x != 0)
+ abort ();
+}
+
+static int __attribute__((regparm(1), noinline))
+foo(int x)
+{
+ x = 0;
+ __asm__ __volatile__("call bar" : "=a"(x) : "a"(x));
+}
+
+int main()
+{
+ foo(1);
+ return 0;
+}