public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Carlos O'Donell <carlos@baldric.uwo.ca>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: c/7661: gcc-3.0 optimization bug on debian GNULinux on x86 with very simple program
Date: Tue, 20 Aug 2002 18:06:00 -0000	[thread overview]
Message-ID: <20020820234602.3382.qmail@sources.redhat.com> (raw)

The following reply was made to PR c/7661; it has been noted by GNATS.

From: Carlos O'Donell <carlos@baldric.uwo.ca>
To: Andrew Pinski <pinskia@physics.uc.edu>
Cc: Thomas Deselaers <thomas@deselaers.de>, gcc-gnats@gcc.gnu.org,
	debian-gcc@lists.debian.org
Subject: Re: c/7661: gcc-3.0 optimization bug on debian GNULinux on x86 with very simple program
Date: Tue, 20 Aug 2002 19:39:36 -0400

 > I think this program should not terminate at all because i will 
 > always be one greater than oldi.
 > I think gcc3.0 has a problem with no optimization then but since 
 > there is later version that works gcc 3.1.1, upgrade.
 > 
 > Thanks,
 > Andrew Pinski
 > 
 
 Agreed. Infact it doesn't terminate on all the systems I've tried (3).
 But for the sake of presenting a test case :)
 
 ---
 Test System: Dell XPS-T 450Mhz PIII (Debian testing/unstable)
 ---
 Reading specs from /usr/lib/gcc-lib/i386-linux/3.0.4/specs
 Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,objc --prefix=/usr --infodir=/share/info --mandir=/share/man --enable-shared --with-gnu-as --with-gnu-ld --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-checking --enable-threads=posix --enable-java-gc=boehm --with-cpp-install-dir=bin --enable-objc-gc i386-linux
 Thread model: posix
 gcc version 3.0.4
 ---
 
 carlos@systemhalted:~$ cat test.c 
 main() {                                                                                                      int i=0;                                                                                                int oldi=0;;                                                                                            while(++i>oldi) oldi=i;                                                                                 return oldi;                                                                                       }                 
 carlos@systemhalted:~$ gcc-3.0 -O0 -o test test.c
 carlos@systemhalted:~$ ./test
 (Attach gdb, look at stuff, it's not stopping) ^C
 carlos@systemhalted:~$ gcc-3.0 -o test test.c
 carlos@systemhalted:~$ ./test
 (Attach gdb, look at stuff, it's not stopping) ^C
 ---
 
 Maybe you've been bad to your gcc ;)
 
 In the optimized case (-O9) I see:
 080483f8 <main>:
  80483f8:       55                      push   %ebp
  80483f9:       89 e5                   mov    %esp,%ebp
  80483fb:       83 ec 08                sub    $0x8,%esp
  80483fe:       83 e4 f0                and    $0xfffffff0,%esp
  8048401:       8d 76 00                lea    0x0(%esi),%esi
  8048404:       eb fe                   jmp    8048404 <main+0xc>
  8048406:       90                      nop    
  8048407:       90                      nop    
 
 Which never terminates... and gcc knew it.
 
 If there were some examples of gcc-3.0 mucking 
 up optimizations... this isn't it.
 
 c.
 


             reply	other threads:[~2002-08-20 23:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-20 18:06 Carlos O'Donell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-08-20 14:06 Martin Sebor
2002-08-20 11:46 Andrew Pinski
2002-08-20 10:16 Thomas Deselaers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020820234602.3382.qmail@sources.redhat.com \
    --to=carlos@baldric.uwo.ca \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).