qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alexander E. Patrakov" <patrakov@ums.usu.ru>
To: Herbert Poetzl <herbert@13thfloor.at>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Overoptimization
Date: Fri, 28 May 2004 16:58:33 +0600	[thread overview]
Message-ID: <40B71B59.7080406@ums.usu.ru> (raw)
In-Reply-To: <20040528101351.GA18592@MAIL.13thfloor.at>

Herbert Poetzl wrote:
> On Fri, May 28, 2004 at 07:19:35AM +0600, Alexander E. Patrakov wrote:
> 
>>The CFLAGS in Makefile.target are bad for gcc 3.3.2. This is not a my 
>>problem with my gcc, because it passes the "make check" testsuite except 
>>some known errors in libstdc++, which cannot affect qemu.
>>
>>The victim is the tcp_input function in slirp. When compiling with the 
>>decault CFLAGS, for some reason all packets are dropped as having a 
>>wrong TCP checksum. I tried debugging this by placing some debug printfs 
>>in tcp_input.c file, but the problem disappeared after I inserted them. 
>>I concluded that it is very strange and compiled this tcp_input.c file 
>>without my debug statements, but with -O1 instead of -O2. The problem 
>>went away.
> 
> 
> gcc isn't supposed to change the semantics of
> a program based on the optimization level.
> 
> nevertheless several cases are known where this
> happened, and not seldom the bug was in gcc
> 
> testing the same opts with 3.3.3 or 3.4 will
> show if gcc is to blame or not.

Done (with gcc 3.4.0). I used a truly minimal configuration of qemu in 
both cases to make sure that this is not an SDL/X/whatever else problem:

./configure --prefix=/usr --target-list=i386-softmmu --enable-slirp 
--disable-sdl

GCC 3.4.0, however, required one more file to be compiled with -O1 
(because of some register allocation error), and there were some "struct 
timezone" errors that were trivial to fix by including <time.h> where 
appropriate.

The result is the same. If I compile tcp_input.c with -O2, all tcp 
packets are rejected in user-net mode because of wrong tcp checksum. If 
tcp_input.c is compiled with -O1, qemu works.

-- 
Alexander E. Patrakov

  reply	other threads:[~2004-05-28 15:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-28  1:19 [Qemu-devel] Overoptimization Alexander E. Patrakov
2004-05-28 10:13 ` Herbert Poetzl
2004-05-28 10:58   ` Alexander E. Patrakov [this message]
2004-05-28 11:08     ` Herbert Poetzl
2004-05-28 13:50       ` [SOLVED] " Alexander E. Patrakov
2004-05-28 22:15         ` Lionel Ulmer
2004-05-29 18:18         ` [Qemu-devel] VNC patch, the 3rd version Johannes Schindelin
2004-05-31  2:00           ` Jim C. Brown

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=40B71B59.7080406@ums.usu.ru \
    --to=patrakov@ums.usu.ru \
    --cc=herbert@13thfloor.at \
    --cc=qemu-devel@nongnu.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 NNTP newsgroup(s).