https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95967
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #3) > Created attachment 50891 [details] > Start of the patch which should fix most of it > > This patch which should fix the majority of the problem though I have not > tested it on the testcase. Basically it takes the BIT_INSERT_EXPR's and > "combines" them such that they become a CONSTRUCTOR. > I am still deciding if this belongs in reassoc or as part of forwprop. This patch looks like it only fixes f1 and g1. Most likely because I did not handle CONSTRUCTOR as the initial case: f2: _6 = {s0_2(D), s0_2(D), s0_2(D), s0_2(D)}; __builtin_aarch64_im_lane_boundsi (16, 4, 1); __builtin_aarch64_im_lane_boundsi (16, 4, 2); __builtin_aarch64_im_lane_boundsi (16, 4, 3); _10 = BIT_INSERT_EXPR <_6, s1_3(D), 32>; _12 = BIT_INSERT_EXPR <_10, s2_4(D), 64>; __vec_14 = BIT_INSERT_EXPR <_12, s3_5(D), 96>; I will look into adding that in a few weeks and add a testcase for it too.