public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: Glen Nakamura <glen@imodulo.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, Subject: Re: optimization/8165: builtin string functions SEGV on alpha-pc-linux-gnu at -O2 Date: Mon, 07 Oct 2002 18:26:00 -0000 [thread overview] Message-ID: <20021008012601.26140.qmail@sources.redhat.com> (raw) The following reply was made to PR optimization/8165; it has been noted by GNATS. From: Glen Nakamura <glen@imodulo.com> To: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org Cc: Subject: Re: optimization/8165: builtin string functions SEGV on alpha-pc-linux-gnu at -O2 Date: Mon, 7 Oct 2002 15:24:09 -1000 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8165 Okay, I think the problem is in the gcse pass. When we replace a register, we don't completely replace its references in the instruction's REG_EQUAL note. Specifically, we miss the case where the register is referred to in a (lo_sum (reg) (symbol_ref)). My proposed fix is to add this case to simplify_replace_rtx() which is called by try_replace_reg() during the gcse pass. 2002-10-07 Glen Nakamura <glen@imodulo.com> * simplify-rtx.c (simplify_replace_rtx): Added case to simplify and replace LO_SUM expressions. Index: gcc/simplify-rtx.c =================================================================== RCS file: /cvsroot/gcc/gcc/gcc/simplify-rtx.c,v retrieving revision 1.122 diff -c -5 -p -r1.122 simplify-rtx.c *** gcc/simplify-rtx.c 27 Sep 2002 12:48:02 -0000 1.122 --- gcc/simplify-rtx.c 8 Oct 2002 00:41:55 -0000 *************** simplify_replace_rtx (x, old, new) *** 339,348 **** --- 339,364 ---- if (code == MEM) return replace_equiv_address_nv (x, simplify_replace_rtx (XEXP (x, 0), old, new)); + if (code == LO_SUM) + { + if (REG_P (old) && REG_P (XEXP (x, 0)) + && REGNO (old) == REGNO (XEXP (x, 0))) + { + if (REG_P (new)) + return gen_rtx_fmt_ee (code, mode, new, XEXP (x, 1)); + + /* (lo_sum (high X) X) is simply X. */ + if (GET_CODE (new) == HIGH + && rtx_equal_p (XEXP (new, 0), XEXP (x, 1))) + return XEXP (x, 1); + } + return x; + } + if (REG_P (x) && REG_P (old) && REGNO (x) == REGNO (old)) return new; return x;
next reply other threads:[~2002-10-08 1:26 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-10-07 18:26 Glen Nakamura [this message] -- strict thread matches above, loose matches on Subject: below -- 2002-10-14 11:16 Richard Henderson 2002-10-12 11:46 Glen Nakamura 2002-10-11 17:56 Richard Henderson 2002-10-11 16:26 Glen Nakamura 2002-10-11 16:13 rth 2002-10-11 15:46 Richard Henderson 2002-10-08 16:16 Glen Nakamura 2002-10-08 15:26 Richard Henderson 2002-10-07 17:56 glen
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=20021008012601.26140.qmail@sources.redhat.com \ --to=glen@imodulo.com \ --cc=gcc-prs@gcc.gnu.org \ --cc=nobody@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).