public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/21223] New: Output register variable is reloaded into the wrong register for asm
@ 2005-04-25 20:49 drow at gcc dot gnu dot org
  2005-04-25 20:54 ` [Bug rtl-optimization/21223] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: drow at gcc dot gnu dot org @ 2005-04-25 20:49 UTC (permalink / raw)
  To: gcc-bugs

Compile this test with an ARM-targeted compiler.  Using -O2, it works out OK;
but for -O0 or -O1 it doesn't.  I originally encountered the bug in -O2 compiled
code, but a more complex testcase is probably necessary for that.

int bar(int *mem)
{
  return ({ register int a_oldval asm ("r0");
            register int a_tmp asm ("r3");
            int a_oldval2 = 3;
            __asm__ __volatile__ ("# Should be r0 - %0\n\t"
                                  "# Should be r3 - %1"
                                  : "=&r" (a_oldval), "=&r" (a_tmp)
                                  : "r" (a_oldval2));
            a_tmp; });
}

Everything is OK up until reload.  Then this happens:

Spilling for insn 19.
Using reg 2 for reload 0
Spilling for insn 19.
Using reg 2 for reload 0

Reloads for insn # 19
Reload 0: reload_out (SI) = (reg/v:SI 3 r3 [ a_tmp ])
        GENERAL_REGS, RELOAD_OTHER (opnum = 1)
        reload_out_reg: (reg/v:SI 3 r3 [ a_tmp ])
        reload_reg_rtx: (reg:SI 2 r2)

and the set of a_tmp is replaced by a set of r2.  I can't figure out why
the reload was created.

-- 
           Summary: Output register variable is reloaded into the wrong
                    register for asm
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: drow at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: arm-none-linux-gnueabi


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21223


^ permalink raw reply	[flat|nested] 6+ messages in thread
[parent not found: <bug-21223-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2021-08-08 21:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-25 20:49 [Bug rtl-optimization/21223] New: Output register variable is reloaded into the wrong register for asm drow at gcc dot gnu dot org
2005-04-25 20:54 ` [Bug rtl-optimization/21223] " pinskia at gcc dot gnu dot org
2005-04-25 21:08 ` drow at gcc dot gnu dot org
2005-04-25 21:10 ` [Bug middle-end/21223] " pinskia at gcc dot gnu dot org
2005-04-25 21:13 ` drow at gcc dot gnu dot org
     [not found] <bug-21223-4@http.gcc.gnu.org/bugzilla/>
2021-08-08 21:25 ` pinskia at gcc dot gnu.org

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).