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]

Re: gcc.c-torture/compile/20010107-1.c


On Sun, Dec 23, 2001 at 07:45:13PM -0500, Richard Kenner wrote:
> This fails on Alpha/osf1 and appears to be due to call patterns,
> which you've modified lately.   Can you ake a look at this?  Thanks.

Ok, it was only failing with !TARGET_EXPLICIT_RELOCS.  Incidentally,
how much of the following assembles on osf4.0?

        .set nomacro
        .text
        extbl   $3, $2, $3      !lituse_bytoff!1
        ldq     $2, a($29)      !literal!1
        ldq     $4, b($29)      !literal!2
        ldq_u   $3, 0($2)       !lituse_base!1
        ldq     $27, f($29)     !literal!5
        jsr     $26, ($27), f   !lituse_jsr!5
        ldah    $29, 0($26)     !gpdisp!3
        lda     $0, c($29)      !gprel
        ldah    $1, d($29)      !gprelhigh
        lda     $1, d($1)       !gprellow
        lda     $29, 0($29)     !gpdisp!3

If it only fails the the "!gprel" line, we can usefully avoid that.
It's only used with -msmall-data.

Anyway, the problem is that combine found a way to merge some insns
and create a sibcall pattern from a regular call.  Not good.

Solved by making sibcalls very different from normal calls.


r~


        * config/alpha/alpha.md (UNSPEC_SIBCALL): New.
        (sibcall, sibcall_value, sibcall_osf_1_er, sibcall_osf_1): Use it.
        (sibcall_value_osf_1_er, sibcall_value_osf_1): Likewise.

Index: config/alpha/alpha.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha.md,v
retrieving revision 1.170
diff -c -p -d -r1.170 alpha.md
*** alpha.md	2001/12/21 00:33:29	1.170
--- alpha.md	2001/12/24 03:05:37
***************
*** 38,43 ****
--- 38,44 ----
     (UNSPEC_LDGP2	10)
     (UNSPEC_LITERAL	11)
     (UNSPEC_LITUSE	12)
+    (UNSPEC_SIBCALL	13)
    ])
  
  ;; UNSPEC_VOLATILE:
*************** fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi
*** 4582,4588 ****
  (define_expand "sibcall"
    [(parallel [(call (mem:DI (match_operand 0 "" ""))
  			    (match_operand 1 "" ""))
! 	      (use (reg:DI 29))])]
    "TARGET_ABI_OSF"
  {
    if (GET_CODE (operands[0]) != MEM)
--- 4583,4589 ----
  (define_expand "sibcall"
    [(parallel [(call (mem:DI (match_operand 0 "" ""))
  			    (match_operand 1 "" ""))
! 	      (unspec [(reg:DI 29)] UNSPEC_SIBCALL)])]
    "TARGET_ABI_OSF"
  {
    if (GET_CODE (operands[0]) != MEM)
*************** fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi
*** 4710,4716 ****
    [(parallel [(set (match_operand 0 "" "")
  		   (call (mem:DI (match_operand 1 "" ""))
  		         (match_operand 2 "" "")))
! 	      (use (reg:DI 29))])]
    "TARGET_ABI_OSF"
  {
    if (GET_CODE (operands[1]) != MEM)
--- 4711,4717 ----
    [(parallel [(set (match_operand 0 "" "")
  		   (call (mem:DI (match_operand 1 "" ""))
  		         (match_operand 2 "" "")))
! 	      (unspec [(reg:DI 29)] UNSPEC_SIBCALL)])]
    "TARGET_ABI_OSF"
  {
    if (GET_CODE (operands[1]) != MEM)
*************** fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi
*** 4920,4926 ****
  (define_insn "*sibcall_osf_1_er"
    [(call (mem:DI (match_operand:DI 0 "symbolic_operand" "R,s"))
  	 (match_operand 1 "" ""))
!    (use (reg:DI 29))]
    "TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF"
    "@
     br $31,$%0..ng
--- 4921,4927 ----
  (define_insn "*sibcall_osf_1_er"
    [(call (mem:DI (match_operand:DI 0 "symbolic_operand" "R,s"))
  	 (match_operand 1 "" ""))
!    (unspec [(reg:DI 29)] UNSPEC_SIBCALL)]
    "TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF"
    "@
     br $31,$%0..ng
*************** fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi
*** 4931,4937 ****
  (define_insn "*sibcall_osf_1"
    [(call (mem:DI (match_operand:DI 0 "symbolic_operand" "R,s"))
  	 (match_operand 1 "" ""))
!    (use (reg:DI 29))]
    "! TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF"
    "@
     br $31,$%0..ng
--- 4932,4938 ----
  (define_insn "*sibcall_osf_1"
    [(call (mem:DI (match_operand:DI 0 "symbolic_operand" "R,s"))
  	 (match_operand 1 "" ""))
!    (unspec [(reg:DI 29)] UNSPEC_SIBCALL)]
    "! TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF"
    "@
     br $31,$%0..ng
*************** fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi
*** 6932,6938 ****
    [(set (match_operand 0 "" "")
  	(call (mem:DI (match_operand:DI 1 "symbolic_operand" "R,s"))
  	      (match_operand 2 "" "")))
!    (use (reg:DI 29))]
    "TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF"
    "@
     br $31,$%1..ng
--- 6933,6939 ----
    [(set (match_operand 0 "" "")
  	(call (mem:DI (match_operand:DI 1 "symbolic_operand" "R,s"))
  	      (match_operand 2 "" "")))
!    (unspec [(reg:DI 29)] UNSPEC_SIBCALL)]
    "TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF"
    "@
     br $31,$%1..ng
*************** fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi
*** 6944,6950 ****
    [(set (match_operand 0 "" "")
  	(call (mem:DI (match_operand:DI 1 "symbolic_operand" "R,s"))
  	      (match_operand 2 "" "")))
!    (use (reg:DI 29))]
    "! TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF"
    "@
     br $31,$%1..ng
--- 6945,6951 ----
    [(set (match_operand 0 "" "")
  	(call (mem:DI (match_operand:DI 1 "symbolic_operand" "R,s"))
  	      (match_operand 2 "" "")))
!    (unspec [(reg:DI 29)] UNSPEC_SIBCALL)]
    "! TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF"
    "@
     br $31,$%1..ng


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