https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70509
Bug ID: 70509 Summary: wrong code with extract from a casted vector(64) Product: gcc Version: 6.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zsojka at seznam dot cz Target Milestone: --- Target: x86_64-pc-linux-gnu Created attachment 38159 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38159&action=edit reduced testcase Output: $ gcc -O -mavx512bw testcase.c $ sde64 -- ./a.out 00000008 Aborted First broken dump seems to be .forwprop, where is: _2 = VIEW_CONVERT_EXPR<vector(64) charD.7>(v_1(D)); _4 = VEC_PERM_EXPR <_2, _2, { 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32 }>; _9 = BIT_FIELD_REF <u_8(D), 8, 0>; _10 = BIT_FIELD_REF <_2, 8, 0>; _11 = _9 / _10; It extracts from _2 offset 0 instead of 256. -fno-tree-forwprop fixes the testcase.