Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/pcc/dist/pcc merge changes from pcc-090902 branch



details:   https://anonhg.NetBSD.org/src/rev/95a0638ebd52
branches:  trunk
changeset: 755380:95a0638ebd52
user:      plunky <plunky%NetBSD.org@localhost>
date:      Thu Jun 03 19:07:59 2010 +0000

description:
merge changes from pcc-090902 branch

diffstat:

 external/bsd/pcc/dist/pcc/cc/Makefile.in  |    3 +-
 external/bsd/pcc/dist/pcc/cc/cc/cc.1      |   12 +-
 external/bsd/pcc/dist/pcc/cc/ccom/ccom.1  |    4 +-
 external/bsd/pcc/dist/pcc/cc/ccom/pftn.c  |  344 ++++-------------------------
 external/bsd/pcc/dist/pcc/cc/cpp/cpp.1    |    4 +-
 external/bsd/pcc/dist/pcc/f77/Makefile.in |    3 +-
 6 files changed, 62 insertions(+), 308 deletions(-)

diffs (truncated from 541 to 300 lines):

diff -r 3645a87f3b64 -r 95a0638ebd52 external/bsd/pcc/dist/pcc/cc/Makefile.in
--- a/external/bsd/pcc/dist/pcc/cc/Makefile.in  Thu Jun 03 18:57:00 2010 +0000
+++ b/external/bsd/pcc/dist/pcc/cc/Makefile.in  Thu Jun 03 19:07:59 2010 +0000
@@ -1,4 +1,5 @@
-#      $Id: Makefile.in,v 1.2 2010/01/22 11:08:40 plunky Exp $
+#      Id: Makefile.in,v 1.3 2008/01/06 17:18:55 ragge Exp     
+#      $NetBSD: Makefile.in,v 1.3 2010/06/03 19:07:59 plunky Exp $
 #
 # Makefile.in for top-level of pcc.
 #
diff -r 3645a87f3b64 -r 95a0638ebd52 external/bsd/pcc/dist/pcc/cc/cc/cc.1
--- a/external/bsd/pcc/dist/pcc/cc/cc/cc.1      Thu Jun 03 18:57:00 2010 +0000
+++ b/external/bsd/pcc/dist/pcc/cc/cc/cc.1      Thu Jun 03 19:07:59 2010 +0000
@@ -1,5 +1,5 @@
-.\"    $Id: cc.1,v 1.2 2010/01/08 16:31:51 joerg Exp $
-.\"    $NetBSD: cc.1,v 1.2 2010/01/08 16:31:51 joerg Exp $
+.\"    Id: cc.1,v 1.16 2010/04/05 14:24:06 reed Exp    
+.\"    $NetBSD: cc.1,v 1.3 2010/06/03 19:07:59 plunky Exp $
 .\"    $OpenBSD$
 .\"
 .\" Copyright (c) 2007 Jeremy C. Reed <reed%reedmedia.net@localhost>
@@ -191,11 +191,11 @@
 Target-dependent option.
 .Bl -tag -width PowerPC
 .It ARM
--mlittle-endian -mbig-endian -mfpe=fpa -mfpe=vpf -msoft-float -march=armv1 -march=armv2 -march=armv2a -march=armv3 -march=armv4 -march=armv4t -march=armv4tej -march=armv5 -march=armv6 -march=armv6t2 
-march=armv6kz -march=armv6k -march=armv7
+\-mlittle-endian \-mbig-endian \-mfpe=fpa \-mfpe=vpf \-msoft-float \-march=armv1 \-march=armv2 \-march=armv2a \-march=armv3 \-march=armv4 \-march=armv4t \-march=armv4tej \-march=armv5 \-march=armv6 
\-march=armv6t2 \-march=armv6kz \-march=armv6k \-march=armv7
 .It HPPA
 .It i386
 .It MIPS
--mlittle-endian -mbig-endian -mhard-float -msoft-float
+\-mlittle-endian \-mbig-endian \-mhard-float \-msoft-float
 .It PDP-10
 .It PowerPC
 .It Sparc64
@@ -234,7 +234,7 @@
 preprocessor directive for
 .Xr cpp 1 .
 Uses
-.Sy -lpthread
+.Sy \-lpthread
 for the
 .Xr ld 1
 linker.
@@ -307,7 +307,7 @@
 .It __PCC_MINOR__
 Set to the minor version.
 .It __PCC_MINORMINOR__
