From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28043 invoked by alias); 12 Dec 2006 14:56:38 -0000 Received: (qmail 28033 invoked by uid 22791); 12 Dec 2006 14:56:37 -0000 X-Spam-Check-By: sourceware.org Received: from Unknown (HELO ce.aut.ac.ir) (217.219.237.38) by sourceware.org (qpsmtpd/0.31) with SMTP; Tue, 12 Dec 2006 14:56:29 +0000 Received: (qmail 11663 invoked by uid 48); 12 Dec 2006 15:03:12 -0000 Received: from 192.168.1.13 (proxying for unknown) (SquirrelMail authenticated user zneda) by ce.aut.ac.ir with HTTP; Tue, 12 Dec 2006 18:33:12 +0330 (IRST) Message-ID: <55308.192.168.1.13.1165935792.squirrel@ce.aut.ac.ir> Date: Tue, 12 Dec 2006 14:56:00 -0000 Subject: Hazard Detection From: zneda@ce.aut.ac.ir To: gcc-help@gcc.gnu.org Cc: neda.zf@gmail.com User-Agent: SquirrelMail/1.4.4-2 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2006-12/txt/msg00218.txt.bz2 Hi I have a question: I compiled a program with gcc -mips1 , Compiler generate this list of instructions:         ...               ....                    ...  10b71c:      87a20018       lh         v0,24(sp)  10b720:     00000000       nop  10b724:     144000b9       bnez    v0,10ba0c  10b728:     0015ac03       sra       s5,s5,0x10   ...                    ....                             ... but by a small change, some times in variables, (using same compiler switches) compiler don't insert nop between load and branch and generates this sequence of instructions:   ...     ....          ... 10b754:     87a20018     lh          v0,24(sp) 10b758:     144000b9     bnez     v0,10ba40 10b75c:     0015ac03     sra         s5,s5,0x10   ...                  ....                 ... would you please tell me the reason? why doesn't compiler detect hazard always? Thanks in advanced. Neda Zolfaghari (zneda@aut.ac.ir)