public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Adam Kropelin <akropel1@rochester.rr.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Prasanna Meda <pmeda@akamai.com>, Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] contort getdents64 to pacify gcc-2.96
Date: Thu, 13 Jan 2005 00:42:19 -0500	[thread overview]
Message-ID: <20050113004219.A25351@mail.kroptech.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0501112100250.2373@ppc970.osdl.org>

A recent trivial fixup in sys_getdents64...

> diff -Nru a/fs/readdir.c b/fs/readdir.c
> --- a/fs/readdir.c	2005-01-12 19:22:35 -08:00
> +++ b/fs/readdir.c	2005-01-12 19:22:35 -08:00
> @@ -287,8 +287,9 @@
>  	lastdirent = buf.previous;
>  	if (lastdirent) {
>  		typeof(lastdirent->d_off) d_off = file->f_pos;
> -		__put_user(d_off, &lastdirent->d_off);
>  		error = count - buf.count;
> +		if (__put_user(d_off, &lastdirent->d_off))
> +			error = -EFAULT;
>  	}
>  
>  out_putf:

...gives gcc-2.96 indigestion:

> fs/readdir.c: In function `sys_getdents64':
> fs/readdir.c:299: Unrecognizable insn:
> (insn 166 257 174 (parallel[
>             (set (reg/v:SI 6 ebp)
>                 (asm_operands/v ("1:    movl %%eax,0(%2)
> 2:      movl %%edx,4(%2)
> 3:
> .section .fixup,"ax"
> 4:      movl %3,%0
>         jmp 3b
> .previous
> .section __ex_table,"a"
>         .align 4
>         .long 1b,4b
>         .long 2b,4b
> .previous") ("=r") 0[
>                         (reg:DI 1 edx)
>                         (reg:SI 0 eax)
>                         (const_int -14 [0xfffffff2])
>                         (reg/v:SI 6 ebp)
>                     ]
>                     [
>                         (asm_input:DI ("A"))
>                         (asm_input:SI ("r"))
>                         (asm_input:SI ("i"))
>                         (asm_input:SI ("0"))
>                     ]  ("fs/readdir.c") 291))
>             (clobber (reg:QI 19 dirflag))
>             (clobber (reg:QI 18 fpsr))
>             (clobber (reg:QI 17 flags))
>         ] ) -1 (insn_list 132 (insn_list 146 (insn_list 165 (nil))))
>     (nil))
> fs/readdir.c:299: confused by earlier errors, bailing out

While upgrading to a sane gcc would be the preferred solution, 
rewriting the change as follows eliminates the error for those who
cannot do so.

Signed-off-by: Adam Kropelin <akropel1@rochester.rr.com>

--- linux-2.6.11-rc1.orig/fs/readdir.c	Wed Jan 12 22:35:03 2005
+++ linux-2.6.11-rc1/fs/readdir.c	Wed Jan 12 22:16:55 2005
@@ -287,9 +287,10 @@
 	lastdirent = buf.previous;
 	if (lastdirent) {
 		typeof(lastdirent->d_off) d_off = file->f_pos;
-		error = count - buf.count;
+		error = -EFAULT;
 		if (__put_user(d_off, &lastdirent->d_off))
-			error = -EFAULT;
+			goto out_putf;
+		error = count - buf.count;
 	}
 
 out_putf:


  parent reply	other threads:[~2005-01-13  3:42 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-12  5:09 Linux 2.6.11-rc1 Linus Torvalds
2005-01-12  7:07 ` Keith Owens
2005-01-12  7:32 ` Markus Trippelsdorf
2005-01-13 22:37   ` Linux 2.6.11-rc1 (ACPI related problems) Hanspeter Kunz
2005-01-12  8:24 ` Linux 2.6.11-rc1 Brice Goglin
2005-01-12  9:20   ` Tino Keitel
2005-01-12  9:38     ` Brice Goglin
2005-01-12 14:13       ` Dmitry Torokhov
2005-01-12 14:35         ` Brice Goglin
2005-01-12 15:50   ` Linus Torvalds
2005-01-12 19:13     ` Vojtech Pavlik
2005-01-12 15:24 ` Sergey S. Kostyliov
2005-01-12 15:32   ` Linus Torvalds
2005-01-12 15:44     ` Gene Heskett
2005-01-12 16:03     ` Sergey S. Kostyliov
2005-01-13  9:45     ` NUMA or not on dual Opteron (was: Re: Linux 2.6.11-rc1) Sander
2005-01-13 10:02       ` NUMA or not on dual Opteron Raphael Jacquot
2005-01-13 17:07         ` Justin M. Forbes
2005-01-13 19:43           ` Andi Kleen
2005-01-13 19:40         ` Andi Kleen
2005-01-13 15:36       ` NUMA or not on dual Opteron (was: Re: Linux 2.6.11-rc1) Alan Cox
2005-01-13 19:38       ` NUMA or not on dual Opteron Andi Kleen
2005-01-15 23:42         ` Sander
2005-01-13 21:24       ` Bernd Eckenfels
2005-01-14  8:04         ` David Schwartz
2005-01-14  8:10           ` Arjan van de Ven
2005-01-14  8:48           ` Andi Kleen
2005-01-12 19:06 ` Linux 2.6.11-rc1 -- usb_storage and Genesys Jan De Luyck
2005-01-13  5:42 ` Adam Kropelin [this message]
2005-01-13  3:51   ` [PATCH] contort getdents64 to pacify gcc-2.96 Linus Torvalds
2005-01-13 23:15 ` Linux 2.6.11-rc1 (compile stats) John Cherry
2005-01-16  9:22 ` Cross-compilation broken (was: Re: Linux 2.6.11-rc1) Geert Uytterhoeven
2005-01-16 16:09   ` Sam Ravnborg
2005-01-17  9:00     ` Geert Uytterhoeven
2005-01-19 21:07 ` Linux 2.6.11-rc1 Daniel Gryniewicz
2005-01-20  4:16   ` Dmitry Torokhov
2005-01-20  4:49     ` Daniel Gryniewicz
2005-01-20  7:17       ` Peter Osterlund
2005-01-20 15:01         ` Romano Giannetti
  -- strict thread matches above, loose matches on Subject: below --
2005-01-13  6:34 [PATCH] contort getdents64 to pacify gcc-2.96 Meda, Prasanna

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=20050113004219.A25351@mail.kroptech.com \
    --to=akropel1@rochester.rr.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeda@akamai.com \
    --cc=torvalds@osdl.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