-Set to the minor-minor version -- the number after the minor version.
+Set to the minor-minor version \(em the number after the minor version.
 .It _PTHREADS
 Defined when
 .Fl pthread
diff -r 3645a87f3b64 -r 95a0638ebd52 external/bsd/pcc/dist/pcc/cc/ccom/ccom.1
--- a/external/bsd/pcc/dist/pcc/cc/ccom/ccom.1  Thu Jun 03 18:57:00 2010 +0000
+++ b/external/bsd/pcc/dist/pcc/cc/ccom/ccom.1  Thu Jun 03 19:07:59 2010 +0000
@@ -1,5 +1,5 @@
-.\"    $NetBSD: ccom.1,v 1.2 2010/01/08 16:32:23 joerg Exp $
-.\"    $Id: ccom.1,v 1.2 2010/01/08 16:32:23 joerg Exp $
+.\"    Id: ccom.1,v 1.9 2010/04/05 13:13:57 reed Exp   
+.\"    $NetBSD: ccom.1,v 1.3 2010/06/03 19:07:59 plunky Exp $
 .\"
 .\" Copyright (c) 2007 Jeremy C. Reed <reed%reedmedia.net@localhost>
 .\" Permission to use, copy, modify, and/or distribute this software for any
diff -r 3645a87f3b64 -r 95a0638ebd52 external/bsd/pcc/dist/pcc/cc/ccom/pftn.c
--- a/external/bsd/pcc/dist/pcc/cc/ccom/pftn.c  Thu Jun 03 18:57:00 2010 +0000
+++ b/external/bsd/pcc/dist/pcc/cc/ccom/pftn.c  Thu Jun 03 19:07:59 2010 +0000
@@ -1,4 +1,5 @@
-/*     $Id: pftn.c,v 1.4 2009/09/04 00:50:05 gmcgarry Exp $    */
+/*     Id: pftn.c,v 1.280 2010/05/23 19:52:04 ragge Exp        */      
+/*     $NetBSD: pftn.c,v 1.5 2010/06/03 19:07:59 plunky Exp $  */
 /*
  * Copyright (c) 2003 Anders Magnusson (ragge%ludd.luth.se@localhost).
  * All rights reserved.
@@ -65,8 +66,6 @@
 
 # include "pass1.h"
 
-#include <string.h> /* XXX - for strcmp */
-
 #include "cgram.h"
 
 struct symtab *cftnsp;
@@ -117,7 +116,7 @@
 NODE *arrstk[10];
 int arrstkp;
 static int intcompare;
-static NODE *parlink;
+NODE *parlink;
 
 void fixtype(NODE *p, int class);
 int fixclass(int class, TWORD type);
@@ -405,6 +404,9 @@
                if ((ga = gcc_get_attr(sue, GCC_ATYP_ALIGNED))) {
                        sue->suealign = ga->a1.iarg;
                        SETOFF(sue->suesize, sue->suealign);
+               } else if ((ga = gcc_get_attr(sue, GCC_ATYP_MODE))) {
+                       if (ga->a1.iarg)
+                               p->stype = ga->a1.iarg;
                }
                ap->n_right = bcon(0);
        }
@@ -432,15 +434,16 @@
                        oalloc(p, &autooff);
                break;
        case PARAM:
