From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11228 invoked by alias); 18 Sep 2008 17:31:54 -0000 Received: (qmail 8682 invoked by uid 48); 18 Sep 2008 17:30:42 -0000 Date: Thu, 18 Sep 2008 17:31:00 -0000 Message-ID: <20080918173042.8681.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/37573] gcc-4.4 regression: incorrect code generation with -O1 -ftree-vectorize In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "edwintorok at gmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-09/txt/msg02170.txt.bz2 ------- Comment #1 from edwintorok at gmail dot com 2008-09-18 17:30 ------- Testcase: extern int printf (__const char *__restrict __format, ...); extern int strcmp (__const char *__s1, __const char *__s2); extern int puts (__const char *__s); typedef unsigned char uint8_t; typedef unsigned int uint32_t; struct MT { uint32_t *next; uint32_t items; uint32_t mt[624]; }; static uint8_t MT_getnext (struct MT *MT) { uint32_t r; if (!--MT->items) { uint32_t *mt = MT->mt; unsigned int i; MT->next = mt; for (i = 0; i < 227; i++) mt[i] = ((((mt[i] ^ mt[i + 1]) & 0x7ffffffe) ^ mt[i]) >> 1) ^ ((0 - (mt[i + 1] & 1)) & 0x9908b0df) ^ mt[i + 397]; } r = *(MT->next++); r ^= (r >> 11); r ^= ((r & 0xff3a58ad) << 7); r ^= ((r & 0xffffdf8c) << 15); r ^= (r >> 18); return (uint8_t) (r >> 1); } static void MT_decrypt (uint8_t * buf, unsigned int size, uint32_t seed) { struct MT MT; unsigned int i; uint32_t *mt = MT.mt; *mt = seed; for (i = 1; i < 624; i++) mt[i] = i + 0x6c078965 * ((mt[i - 1] >> 30) ^ mt[i - 1]); MT.items = 1; while (size--) *buf++ ^= MT_getnext (&MT); }; static uint8_t buf[23] = { 0xc0, 0x49, 0x17, 0x32, 0x62, 0x1e, 0x2e, 0xd5, 0x4c, 0x19, 0x28, 0x49, 0x91, 0xe4, 0x72, 0x83, 0x91, 0x3d, 0x93, 0x83, 0xb3, 0x61, 0x38 }; int main (void) { uint32_t s; s = 23; MT_decrypt (buf, s, s + 0xa25e); if (!strcmp (">AUTOIT UNICODE SCRIPT<", buf)) { puts ("OK"); return 0; } else { printf ("Failed:%s\n", buf); return 1; } } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37573