From: "Uros Bizjak" <ubizjak@gmail.com>
To: "Kenneth Zadeck" <zadeck@naturalbridge.com>
Cc: "GCC Patches" <gcc-patches@gcc.gnu.org>,
"Ian Lance Taylor" <iant@google.com>,
"Eric Botcazou" <ebotcazou@libertysurf.fr>
Subject: Re: [PATCH, rtl-optimization]: Fix PR rtl-optimization/33638
Date: Tue, 09 Oct 2007 12:31:00 -0000 [thread overview]
Message-ID: <5787cf470710090531q14d11d16pbaca9fd8eb29b10f@mail.gmail.com> (raw)
In-Reply-To: <470B6B35.2090800@naturalbridge.com>
Hello!
Looking a bit further into the problem, I have noticed that actual
argument address becomes different from what CALL_INSN_FUNCTION_USAGE
claims in store_one_arg() function. The problem is in the call to
emit_push_insn() in line 4280. emit_push_insn() calls memory_address()
that fubars the address.
An (less intrusive?) variant of my previous patch is to change call to
memory_address in emit_push_insn() to memory_address_noforce(). I
can't see the benefit of
load reg <- (SP + off)
store (reg) <- regX
since IMO the address of the pushed argument won't be CSE'd with any
other address in any way.
BTW: I have tried to update arg->stack just after the call to
emit_push_insn in store_one_arg with SET_DEST (PATTERN (get_last_insn
())) to update CALL_INSN_FUNCTION_USAGE, but IMO, this is too hacky.
Uros.
Index: expr.c
===================================================================
--- expr.c (revision 129152)
+++ expr.c (working copy)
@@ -3910,13 +3910,12 @@ emit_push_insn (rtx x, enum machine_mode
#endif
{
if (GET_CODE (args_so_far) == CONST_INT)
- addr
- = memory_address (mode,
- plus_constant (args_addr,
- INTVAL (args_so_far)));
+ addr = plus_constant (args_addr, INTVAL (args_so_far));
else
- addr = memory_address (mode, gen_rtx_PLUS (Pmode, args_addr,
- args_so_far));
+ addr = gen_rtx_PLUS (Pmode, args_addr, args_so_far);
+
+ addr = memory_address_noforce (mode, addr);
+
dest = gen_rtx_MEM (mode, addr);
/* We do *not* set_mem_attributes here, because incoming arguments
next prev parent reply other threads:[~2007-10-09 12:31 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-08 12:14 Uros Bizjak
2007-10-08 12:35 ` [Bug rtl-optimization/33638] [4.3 regression]: wrong code with -fforce-addr Kenneth Zadeck
2007-10-09 6:01 ` [PATCH, rtl-optimization]: Fix PR rtl-optimization/33638 Ian Lance Taylor
2007-10-09 6:38 ` Eric Botcazou
2007-10-09 7:19 ` Ian Lance Taylor
2007-10-09 11:51 ` Kenneth Zadeck
2007-10-09 12:31 ` Uros Bizjak [this message]
2007-10-09 15:42 ` Ian Lance Taylor
2007-10-09 15:42 ` Ian Lance Taylor
2007-10-09 16:05 ` Kenneth Zadeck
2007-10-09 17:09 ` Ian Lance Taylor
2007-10-09 19:37 ` Eric Botcazou
2007-10-09 19:55 ` Kenneth Zadeck
2007-10-09 21:55 ` Eric Botcazou
2007-10-10 12:19 ` Eric Botcazou
2007-10-10 19:21 ` Eric Botcazou
2007-10-12 15:49 ` Ian Lance Taylor
2007-10-12 17:10 ` Eric Botcazou
2007-10-14 16:29 ` Eric Botcazou
2007-10-15 5:47 ` Ian Lance Taylor
2007-10-15 7:43 ` Eric Botcazou
2007-10-10 10:45 ` Eric Botcazou
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=5787cf470710090531q14d11d16pbaca9fd8eb29b10f@mail.gmail.com \
--to=ubizjak@gmail.com \
--cc=ebotcazou@libertysurf.fr \
--cc=gcc-patches@gcc.gnu.org \
--cc=iant@google.com \
--cc=zadeck@naturalbridge.com \
/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).