Path: utzoo!telly!attcan!utgpu!watmath!iuvax!cica!tut.cis.ohio-state.edu!westford.ccur.com!loepere From: loepere@westford.ccur.com Newsgroups: gnu.gcc.bug Subject: loop not-so-invariant optimization bug Message-ID: <8907281541.AA26179@AENEAS.MIT.EDU> Date: 28 Jul 89 15:40:47 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 16 When the following program is compiled with gcc -O (1.35) on a 68020, the computation of 'l' is taken outside of the innermost loop. Strangely enough, if you permute the operands of the bitwise-or operator, it compiles correctly. - Keith foo() { int j, k, l; extern int x; for (j = 0; j < 5; ++j) for (k = 0; k < 5; ++k) { l = ((j & 3) << 3) | k; if (x >= l) break; } }