public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "olegendo at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/59401] [SH] GBR addressing mode optimization produces wrong code Date: Thu, 05 Dec 2013 20:43:00 -0000 [thread overview] Message-ID: <bug-59401-4-eK3Gki7Cf1@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-59401-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59401 --- Comment #1 from Oleg Endo <olegendo at gcc dot gnu.org> --- An example where the base address is retrieved from the GBR in one basic block, but used in different basic blocks: struct tcb_t { int x, y, z, w; }; int test_01 (int a, tcb_t* b, int c) { tcb_t* tcb = (tcb_t*)__builtin_thread_pointer (); return (a & 5) ? tcb->x : tcb->w; } By coincidence it produces correct code: mov r4,r0 tst #5,r0 bf .L7 mov.l @(12,gbr),r0 rts nop .L7: rts mov.l @(0,gbr),r0 A proper fix for this would be to collect all "leaf values" for the address registers in question from all predecessor basic blocks as it's done in the function sh_optimize_sett_clrt::find_last_ccreg_values in sh_optimize_sett_clrt.cc.
next prev parent reply other threads:[~2013-12-05 20:43 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-12-05 20:19 [Bug target/59401] New: " olegendo at gcc dot gnu.org 2013-12-05 20:43 ` olegendo at gcc dot gnu.org [this message] 2014-10-12 23:14 ` [Bug target/59401] " olegendo at gcc dot gnu.org 2014-10-12 23:24 ` olegendo at gcc dot gnu.org 2014-10-13 5:17 ` kkojima at gcc dot gnu.org 2014-10-13 21:18 ` olegendo at gcc dot gnu.org 2014-10-13 22:48 ` olegendo at gcc dot gnu.org 2014-10-14 1:42 ` kkojima at gcc dot gnu.org 2014-10-14 1:51 ` olegendo at gcc dot gnu.org 2014-10-14 2:59 ` kkojima at gcc dot gnu.org 2014-10-14 3:33 ` olegendo at gcc dot gnu.org 2014-10-15 13:45 ` olegendo at gcc dot gnu.org 2014-10-16 12:22 ` olegendo 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=bug-59401-4-eK3Gki7Cf1@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).