http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59058
--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> --- For the vectorizer issue on trunk, this is enough: int printf (const char *, ...); short b = 0; int main () { int c = 0; l1: b++; c |= b; if (b) goto l1; printf ("%d\n", c); return 0; } This code relies on the gcc extension that casting to a shorter integer is done modulo 2. Note that if we move the declaration of b inside the function, the compiler (wrongly?) warns: s.c:11:4: warning: iteration 32767u invokes undefined behavior [-Waggressive-loop-optimizations] b++; ^ s.c:13:6: note: containing loop if (b) ^ (and the return value changes from 7 to 131071) 2 missed optimizations while looking at the dumps: stmp_var_.12_46 = _4 + 1; stmp_var_.12_47 = _4 + 2; stmp_var_.12_48 = _4 + 3; stmp_var_.12_49 = _4 + 4; stmp_var_.12_50 = _4 + 5; stmp_var_.12_51 = _4 + 6; stmp_var_.12_52 = _4 + 7; vect_cst_.13_53 = {_4, stmp_var_.12_46, stmp_var_.12_47, stmp_var_.12_48, stmp_var_.12_49, stmp_var_.12_50, stmp_var_.12_51, stmp_var_.12_52}; This should really be: v = { _4, _4, ... }; w = v + { 0, 1, 2, ... }; Also: vector(8) unsigned short vect_b.17; vector(8) short int vect_vec_iv_.16; vector(8) unsigned short vect_vec_iv_.15; [...] vect_vec_iv_.16_57 = VIEW_CONVERT_EXPR<vector(8) short int>(vect_vec_iv_.15_55); vect_vec_iv_.15_56 = vect_vec_iv_.15_55 + vect_cst_.14_54; vect_b.17_58 = VIEW_CONVERT_EXPR<vector(8) unsigned short>(vect_vec_iv_.16_57); vect_b.17_58 is vect_vec_iv_.15_55, not sure why we don't see through that.