This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/23424] New: cris.md rtl canonicalization bug


For this code, at -O2:
extern char *x;
extern void foo (void);
void f (char *s, char *se, char *mp, char *y)
{
  while (s != se)
    {
      char *p;
      foo ();
      p = s + *mp;
      *y++ = *p;
      s = p;
    }

  x = s;
}
I get with LAST_UPDATED "Tue Aug 16 12:30:26 UTC 2005":
/tmp/b.c:15: error: insn does not satisfy its constraints:
(insn 74 26 29 2 (parallel [
            (set (reg:QI 13 r13)
                (mem:QI (plus:SI (sign_extend:SI (mem:QI (reg/v/f:SI 3 r3
[orig:31 mp ] [31]) [0 S1 A8]))
                        (reg/v/f:SI 0 r0 [orig:29 s ] [29])) [0 S1 A8]))
            (set (reg/v/f:SI 9 r9 [orig:28 p ] [28])
                (plus:SI (sign_extend:SI (mem:QI (reg/v/f:SI 3 r3 [orig:31 mp ]
[31]) [0 S1 A8]))
                    (reg/v/f:SI 0 r0 [orig:29 s ] [29])))
        ]) 18 {*mov_sideqi} (nil)
    (expr_list:REG_DEAD (reg/v/f:SI 0 r0 [orig:29 s ] [29])
        (nil)))
/tmp/b.c:15: internal compiler error: in copyprop_hardreg_forward_1, at
regrename.c:1578

At first sight, there's a cris.md bug that has been there forever:
the insn is supposed to match "*mov_side<mode>", but that can only happen
with help of the "%" commutative marker.  That marker isn't handled after
reload, and the insn is generated by the moverside peephole2 pattern.
All patterns *have* to be able to match whatever (canonical) RTL is generated
by the target after reload, without the commutativity marker.
So I'd say it's a target bug (the generated RTL is canonical) and IMHO arguably
also a documentation bug.  But there's more...

-- 
           Summary: cris.md rtl canonicalization bug
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hp at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: cris-axis-elf


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]