Messages in this thread Patch in this message | | | Date | Sun, 23 Aug 1998 16:03:18 +0200 (CEST) | From | Andrea Arcangeli <> | Subject | Re: FASTCALL in egcs was Re: Kernel 2.1.117 OOPS bug report |
| |
On 22 Aug 1998, Andi Kleen wrote:
>OK, I withdraw this patch because it is broken. I still think it needs >a solution though, probably the best way is to remove FASTCALL completely >because it apparently does not even work reliably on 2.7.2.
I fixed gcc this way:
--- /tmp/gcc-2.8.1/toplev.c Thu Feb 26 03:04:46 1998 +++ gcc-2.8.1/toplev.c Thu Jul 9 17:13:10 1998 @@ -3393,8 +3393,10 @@ /* If -opt, try combining insns through substitution. */ + optimize = 0; if (optimize > 0) TIMEVAR (combine_time, combine_instructions (insns, max_reg_num ())); + optimize = 1; /* Dump rtl code after insn combination. */ --- /tmp/gcc-2.8.1/loop.c Fri Feb 6 20:23:34 1998 +++ gcc-2.8.1/loop.c Thu Jul 9 17:08:55 1998 @@ -3037,6 +3037,7 @@ register int count = 0; register rtx dest; + return; bzero ((char *) last_set, nregs * sizeof (rtx)); for (insn = from; insn != to; insn = NEXT_INSN (insn)) { With this patch applyed to gcc 2.8.1 I was able to compile and boot Linux 2.1 whole compiled with -mregparm=3 (unfortunately then it locked after executing init but I am not sure it was a gcc bug, all SYSRQ keys was just working fine).
BTW, optimize=1 should be changed with oldopt = optimize ... optimize = 0 ... do buggy function ... optimize = oldopt.
The program that show the bug is this (extracted from some part of the kernel from Benjamin), the patch up made gcc 2.8.1 compile properly this simple program:
begin 664 regparm-pentium.c.gz M'XL("+S#GC4``W)E9W!A<FTM<&5N=&EU;2YC`)V27TO#,!3%G\VGN$2$E';0 M#O%AM4]C@J!/^B(((:[I"%O3DMXJ8^R[FS35[D]1\:$EN;?GW%]STJ!`M816 M-VJE90Y*(SS?/RYNKME[I?*`[`@<=_.V++?1IOI(;8=ST92<,VIR;):47`#, M:"8H,/M!$+D]S7*[[51!X#1&8FLT=`Y[0AI/X*QKKBM3B@T[&H@>HI>%(9[+ M"M$@G*H<'*)1;RU*SH$Q(U>U,"5+`@?RN\'8V,M<%DI+F+_,'Q9/D,0Q(:50 MFOFOG5!%L(Z@A@SB]/3PW!QN)QN,_%KJ/(*^T*TQL<\T)5995`;8.HM36-_Z M>785AH%M`>RZ-QPXVH%]<MTQ=TWGH)R#^G90SL'FX@#]C[-Z$/1,9U[[/P/] MGZ4/?Z#Y&63,ZQ`$DQ$*G(X[UL;&4P"C=^XF;`1*O=S.X,HFXK&^:K;TJNF0 ;WF0(8,)P.L'$7WO7.JH&[OY\`J_V51%O`P`` ` end
The _only_ problem seems to be that sometimes gcc uses %%eax to recall a function with the regparm() attribute set.
And for the Linux FASTCALL() thing it should not harm since the developer that used FASTCALL() has hopefully just tried that in that specific case the regparm() attribute has not generated bad asm code. And for functions like __switch_to() there' s sure no problems since it' s not recalled via pointer to function.
Andrea[s] Arcangeli
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html
| |