public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/11631] New: [3.3-hammer regression] zsh/kernel miscompilation
@ 2003-07-22 14:12 gbeauchesne at mandrakesoft dot com
  2003-07-22 15:57 ` [Bug optimization/11631] " matz at suse dot de
                   ` (15 more replies)
  0 siblings, 16 replies; 18+ messages in thread
From: gbeauchesne at mandrakesoft dot com @ 2003-07-22 14:12 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11631

           Summary: [3.3-hammer regression] zsh/kernel miscompilation
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gbeauchesne at mandrakesoft dot com
                CC: aj at suse dot de,gcc-bugs at gcc dot gnu dot org,jh at
                    suse dot cz
  GCC host triplet: i686-pc-linux-gnu

The following program fails at -O2 but is OK at -Os. This occurs on both AMD64 &
 IA-32 but only on 3.3-hammer branch as of today. This is a regression from
3.3-hammer 2003/05/24. I believe this is similar to the kernel miscompilation
noticed by users at -O2 but zsh was easier to hunt. ;-)

Note the specific placement of f() & g(), the use of a static global variable,
the for(;;) loop.

/* Extracted from zsh sources.  */
/* Contributed by Gwenole Beauchesne <gbeauchesne@mandrakesoft.com>  */

extern void abort(void);
extern void exit(int);

static void f(const char *name);
static void g(const char *name);

static char *p;

int main(void)
{
  p = "foo";
  do {
      char *arg0 = p;
      if (!(p = strrchr(arg0, '/')))
	  p = arg0;
      else
	  p++;
      if (strcmp(p, "bar") != 0)
		break;
  } while (p);
  
  f(p);
  g(p);

  for (;;) {
  }

  return 0;
}

static void f(const char *name)
{
}

static void g(const char *name)
{
  if (name)
	exit(0);
  else
	abort();
}


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2003-07-28 19:20 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-22 14:12 [Bug optimization/11631] New: [3.3-hammer regression] zsh/kernel miscompilation gbeauchesne at mandrakesoft dot com
2003-07-22 15:57 ` [Bug optimization/11631] " matz at suse dot de
2003-07-22 16:43   ` Gwenole Beauchesne
2003-07-22 16:04 ` falk at debian dot org
2003-07-22 16:06 ` [Bug optimization/11631] [3.4/3.3-hammer " gbeauchesne at mandrakesoft dot com
2003-07-22 16:43 ` gbeauchesne at mandrakesoft dot com
2003-07-24  9:08 ` zlomek at gcc dot gnu dot org
2003-07-24 13:26 ` pinskia at physics dot uc dot edu
2003-07-24 16:14 ` zlomek at gcc dot gnu dot org
2003-07-24 17:35 ` gbeauchesne at mandrakesoft dot com
2003-07-24 18:49 ` rakdver at atrey dot karlin dot mff dot cuni dot cz
2003-07-24 19:13 ` aj at suse dot de
2003-07-24 20:59 ` cvs-commit at gcc dot gnu dot org
2003-07-24 21:02 ` pinskia at physics dot uc dot edu
2003-07-24 21:04 ` [Bug optimization/11631] [3.3-hammer " pinskia at physics dot uc dot edu
2003-07-25  8:36 ` [Bug optimization/11631] [3.3-hammer regression] zsh miscompilation gbeauchesne at mandrakesoft dot com
2003-07-28 19:18 ` cvs-commit at gcc dot gnu dot org
2003-07-28 19:20 ` pinskia at physics dot uc dot edu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).