From stefan@fafoe.dyndns.org  Fri Dec 20 10:24:19 2002
Return-Path: <stefan@fafoe.dyndns.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 5A36C37B401
	for <FreeBSD-gnats-submit@freebsd.org>; 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 <FreeBSD-gnats-submit@freebsd.org>; 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 <stefan@fafoe.dyndns.org>
Reply-To: Stefan Farfeleder <stefan@fafoe.dyndns.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc: stefan@fafoe.dyndns.org
Subject: [PATCH] __aligned macro for the Intel C compiler
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         46406
>Category:       i386
>Synopsis:       [PATCH] __aligned macro for the Intel C compiler
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Dec 20 10:30:00 PST 2002
>Closed-Date:    Fri Feb 07 10:25:27 PST 2003
>Last-Modified:  Fri Feb 07 10:25:27 PST 2003
>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:

From: Stefan Farfeleder <stefan@fafoe.dyndns.org>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: i386/46406: [PATCH] __aligned macro for the Intel C compiler
Date: Fri, 7 Feb 2003 17:52:43 +0100

 Could somebody please close this PR?  The last update to lang/icc made
 it moot.
 
 Thanks,
 Stefan Farfeleder
State-Changed-From-To: open->closed 
State-Changed-By: maxim 
State-Changed-When: Fri Feb 7 10:25:06 PST 2003 
State-Changed-Why:  
Closed at the submitter's request. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=46406 
>Unformatted:
