This is the mail archive of the gcc-patches@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]

[PATCH, alpha]: Fix PR target/42113 some more


Hello!

For certain corner cases, gcc can generate invalid pattern from mentioned splitters:

/var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/libgcc/../gcc/libgcc2.c:551: error: unrecognizable insn:
(insn 131 59 132 6/var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/libgcc/../gcc/libgcc2.c:549 (set (reg:SI 114)
        (ne:DI (reg:DI 97)
            (const_int 0 [0x0]))) -1 (nil))
/var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/libgcc/../gcc/libgcc2.c:551: internal compiler error: in extract_insn, at recog.c:2005
Please submit a full bug report,
with preprocessed source if appropriate.


Please note SImode mode of target register of the cmp-to-zero comparison. This represents invalid instruction, since the target register should be in DImode. The problem is then in a followup SImode multiplication: we have to use SImode subreg of the scratch register there, which is what the patch does. Additionally, scratch register has to be generated as DImode paradoxical subreg of output regno for overlapped regs when no pseudo can be created.


My previous 42113 patch reversed the modes (gcc was able to avoid generating invalid insn for some reason), but not in the case above.

Attached patch should generate insns that are always valid.

2010-03-24 Uros Bizjak <ubizjak@gmail.com>

    PR target/42113
    * config/alpha/alpha.md (*cmp_sadd_si): Change mode
    of scratch register to DImode.  Split to DImode comparison operator.
    Use SImode subreg of scratch register in the multiplication.
    (*cmp_sadd_sidi): Ditto.
    (*cmp_ssub_si): Ditto.
    (*cmp_ssub_sidi): Ditto.

Patch was bootstrapped and regression tested on alphaev68-pc-linux-gnu for 4.3, 4.4 and 4.5.

OK for mainline and branches?

Uros.

Attachment: a.diff.txt
Description: Text document


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