public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/44618] Arguments are not passed correctly to out-of-line restore functions.
Date: Mon, 21 Jun 2010 21:30:00 -0000	[thread overview]
Message-ID: <20100621212949.2673.qmail@sourceware.org> (raw)
In-Reply-To: <bug-44618-12262@http.gcc.gnu.org/bugzilla/>



------- Comment #8 from pinskia at gcc dot gnu dot org  2010-06-21 21:29 -------
(In reply to comment #7) 
> I mostly agree with you. But in this case, it is already a hard register (rtl
> generated in epilogue).

No the pattern accepts any registers which means register rename can rename the
register to what ever registers it feels like.  What register rename
constraints has is to do with stuff that are implicit (like hard registers for
inline-asm and function call arguments).  This case we have an explicit operand
which means we need to mark the constraint to be correct.

For an example:
(define_insn "*restore_gpregs_<mode>"
 [(match_parallel 0 "any_parallel_operand"
                  [(clobber (match_operand:P 1 "register_operand" "=l"))
                   (use (match_operand:P 2 "symbol_ref_operand" "s"))
                   (use (match_operand:P 3 "gpc_reg_operand" "r"))
                   (set (match_operand:P 4 "gpc_reg_operand" "=r")
                        (match_operand:P 5 "memory_operand" "m"))])]
 ""
 "bl %2"
 [(set_attr "type" "branch")
  (set_attr "length" "4")])

Should be changed to:
(define_insn "*restore_gpregs_<mode>"
 [(match_parallel 0 "any_parallel_operand"
                  [(clobber (match_operand:P 1 "register_operand" "=l"))
                   (use (match_operand:P 2 "symbol_ref_operand" "s"))
                   (use (match_operand:P 3 "gpc_reg_operand" "d"))
                   (set (match_operand:P 4 "gpc_reg_operand" "=r")
                        (match_operand:P 5 "memory_operand" "m"))])]
 ""
 "bl %2"
 [(set_attr "type" "branch")
  (set_attr "length" "4")])

(etc.)
Where d is a new constraint.  Though you might need more than one constraint
and patterns because of the following code:
  RTVEC_ELT (p, offset++)
    = gen_rtx_USE (VOIDmode,
                   gen_rtx_REG (Pmode, DEFAULT_ABI != ABI_AIX ? 11
                                       : gpr && !lr ? 12
                                       : 1));

--- CUT ---
I think you might cause other targets to slow down because of the use of
parallels inside jump instructions (mostly indirect calls).


Thanks,
Andrew Pinski


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44618


  parent reply	other threads:[~2010-06-21 21:30 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-21 20:14 [Bug rtl-optimization/44618] New: Arguments are not passed correctly to out-of-line restore functions. [4.4][4.5][4.6] edmar at freescale dot com
2010-06-21 20:15 ` [Bug rtl-optimization/44618] " edmar at freescale dot com
2010-06-21 20:15 ` edmar at freescale dot com
2010-06-21 20:17 ` edmar at freescale dot com
2010-06-21 20:18 ` edmar at freescale dot com
2010-06-21 20:25 ` edmar at freescale dot com
2010-06-21 20:34 ` [Bug target/44618] Arguments are not passed correctly to out-of-line restore functions pinskia at gcc dot gnu dot org
2010-06-21 21:18 ` edmar at freescale dot com
2010-06-21 21:30 ` pinskia at gcc dot gnu dot org [this message]
2010-06-21 23:36 ` edmar at freescale dot com
2010-06-21 23:54 ` pinskia at gcc dot gnu dot org
2010-06-22 16:53 ` edmar at freescale dot com
2010-06-22 20:51 ` edmar at freescale dot com
2010-06-22 20:56 ` jakub at gcc dot gnu dot org
2010-06-28 15:16 ` edmar at freescale dot com
2010-06-28 15:18 ` edmar at freescale dot com
2010-06-28 15:18 ` edmar at freescale dot com
2010-06-28 15:19 ` edmar at freescale dot com
     [not found] <bug-44618-4@http.gcc.gnu.org/bugzilla/>
2011-04-27 10:21 ` ebotcazou at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100621212949.2673.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).