This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

optimization/6233: simple loop miscompilation



>Number:         6233
>Category:       optimization
>Synopsis:       simple loop miscompilation
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 08 21:36:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Alan Modra
>Release:        3.2 20020408 (experimental)
>Organization:
IBM
>Environment:
configured with: /src/gcc-current/configure --prefix=/usr/local --build=i686-linux --host=i686-linux --target=i686-linux --disable-nls --enable-shared --enable-languages=c,c++
>Description:
	function call incorrectly moved out of loop at -O2.
>How-To-Repeat:
	testcase distilled from binutils sources
extern char *p;

static int
is_end_of_statement ()
{
  return *p == '\n' || *p == ';' || *p == '!';
}

void foo (void)
{
  while (!is_end_of_statement ())
    p++;
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]