On Thu, Dec 03, 2020 at 12:49:49PM +0100, Uros Bizjak wrote: > On Thu, Dec 3, 2020 at 11:39 AM Uros Bizjak <ubiz...@gmail.com> wrote: > > > > > ix86_md_asm_adjust right above this code uses: > > > machine_mode dest_mode = GET_MODE (dest); > > > if (!SCALAR_INT_MODE_P (dest_mode)) > > > { > > > error ("invalid type for %<asm%> flag output"); > > > continue; > > > } > > > but then assumes that dest_mode can be only [QHSD]Imode and nothing else. > > > > > > The following patch handles TImode and hypothetically even wider modes > > > by handling it like DImode for 32-bit. > > > > > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > > > > > > 2020-12-03 Jakub Jelinek <ja...@redhat.com> > > > > > > PR target/98086 > > > * config/i386/i386.c (ix86_md_asm_adjust): Use dest_mode DImode > > > or SImode for modes wider than DImode. If dest_mode isn't SImode > > > or GET_MODE (dest) isn't DImode, use convert_to_mode. > > > > The whole part should be simply rewritten to: > > > > --cut here-- > > if (dest_mode == QImode) > > emit_insn (gen_rtx_SET (dest, x)); > > else > > { > > rtx reg = gen_reg_rtx (QImode); > > emit_insn (gen_rtx_SET (reg, x)); > > > > reg = convert_to_mode (GET_MODE (dest), reg, 1); > > emit_move_insn (dest, reg); > > } > > --cut here-- > > Please let me fix this PR.
Sorry, I've been looking at the glibc miscompilation in the meantime. But if you want to take this over, please go ahead, it is all yours, there are hundreds of other PRs for me to choose from ;) Jakub