From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11532 invoked by alias); 17 Jan 2006 20:55:46 -0000 Received: (qmail 11505 invoked by uid 48); 17 Jan 2006 20:55:41 -0000 Date: Tue, 17 Jan 2006 20:55:00 -0000 Message-ID: <20060117205541.11503.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug rtl-optimization/25791] -O2 execution fails, -O and -g work In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "dick_guertin at yahoo dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-01/txt/msg01704.txt.bz2 List-Id: ------- Comment #10 from dick_guertin at yahoo dot com 2006-01-17 20:55 ------- I rebuilt with -O2 AND -g, and got the following trace. Notice the while-loop in nscan, statements 1141 thru 1147 are four single statements. The "next" trace by gdb shows them occuring multiple times. This should NOT be happening. This may be another BUG, this time with 'gdb'. Execution ends with the Illegal Instruction failure at statement 1158, a call to a function called 'rlookup'. I suppose I could try to follow that path, but I've tried 'step' without success. Maybe I need to set a breakpoint. (gdb) break comm.c:3651 Breakpoint 1 at 0x269ec: file comm.c, line 3651. (gdb) run Starting program: /afs/ir.stanford.edu/users/g/u/guertin/wylsrc/wylbur.ge Breakpoint 1, EDTBASE () at comm.c:3651 3651 NSCAN (); (gdb) list comm.c:3650 3645 L_00F42: I_LA(R13,(R13+0x0C)); 3646 L_00F46: I_ST(R0,(R1+0x024)); 3647 L_00F4A: I_ST(R0,(R1+0x020)); 3648 R14 = (long int)((char *)( & PRT )); 3649 L_00F4E: I_ST(R14,(R1+0x028)); 3650 L_00F52: NOOP; 3651 NSCAN (); 3652 L_00F54: I_L(R14,(R11+0x08C)); 3653 L_00F58: I_SH(R13,(DATA+0x020A)); 3654 L_00F5C: I_MVC(4,(R14+0x028),(R13)); (gdb) break comm.c:3652 Breakpoint 2 at 0x269f4: file comm.c, line 3652. (gdb) break nscan Breakpoint 3 at 0x1eb3e8: file scan.c, line 1122. (gdb) cont Continuing. Breakpoint 3, nscan (scancb=0x0, token=0xffbef3d4, token_length=0xffbef3d0, stack_pointer=0xffbef3d8) at scan.c:1122 1122 if (scancb->skip == NULL) (gdb) where #0 nscan (scancb=0x0, token=0xffbef3d4, token_length=0xffbef3d0, stack_pointer=0xffbef3d8) at scan.c:1122 #1 0x001eeb44 in NSCAN () at scanstub.c:304 #2 0x000269f4 in EDTBASE () at comm.c:3651 #3 0x00027428 in EDTCOM () at comm.c:3464 #4 0x001ef540 in signon (edit_file=0xffbef888 "") at sign.c:477 #5 0x000e82fc in main (argc=1, argv=0xffbefa04) at main.c:110 (gdb) list scanstub.c:290 285 R15 = result; 286 } 287 288 R2 = regs[0]; R3 = regs[1]; R4 = regs[2]; R5 = regs[3]; R6 = regs[4]; 289 290 I_LTR(R15,R15); 291 } 292 void NSCAN() 293 { 294 unsigned char *token; (gdb) 295 long token_length; 296 long r[16]; 297 298 r[3] = htonl(R2); 299 r[4] = htonl(R3); 300 r[5] = htonl(R4); 301 r[6] = htonl(R5); 302 r[7] = htonl(R6); 303 304 R15 = nscan((NSCNCB *) R1, &token, &token_length, r); (gdb) 305 306 R0 = token_length; 307 R1 = (long) token; 308 309 R2 = ntohl(r[3]); 310 R3 = ntohl(r[4]); 311 R4 = ntohl(r[5]); 312 R5 = ntohl(r[6]); 313 R6 = ntohl(r[7]); 314 (gdb) 315 I_LTR(R15,R15); 316 } 317 void SETSKIP() 318 { 319 setskip((unsigned char *) R2, (unsigned char *) R1, R0); 320 R15=0; 321 I_LTR(R15,R15); 322 } 323 void SETSTOP() 324 { (gdb) where #0 nscan (scancb=0x0, token=0xffbef3d4, token_length=0xffbef3d0, stack_pointer=0xffbef3d8) at scan.c:1122 #1 0x001eeb44 in NSCAN () at scanstub.c:304 #2 0x000269f4 in EDTBASE () at comm.c:3651 #3 0x00027428 in EDTCOM () at comm.c:3464 #4 0x001ef540 in signon (edit_file=0xffbef888 "") at sign.c:477 #5 0x000e82fc in main (argc=1, argv=0xffbefa04) at main.c:110 (gdb) list scan.c:1122 1117 { 1118 long result; 1119 1120 /* Set scan defaults if needed */ 1121 1122 if (scancb->skip == NULL) 1123 scancb->skip = (unsigned char *) htonl((long) tblwskip); 1124 1125 if (scancb->stop == NULL) 1126 scancb->stop = (unsigned char *) htonl((long) tblwmark); (gdb) 1127 1128 scancb->msgl = 0; 1129 1130 if (scancb->kws) /* Scan with keyword table */ 1131 { 1132 unsigned char *nstloc; 1133 int nsffirst = 1; 1134 1135 result = 0; 1136 (gdb) 1137 while (result == 0) 1138 { 1139 NKW *matched_entry; 1140 1141 result = scntoken(scancb); 1142 1143 result = set_token(scancb, result); 1144 1145 result = set_type(scancb, result); 1146 (gdb) 1147 nstloc = (unsigned char *) ntohl((long) scancb->tloc); 1148 1149 if ( (result != 0) 1150 || ( (scancb->type & NSCNFNUL) 1151 && (! nsffirst) 1152 ) 1153 ) 1154 break; 1155 1156 nsffirst = 0; (gdb) 1157 1158 matched_entry = rlookup(scancb, 1159 (NKW *) ntohl((long) scancb->kws), 1160 stack_pointer, 1161 &result); 1162 1163 if (matched_entry == (NKW *) NULL) 1164 { 1165 result = 0; /* Stop if no match */ 1166 (gdb) 1167 break; 1168 } 1169 1170 if (result == 0) 1171 dospecl(scancb, matched_entry, nstloc); 1172 } 1173 } 1174 1175 else /* Scan with no keyword table */ 1176 { (gdb) 1177 result = scntoken(scancb); 1178 1179 result = set_token(scancb, result); 1180 1181 result = set_type(scancb, result); 1182 } 1183 1184 *token = (unsigned char *) ntohl((long) scancb->tloc); 1185 1186 *token_length = ntohl(scancb->tlen); (gdb) 1187 1188 return result; 1189 } 1190 /* Call match routine 1191 1192 Function: Call the indicated match routine in the 1193 keyword entry. 1194 1195 Arguments: The scan control block, 1196 The keyword entry, (gdb) next 1123 scancb->skip = (unsigned char *) htonl((long) tblwskip); (gdb) next 1125 if (scancb->stop == NULL) (gdb) next 1126 scancb->stop = (unsigned char *) htonl((long) tblwmark); (gdb) next 1130 if (scancb->kws) /* Scan with keyword table */ (gdb) next 1135 result = 0; (gdb) next 1133 int nsffirst = 1; (gdb) next 1141 result = scntoken(scancb); (gdb) next 1143 result = set_token(scancb, result); (gdb) next 1141 result = scntoken(scancb); (gdb) next 1143 result = set_token(scancb, result); (gdb) next 1145 result = set_type(scancb, result); (gdb) next 1147 nstloc = (unsigned char *) ntohl((long) scancb->tloc); (gdb) next 1149 if ( (result != 0) (gdb) next 1145 result = set_type(scancb, result); (gdb) next 1149 if ( (result != 0) (gdb) next 1158 matched_entry = rlookup(scancb, (gdb) next Program received signal SIGILL, Illegal instruction. 0x002971fc in hex_to_character () (gdb) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25791