https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78186
--- Comment #4 from amker at gcc dot gnu.org --- (In reply to Segher Boessenkool from comment #3) > Hi Bin, > > Could you try this patch please? > > === > diff --git a/gcc/combine.c b/gcc/combine.c > index 7c21fe4..7ed0a62 100644 > --- a/gcc/combine.c > +++ b/gcc/combine.c > @@ -11224,6 +11224,9 @@ change_zero_ext (rtx pat) > rtx x = gen_rtx_AND (mode, reg, immed_wide_int_const (mask, mode)); > rtx y = simplify_gen_binary (ASHIFT, mode, SET_SRC (pat), > GEN_INT (offset)); > + wide_int mask2 = wi::shifted_mask (offset, width, false, reg_width); > + y = simplify_gen_binary (AND, mode, y, > + immed_wide_int_const (mask2, mode)); > rtx z = simplify_gen_binary (IOR, mode, x, y); > SUBST (SET_DEST (pat), reg); > SUBST (SET_SRC (pat), z); > === Hi Segher, Thanks for the patch, it at least fixes: FAIL: gcc.c-torture/execute/bf64-1.c -O1 execution test FAIL: gcc.c-torture/execute/pr57130.c -O1 execution test FAIL: g++.dg/torture/vshuf-v8si.C -O2 execution test It also changes behavior for: FAIL: c-c++-common/torture/vector-compare-1.c -O1 execution test FAIL: c-c++-common/torture/vector-compare-1.c -O2 execution test FAIL: c-c++-common/torture/vector-compare-1.c -O2 -flto -fno-use-linker-plugin -flto-partition=none execution test FAIL: c-c++-common/torture/vector-compare-1.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects execution test FAIL: c-c++-common/torture/vector-compare-1.c -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions execution test FAIL: c-c++-common/torture/vector-compare-1.c -O3 -g execution test FAIL: c-c++-common/torture/vector-compare-1.c -Os execution test But now I suspect there are other problems with it. Thanks, bin