public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "vmakarov at redhat dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/56195] [4.8 Regression] Error: incorrect register `%rdi' used with `l' suffix (at -O2)
Date: Thu, 07 Feb 2013 19:25:00 -0000 [thread overview]
Message-ID: <bug-56195-4-GMoKCX3wlZ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-56195-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56195
Vladimir Makarov <vmakarov at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |vmakarov at redhat dot com
--- Comment #4 from Vladimir Makarov <vmakarov at redhat dot com> 2013-02-07 19:24:58 UTC ---
(In reply to comment #3)
> I'd say the bug is in get_reload_reg.
> Changing pseudo 118 in operand 0 of insn 90 on equiv 0
> Changing address in insn 90 r59:DI -- no change
> Changing pseudo 59 in address of insn 90 on equiv 0
> Creating newreg=137, assigning class GENERAL_REGS to address r137
> Choosing alt 1 in insn 90: (0) r (1) rm
> Reuse r137 for reload 0, change to class INDEX_REGS for r137
> 90: flags:CCGC=cmp(r137:DI,[r137:DI])
> Inserting insn reload before:
> 256: r137:DI=0
>
>
> 3065 if (get_reload_reg (type, mode, old, goal_alt[i], "", &new_reg)
> 3066 && type != OP_OUT)
>
> calls it with
> type=OP_IN, mode=SImode, original=const0_rtx, rclass=GENERAL_REGS
> but returns new_reg = (reg:DI 137).
> That is because:
> if (rtx_equal_p (curr_insn_input_reloads[i].input, original)
> && in_class_p (curr_insn_input_reloads[i].reg, rclass, &new_class))
> doesn't check any mode if original (and curr_insn_input_reloads[i].input) are
> VOIDmode as in this case. So, either this can be fixed by doing:
> if (rtx_equal_p (curr_insn_input_reloads[i].input, original)
> - && in_class_p (curr_insn_input_reloads[i].reg, rclass, &new_class))
> + && in_class_p (curr_insn_input_reloads[i].reg, rclass, &new_class)
> + && GET_MODE (curr_insn_input_reloads[i].reg) == mode)
> , or we could try better, if the GET_MODE (curr_insn_input_reloads[i].reg)
> is wider than mode, see if we can create a lowpart subreg thereof and return
> that, and only give up (i.e. continue looping) if creation of the lowpart
> subreg for some reason failed.
>
> Vlad, what do you think?
I think, the second solution with lowpart is better.
Would you like to make a patch or may be you prefer that I work on it?
next prev parent reply other threads:[~2013-02-07 19:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-03 16:48 [Bug tree-optimization/56195] New: " antoine.balestrat at gmail dot com
2013-02-03 21:02 ` [Bug tree-optimization/56195] [4.8 Regression] " jakub at gcc dot gnu.org
2013-02-04 9:41 ` rguenth at gcc dot gnu.org
2013-02-05 13:57 ` jakub at gcc dot gnu.org
2013-02-05 16:40 ` jakub at gcc dot gnu.org
2013-02-07 19:25 ` vmakarov at redhat dot com [this message]
2013-02-07 19:47 ` [Bug rtl-optimization/56195] " jakub at gcc dot gnu.org
2013-02-07 20:03 ` jakub at gcc dot gnu.org
2013-02-07 20:09 ` vmakarov at redhat dot com
2013-02-08 15:19 ` jakub at gcc dot gnu.org
2013-02-08 15:25 ` jakub 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-56195-4-GMoKCX3wlZ@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: 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).