From: Paolo Ornati <ornati@fastwebnet.it>
To: Andreas Kies <andikies@t-online.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: A Bug in gcc or asm/string.h ?
Date: Mon, 27 Jun 2005 16:04:53 +0200 [thread overview]
Message-ID: <20050627160453.6b815e8a@localhost> (raw)
In-Reply-To: <200506270105.28782.andikies@t-online.de>
On Mon, 27 Jun 2005 01:05:28 +0200
Andreas Kies <andikies@t-online.de> wrote:
> Hello,
>
> When running a kernel module compiled with gcc 3.3.5, I think I've found a
> bug in either the compiler or the kernel definition of strcmp in
> asm-i386/string.h . The exact compiler version is :
>
> Reading specs from /usr/lib/gcc-lib/i586-suse-linux/3.3.5/specs
> Configured with: ../configure --enable-threads=posix --prefix=/usr
> --with-local-prefix=/usr/local --infodir=/usr/share/info
> --mandir=/usr/share/man --enable-languages=c,c++,f77,objc,java,ada
> --disable-checking --libdir=/usr/lib --enable-libgcj --with-slibdir=/lib
> --with-system-zlib --enable-shared --enable-__cxa_atexit i586-suse-linux
> Thread model: posix
> gcc version 3.3.5 20050117 (prerelease) (SUSE Linux)
>
> I was able to construct a small pure usermode program.
> If you compile the included test program with optimization level 1 or less
> it works, if compiled with level 2 it fails. Failing means the strcmp
> result is != 0 because char ptr has valid contents at the time strcmp is
> expanded. Other platforms besides i386 might be affected, too.
> In the case of a failure you get "Unrecognized" as output on stdout.
>
> So, here are my questions :
> - Is this a bug in the compiler ?
> In Documentation/Changes version 2.95.x is still recommended, I guess this
> is outdated.
> - Is it a bug in the definition of strcmp ? Maybe an addition volatile is
> missing.
>
> Thanks for reading.
>
...
>
> int oem;
>
> int main(void)
> {
> char ptr[2];
what happens if you change "char ptr[2]" to "volatile char ptr[2]" ?
--
Paolo Ornati
Linux 2.6.12.1 on x86_64
next prev parent reply other threads:[~2005-06-27 16:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-26 23:05 A Bug in gcc or asm/string.h ? Andreas Kies
2005-06-27 14:04 ` Paolo Ornati [this message]
[not found] ` <200506272059.20477.andikies@t-online.de>
2005-06-27 19:43 ` Paolo Ornati
2005-06-27 23:53 ` Andreas Kies
2005-06-28 7:39 ` Paolo Ornati
-- strict thread matches above, loose matches on Subject: below --
2005-06-27 20:21 Nick Warne
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=20050627160453.6b815e8a@localhost \
--to=ornati@fastwebnet.it \
--cc=andikies@t-online.de \
--cc=linux-kernel@vger.kernel.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