This is the mail archive of the gcc-patches@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]

[basic-improvements] fix bug in testsuite - reveals bug in compiler


gcc.dg/sibcall-5.c is a test case present only on the basic-
improvements branch.  There is an error in its dg.exp markup, which
causes it to be reported as UNRESOLVED:

ERROR: gcc.dg/sibcall-5.c: syntax error in target selector "i?86-*-*" 
       for " dg-do 2 run { i?86-*-* } "
UNRESOLVED: gcc.dg/sibcall-5.c: syntax error in target selector "i?86-*-*"
       for " dg-do 2 run { i?86-*-* } "

(I don't know where the 2 comes from.)  The appended patch fixes
this.  Unfortunately, that reveals a bug in the compiler, now that the
test case actually gets tested:

FAIL: gcc.dg/sibcall-5.c (test for excess errors)
Excess errors:
sibcall-5.c: In function `bar':
sibcall-5.c:18: error: unable to find a register to spill in class `CREG'
sibcall-5.c:18: error: this is the insn:
(call_insn/j:HI 16 15 17 0 (nil) (set (reg:SI 0 eax)
        (call (mem:QI (reg/f:SI 3 ebx [60]) [0 S1 A8])
            (const_int 0 [0x0]))) 502 {*sibcall_value_1} 
    (insn_list 12 (insn_list 13 (insn_list 14 (insn_list 15 (nil)))))
    (expr_list:REG_DEAD (reg:SI 1 edx)
        (expr_list:REG_DEAD (reg:SI 2 ecx)
            (expr_list:REG_DEAD (reg/f:SI 3 ebx [60])
                (nil))))
    (expr_list (use (reg:SI 2 ecx))
        (expr_list (use (reg:SI 1 edx))
            (expr_list (use (reg:SI 0 eax))
                (nil)))))
sibcall-5.c:18: internal compiler error: in spill_failure, at reload1.c:1916

I'm checking in the fix for the test harness.  rth, this looks like
your patch of 2002-10-14

        * config/i386/i386.c (ix86_function_ok_for_sibcall): Reject
        indirect sibcalls when regparm >= 3.
        * gcc.dg/sibcall-5.c: New.

did not entirely fix the bug you were after; can you please look into
this?

zw

	* gcc.dg/sibcall-5.c: Correct { dg-do run } line.

===================================================================
Index: testsuite/gcc.dg/sibcall-5.c
--- testsuite/gcc.dg/sibcall-5.c	14 Oct 2002 02:48:51 -0000	1.1.2.1
+++ testsuite/gcc.dg/sibcall-5.c	21 Oct 2002 18:06:40 -0000
@@ -1,5 +1,5 @@
 /* Check that indirect sibcalls understand regparm.  */
-/* { dg-do run { i?86-*-* } } */
+/* { dg-do run { target i?86-*-* } } */
 /* { dg-options "-O2" } */
 
 int (*f)(int, int) __attribute__((regparm(2)));


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