-               if (ISARY(p->stype)) {
+               if (arrstkp) {
+                       dynalloc(p, &argoff);
+               } else {
+                       if (ISARY(p->stype)) {
                        /* remove array type on parameters before oalloc */
-                       p->stype += (PTR-ARY);
-                       p->sdf++;
+                               p->stype += (PTR-ARY);
+                               p->sdf++;
+                       }
+                       oalloc(p, &argoff);
                }
-               if (arrstkp)
-                       dynalloc(p, &argoff);
-               else
-                       oalloc(p, &argoff);
                break;
                
        case STATIC:
@@ -1135,7 +1138,7 @@
        if (ty == VOID)
                sz = SZCHAR;
 #endif
-       if (ty != STRTY && ty != UNIONTY) {
+       if (!ISSOU(BTYPE(ty))) {
                if (sz == 0) {
                        uerror("unknown size");
                        return(SZINT);
@@ -2061,269 +2064,6 @@
        return r;
 }
 
-#ifndef NO_C_BUILTINS
-/*
- * replace an alloca function with direct allocation on stack.
- * return a destination temp node.
- */
-static NODE *
-builtin_alloca(NODE *f, NODE *a)
-{
-       struct symtab *sp;
-       NODE *t, *u;
-
-#ifdef notyet
-       if (xnobuiltins)
-               return NULL;
-#endif
-       sp = f->n_sp;
-
-       if (a == NULL || a->n_op == CM) {
-               uerror("wrong arg count for alloca");
-               return bcon(0);
-       }
-       t = tempnode(0, VOID|PTR, 0, MKSUE(INT) /* XXX */);
-       u = tempnode(regno(t), VOID|PTR, 0, MKSUE(INT) /* XXX */);
-       spalloc(t, a, SZCHAR);
-       tfree(f);
-       return u;
-}
-
-/*
- * See if there is a goto in the tree.
- * XXX this function is a hack for a flaw in handling of 
- * compound expressions and inline functions and should not be 
- * needed.
- */
-static int
-hasgoto(NODE *p)
-{
-       int o = coptype(p->n_op);
-
-       if (o == LTYPE)
-               return 0;
-       if (p->n_op == GOTO)
-               return 1;
-       if (o == UTYPE)
-               return hasgoto(p->n_left);
-       if (hasgoto(p->n_left))
-               return 1;
-       return hasgoto(p->n_right);
-}
-
-/*
- * Determine if a value is known to be constant at compile-time and
- * hence that PCC can perform constant-folding on expressions involving
- * that value.
- */
-static NODE *
-builtin_constant_p(NODE *f, NODE *a)
-{
-       int isconst = (a != NULL && a->n_op == ICON);
-
-       tfree(f);
-       if (a && hasgoto(a)) {
-               a = buildtree(COMOP, a, bcon(0));
-       } else {
-               tfree(a);
-               a = bcon(isconst);
-       }
-
-       return a;
-}
-
-/*
- * Hint to the compiler whether this expression will evaluate true or false.
- * Just ignored for now.
- */
-static NODE *
-builtin_expect(NODE *f, NODE *a)
-{
-
-       tfree(f);
-       if (a && a->n_op == CM) {
-               tfree(a->n_right);
-               f = a->n_left;
-               nfree(a);
-               a = f;
-       }
-
-       return a;
-}
-
-/*
- * Take integer absolute value.
- * Simply does: ((((x)>>(8*sizeof(x)-1))^(x))-((x)>>(8*sizeof(x)-1)))
- */
-static NODE *
-builtin_abs(NODE *f, NODE *a)
-{
-       NODE *p, *q, *r, *t, *t2, *t3;
-       int tmp1, tmp2, shift;
-
-       if (a == NULL)
-               goto bad;
-
-       if (a->n_type == FLOAT || a->n_type == DOUBLE || a->n_type == LDOUBLE)
-               goto bad;
-
-       tfree(f);
-
-       if (a->n_op == ICON) {
-               if (a->n_lval < 0)
-                       a->n_lval = -a->n_lval;
-               p = a;
-       } else {
-               t = tempnode(0, a->n_type, a->n_df, a->n_sue);
-               tmp1 = regno(t);
-               p = buildtree(ASSIGN, t, a);
-
-               t = tempnode(tmp1, a->n_type, a->n_df, a->n_sue);
-               shift = (int)tsize(a->n_type, a->n_df, a->n_sue) - 1;
-               q = buildtree(RS, t, bcon(shift));
-
-               t2 = tempnode(0, a->n_type, a->n_df, a->n_sue);
-               tmp2 = regno(t2);
-               q = buildtree(ASSIGN, t2, q);
-
-               t = tempnode(tmp1, a->n_type, a->n_df, a->n_sue);
-               t2 = tempnode(tmp2, a->n_type, a->n_df, a->n_sue);
-               t3 = tempnode(tmp2, a->n_type, a->n_df, a->n_sue);
-               r = buildtree(MINUS, buildtree(ER, t, t2), t3);
-
-               p = buildtree(COMOP, p, buildtree(COMOP, q, r));
-       }
-
-       return p;
-
-bad:
-       uerror("bad argument to __builtin_abs");
-       return bcon(0);
-}
-
-#ifndef TARGET_STDARGS
-static NODE *
-builtin_stdarg_start(NODE *f, NODE *a)
-{
-       NODE *p, *q;
-       int sz;
-
-       /* check num args and type */
-       if (a == NULL || a->n_op != CM || a->n_left->n_op == CM ||
-           !ISPTR(a->n_left->n_type))
-               goto bad;
-
-       /* must first deal with argument size; use int size */
-       p = a->n_right;
-       if (p->n_type < INT) {
-               sz = (int)(SZINT/tsize(p->n_type, p->n_df, p->n_sue));
-       } else
-               sz = 1;
-
-       /* do the real job */
-       p = buildtree(ADDROF, p, NIL); /* address of last arg */



Home | Main Index | Thread Index | Old Index