Date: Fri, 20 Dec 2002 19:24:11 +0100 (CET) From: Stefan Farfeleder <stefan@fafoe.dyndns.org> To: FreeBSD-gnats-submit@FreeBSD.org Cc: stefan@fafoe.dyndns.org Subject: i386/46406: [PATCH] __aligned macro for the Intel C compiler Message-ID: <20021220182411.35D0A866@frog.fafoe>
next in thread | raw e-mail | index | archive | help
>Number: 46406 >Category: i386 >Synopsis: [PATCH] __aligned macro for the Intel C compiler >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Dec 20 10:30:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: Stefan Farfeleder >Release: FreeBSD 5.0-CURRENT i386 >Organization: >Environment: System: FreeBSD frog.fafoe 5.0-CURRENT FreeBSD 5.0-CURRENT #8: Fri Dec 20 01:53:06 CET 2002 freebsd@frog.fafoe:/freebsd/current/obj/freebsd/current/src/sys/FROG i386 >Description: In the below commit __aligned was added to <machine/signal.h> on i386. This causes the Intel C compiler (lang/icc) to abort when the header is processed. >How-To-Repeat: Script started on Fri Dec 20 19:05:00 2002 $ cat test.c #include <signal.h> int main(void) { return 0; } $ icc test.c test.c /usr/include/machine/signal.h(130): error: expected a ";" int sc_fpstate[128] __aligned(16); ^ compilation aborted for test.c (code 2) $ ^D Script done on Fri Dec 20 19:05:07 2002 >Fix: Here is a simple implementation of __aligned: --- cdefs.s.diff begins here --- Index: src/sys/sys/cdefs.h =================================================================== RCS file: /usr/home/ncvs/src/sys/sys/cdefs.h,v retrieving revision 1.68 diff -c -c -r1.68 cdefs.h *** src/sys/sys/cdefs.h 21 Oct 2002 20:50:30 -0000 1.68 --- src/sys/sys/cdefs.h 20 Dec 2002 17:45:26 -0000 *************** *** 141,146 **** --- 141,149 ---- #define __aligned(x) __attribute__((__aligned__(x))) #define __section(x) __attribute__((__section__(x))) #endif + #ifdef __ICC + #define __aligned(x) __declspec(align(x)) + #endif #endif /* XXX: should use `#if __STDC_VERSION__ < 199901'. */ --- cdefs.s.diff ends here --- --- commit_msg begins here --- deischen 2002/12/02 11:58:55 PST Modified files: sys/i386/i386 genassym.c locore.s machdep.c sys/i386/include signal.h ucontext.h Log: Align the FPU state in the ucontext and sigcontext to 16 bytes to accomodate the new SSE/XMM floating point save/restore instructions. This commit is mostly from bde and includes some style nits. Approved by: re (jhb) Revision Changes Path 1.132 +3 -0 src/sys/i386/i386/genassym.c 1.161 +14 -10 src/sys/i386/i386/locore.s 1.551 +6 -3 src/sys/i386/i386/machdep.c 1.20 +2 -2 src/sys/i386/include/signal.h 1.10 +6 -4 src/sys/i386/include/ucontext.h --- commit_msg ends here --- >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021220182411.35D0A866>