From owner-freebsd-bugs Fri Dec 20 10:30: 5 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C23EE37B405 for ; Fri, 20 Dec 2002 10:30:01 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id EA22F43EE5 for ; Fri, 20 Dec 2002 10:30:00 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id gBKIU0NS071194 for ; Fri, 20 Dec 2002 10:30:00 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id gBKIU0o8071193; Fri, 20 Dec 2002 10:30:00 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5A36C37B401 for ; Fri, 20 Dec 2002 10:24:19 -0800 (PST) Received: from fafoe.dyndns.org (chello212186121237.14.vie.surfer.at [212.186.121.237]) by mx1.FreeBSD.org (Postfix) with ESMTP id C584843EE8 for ; Fri, 20 Dec 2002 10:24:18 -0800 (PST) (envelope-from stefan@fafoe.dyndns.org) Received: from frog.fafoe (frog.fafoe [192.168.2.101]) by fafoe.dyndns.org (Postfix) with ESMTP id ACE013F9A; Fri, 20 Dec 2002 19:24:11 +0100 (CET) Received: by frog.fafoe (Postfix, from userid 1001) id 35D0A866; Fri, 20 Dec 2002 19:24:11 +0100 (CET) Message-Id: <20021220182411.35D0A866@frog.fafoe> Date: Fri, 20 Dec 2002 19:24:11 +0100 (CET) From: Stefan Farfeleder Reply-To: Stefan Farfeleder To: FreeBSD-gnats-submit@FreeBSD.org Cc: stefan@fafoe.dyndns.org X-Send-Pr-Version: 3.113 Subject: i386/46406: [PATCH] __aligned macro for the Intel C compiler Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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 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 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