------- Comment #1 from burnus at gcc dot gnu dot org 2008-03-29 23:23 ------- Confirm.
The algorithm below does essentially: while (1,0,1,0,1) uda1l( 1 _ 3 _ 5) = 2 3 4 5 6 else udal1 ( _ 3 _ 5 _) = 6 5 4 3 2 done That is 1. uda1l(1) = 2 2. uda1l(3) = 5 <---\__ 3. uda1l(3) = 4 <---/ 4. uda1l(5) = 3 <---\__ 5. uda1l(6) = 4 <---/ The order is wrong. The procedure has to be: 1. Establish control mask (i.e. 1,0,1,0,1) and run WHERE while (1,0,1,0,1) uda1l( 1 _ 3 _ 5) = 2 3 4 5 6 end 2. Establish pending controlmask for ELSEWHERE (i.e. 0,1,0,1,0) elsewhile (0,1,0,1) uda1l( 1 _ 3 _ 5) = 2 3 4 5 6 end { static logical(kind=4) A.2[5] = {1, 0, 1, 0, 1}; static integer(kind=4) A.1[6] = {1, 2, 3, 4, 5, 6}; (void) __builtin_memset ((void *) &uda1l, 0, 24); (void) __builtin_memcpy ((void *) &uda1r, (void *) &A.1, 24); (void) __builtin_memcpy ((void *) &lda, (void *) &A.2, 20); { integer(kind=8) S.3; S.3 = 1; while (1) { if (S.3 > 5) goto L.1; if (lda[S.3 + -1]) { uda1l[S.3 + -1] = uda1r[S.3]; } else { uda1l[S.3] = uda1r[6 - S.3]; } S.3 = S.3 + 1; } L.1:; } -- burnus at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Keywords| |wrong-code Last reconfirmed|0000-00-00 00:00:00 |2008-03-29 23:23:44 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35759