All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roland Vossen" <rvossen@broadcom.com>
To: sparclinux@vger.kernel.org
Subject: Simple piece of code with unexpected behavior
Date: Thu, 11 Aug 2011 12:29:03 +0000	[thread overview]
Message-ID: <4E43CB0F.7050700@broadcom.com> (raw)

Hi,

after compiling and insmodding a module on a Sparc64 machine, the 
following piece of code:

	u8 index;
         for (index = 0; index < 128U; index++) {
                 if (index=129) {
                         printk("fishy...\n");
                         break;
                 }
         }

produces the log message: 'fishy...'.

The same piece of code does not produce this message on x86.

Is this a compiler bug, or am I overlooking something ?

Thanks, Roland.


--- info on my machine

developer@LB-BUN-44:~/code/brcm80211-next-2.6$ uname -a
Linux LB-BUN-44.bun.broadcom.com 3.0.0-rc6+ #2 Fri Jul 22 17:00:50 CEST 
2011 sparc64 GNU/Linux

--- info on my GCC version

developer@LB-BUN-44:~/code/brcm80211-next-2.6$ gcc -v
Using built-in specs.
Target: sparc-linux-gnu
Configured with: ../src/configure -v 
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr 
--enable-shared --with-system-zlib --libexecdir=/usr/lib 
--without-included-gettext --enable-threads=posix --enable-nls 
--with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2 
--enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc 
--enable-mpfr --with-cpu=v8 --with-long-double-128 
--enable-checking=release --build=sparc-linux-gnu --host=sparc-linux-gnu 
--target=sparc-linux-gnu
Thread model: posix
gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu4)


             reply	other threads:[~2011-08-11 12:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-11 12:29 Roland Vossen [this message]
2011-08-11 12:44 ` Simple piece of code with unexpected behavior David Miller
2011-08-11 14:18 ` Roland Vossen
2011-08-11 14:34 ` David Miller

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=4E43CB0F.7050700@broadcom.com \
    --to=rvossen@broadcom.com \
    --cc=sparclinux@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.