public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "hjl.tools at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/55259] plus_constant doesn't handle zero-extended address properly Date: Sat, 10 Nov 2012 04:13:00 -0000 [thread overview] Message-ID: <bug-55259-4-5v7OfQbXMP@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-55259-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55259 --- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> 2012-11-10 04:13:32 UTC --- A potential fix: diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 95bbfa7..d7c454c 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -2109,6 +2109,12 @@ adjust_address_1 (rtx memref, enum machine_mode mode, HOS T_WIDE_INT offset, addr = gen_rtx_LO_SUM (address_mode, XEXP (addr, 0), plus_constant (address_mode, XEXP (addr, 1), offset)); + else if (GET_CODE (addr) == ZERO_EXTEND) + { + addr = XEXP (addr, 0); + addr = plus_constant (GET_MODE (addr), addr, offset); + addr = gen_rtx_ZERO_EXTEND (address_mode, addr); + } else addr = plus_constant (address_mode, addr, offset); }
next prev parent reply other threads:[~2012-11-10 4:13 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-11-10 2:54 [Bug middle-end/55259] New: " hjl.tools at gmail dot com 2012-11-10 4:13 ` hjl.tools at gmail dot com [this message] 2012-11-11 21:53 ` [Bug middle-end/55259] " ebotcazou at gcc dot gnu.org 2012-11-11 23:55 ` hjl.tools at gmail dot com
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=bug-55259-4-5v7OfQbXMP@http.gcc.gnu.org/bugzilla/ \ --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: linkBe 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).