mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: spamtrap@use.reply-to (Erik Hensema)
To: linux-kernel@vger.kernel.org
Subject: PATCH: Re: Compilation problem in ndisc.c / 2.5.1-pre2 : possible gcc bug?
Date: 28 Nov 2001 21:04:39 GMT	[thread overview]
Message-ID: <slrna0akb7.560.spamtrap@dexter.hensema.xs4all.nl> (raw)
In-Reply-To: <Pine.LNX.3.95.1011128144324.6244A-100000@chaos.analogic.com> <3C054422.FB546EFE@didntduck.org>

Brian Gerst (bgerst@didntduck.org) wrote:
>"Richard B. Johnson" wrote:
>> 
>> On Wed, 28 Nov 2001, Martin Eriksson wrote:
>> > From: "Richard B. Johnson" <root@chaos.analogic.com>
>> > > On 28 Nov 2001, Erik Hensema wrote:
>> > > > I've been looking into the compile problems of net/ipv6/ndisc.c in
>> > > > 2.5.1-pre2 and I found that the asm generated by gcc (2.95.3) is wrong:
>> > > >
>> > > > This is a small part of a diff betweem two asm files generated by gcc,
>> > note
>> > > > the missing \n's in the wrong code:
>> > >
[code]
>> > > This is probably just some loop unrolling, not some as you say "wrong
>> > > code".
>> >
>> > Correct me if I'm wrong, but I don't think "%edxadcl" really assembles....
>> 
>> No, but an edited 'diff' of the assembly output of a 'C' compiler doesn't
>> really tell much. Note, no line numbers, no clue as to what the diff
>> was about. The actual defective section of code would be much more
>> instructive. For instance, is this as a result of an in-line macro
>> expansion; the result of a <CR><LF> 'dos' file; the true output of
>> a 'C' file with no __inline__ __asm__?
>
>It's from include/asm-i386/checksum.h, specifically csum_ipv6_magic(). 
>The asm statements in this header file need semicolons or explicit
>newlines after each opcode.

You're right, that was the problem.

This patch fixes it:

--- linux/include/asm-i386/checksum.h.orig	Wed Nov 28 21:49:00 2001
+++ linux/include/asm-i386/checksum.h	Wed Nov 28 21:52:28 2001
@@ -156,17 +156,17 @@
 						     unsigned int sum) 
 {
 	__asm__(
-		"addl 0(%1), %0"
-		"adcl 4(%1), %0"
-		"adcl 8(%1), %0"
-		"adcl 12(%1), %0"
-		"adcl 0(%2), %0"
-		"adcl 4(%2), %0"
-		"adcl 8(%2), %0"
-		"adcl 12(%2), %0"
-		"adcl %3, %0"
-		"adcl %4, %0"
-		"adcl $0, %0"
+		"addl 0(%1), %0		;\n"
+		"adcl 4(%1), %0		;\n"
+		"adcl 8(%1), %0		;\n"
+		"adcl 12(%1), %0	;\n"
+		"adcl 0(%2), %0		;\n"
+		"adcl 4(%2), %0		;\n"
+		"adcl 8(%2), %0		;\n"
+		"adcl 12(%2), %0	;\n"
+		"adcl %3, %0		;\n"
+		"adcl %4, %0		;\n"
+		"adcl $0, %0		;\n"
 		: "=&r" (sum)
 		: "r" (saddr), "r" (daddr), 
 		  "r"(htonl(len)), "r"(htonl(proto)), "0"(sum));

-- 
Erik Hensema (erik@hensema.net)
I'm on the list, no need to Cc: me, though I appreciate one if your
mailer doesn't support the References header.

  reply	other threads:[~2001-11-28 21:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.3.95.1011128140806.5756A-100000@chaos.analogic.co m>
2001-11-28 19:00 ` Erik Hensema
2001-11-28 19:09   ` Richard B. Johnson
2001-11-28 19:39     ` Martin Eriksson
2001-11-28 19:51       ` Richard B. Johnson
2001-11-28 20:08         ` Brian Gerst
2001-11-28 21:04           ` Erik Hensema [this message]
2001-11-29 14:07           ` Richard B. Johnson
2001-11-28 19:29   ` David Relson

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=slrna0akb7.560.spamtrap@dexter.hensema.xs4all.nl \
    --to=spamtrap@use.reply-to \
    --cc=erik@hensema.net \
    --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

all inboxes | Powered by JetHome®