netware-libgcc.def: Update copyright.
authorJan Beulich <jbeulich@novell.com>
Mon, 20 Jun 2005 06:45:27 +0000 (06:45 +0000)
committerJan Beulich <jbeulich@gcc.gnu.org>
Mon, 20 Jun 2005 06:45:27 +0000 (06:45 +0000)
gcc/
2005-06-20  Jan Beulich  <jbeulich@novell.com>

* config/i386/netware-libgcc.def: Update copyright.
* config/i386/netware-libgcc.exp (__divdc3, __divsc3, __divxc3,
__muldc3, __mulsc3, __mulxc3, __powidf2, __powisf2, __powixf2): Add.
* config/i386/netware.c (gen_stdcall_decoration,
gen_fastd_decoration): Merge into ...
(gen_stdcall_or_fastcall_decoration): ... this. Adjust to match
WinNT's changes.
(gen_regparm_prefix): Adjust to match i386_nlm_encode_section_info.
(i386_nlm_encode_section_info): Adjust to match WinNT's changes.
* config/i386/t-nwld (SHLIB_LINK): Also create libgcc.imp alias of
libgcc_s.imp. Use 'expr' rather than $(()) shell expressions.
* gthr-nks.h (__gthread_objc_mutex_allocate): Kill another dubious
use of NX_MUTEX_RECURSIVE.

gcc/testsuite/
2005-06-20  Jan Beulich  <jbeulich@novell.com>

* g++.old-deja/g++.jason/thunk2.C: On NetWare, also account for
unsupportable relocations.
* g++.old-deja/g++.other/store-expr1.C: Likewise.
* gcc.dg/20050321-2.c: xfail for NetWare.

From-SVN: r101203

gcc/ChangeLog
gcc/config/i386/netware-libgcc.def
gcc/config/i386/netware-libgcc.exp
gcc/config/i386/netware.c
gcc/config/i386/t-nwld
gcc/gthr-nks.h
gcc/testsuite/ChangeLog
gcc/testsuite/g++.old-deja/g++.jason/thunk2.C
gcc/testsuite/g++.old-deja/g++.other/store-expr1.C
gcc/testsuite/gcc.dg/20050321-2.c

index d459e07d47d903bf30bb538ed247bfc0b8553aa7..92c4299a1d550399d6107e1ddf762ba2219b5f05 100644 (file)
@@ -1,3 +1,19 @@
+2005-06-20  Jan Beulich  <jbeulich@novell.com>
+
+       * config/i386/netware-libgcc.def: Update copyright.
+       * config/i386/netware-libgcc.exp (__divdc3, __divsc3, __divxc3,
+       __muldc3, __mulsc3, __mulxc3, __powidf2, __powisf2, __powixf2): Add.
+       * config/i386/netware.c (gen_stdcall_decoration,
+       gen_fastd_decoration): Merge into ...
+       (gen_stdcall_or_fastcall_decoration): ... this. Adjust to match
+       WinNT's changes.
+       (gen_regparm_prefix): Adjust to match i386_nlm_encode_section_info.
+       (i386_nlm_encode_section_info): Adjust to match WinNT's changes.
+       * config/i386/t-nwld (SHLIB_LINK): Also create libgcc.imp alias of
+       libgcc_s.imp. Use 'expr' rather than $(()) shell expressions.
+       * gthr-nks.h (__gthread_objc_mutex_allocate): Kill another dubious
+       use of NX_MUTEX_RECURSIVE.
+
 2005-06-19  Roger Sayle  <roger@eyesopen.com>
 
        * fold-const.c (swap_tree_comparison): Add support for unordered
index 5d2ee921b9cbb5965f1b0171976a96cecffb760d..a545631b111474b0e394edfba30b51be1f80d441 100644 (file)
@@ -1,2 +1,2 @@
 description "gcc runtime and intrinsics support"
-copyright "Copyright (C) 1989-2004  Free Software Foundation, Inc."
+copyright "Copyright (C) 1989-2005  Free Software Foundation, Inc."
index dfe11f7861ff18b7915220e1a4bb2cdb2dcdd5d7..a3498c0e7206100f2a47f98772fea017dc3c1456 100644 (file)
        __deregister_frame,
        __deregister_frame_info,
        __deregister_frame_info_bases,
+       __divdc3,
 #      __divdi3,
+       __divsc3,
+#      __divtc3,
+       __divxc3,
        __ffsdi2,
        __ffssi2,
        __fixunsdfdi,
        __gcc_personality_v0,
 #      __lshrdi3,
 #      __moddi3,
+       __muldc3,
 #      __muldi3,
+       __mulsc3,
+#      __multc3,
        __mulvdi3,
        __mulvsi3,
+       __mulxc3,
        __negvdi2,
        __negvsi2,
        __paritydi2,
        __paritysi2,
        __popcountdi2,
        __popcountsi2,
+       __powidf2
+       __powisf2
+#      __powitf2
+       __powixf2
        __register_frame,
        __register_frame_info,
        __register_frame_info_bases,
index 75d8306ba7cf48f26433e0c7002ff9de7e57c28e..f6ab99fc299a0b0cbf1604d0a1381d62d94cdb4e 100644 (file)
@@ -38,86 +38,55 @@ Boston, MA 02111-1307, USA.  */
    underscore prefix and a suffix consisting of an atsign (@) followed
    by the number of bytes of arguments */
 
-static const char *
-gen_stdcall_decoration (tree decl)
+static tree
+gen_stdcall_or_fastcall_decoration (tree decl, char prefix)
 {
   unsigned total = 0;
   /* ??? This probably should use XSTR (XEXP (DECL_RTL (decl), 0), 0) instead
      of DECL_ASSEMBLER_NAME.  */
   const char *asmname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
   char *newsym;
+  tree formal_type = TYPE_ARG_TYPES (TREE_TYPE (decl));
 
-  if (TYPE_ARG_TYPES (TREE_TYPE (decl)))
-    if (TREE_VALUE (tree_last (TYPE_ARG_TYPES (TREE_TYPE (decl))))
-        == void_type_node)
-      {
-       tree formal_type = TYPE_ARG_TYPES (TREE_TYPE (decl));
-
-       /* Quit if we hit an incomplete type.  Error is reported
-          by convert_arguments in c-typeck.c or cp/typeck.c.  */
-       while (TREE_VALUE (formal_type) != void_type_node
-              && COMPLETE_TYPE_P (TREE_VALUE (formal_type)))   
-         {
-           unsigned parm_size
-             = TREE_INT_CST_LOW (TYPE_SIZE (TREE_VALUE (formal_type)));
-           /* Must round up to include padding.  This is done the same
-              way as in store_one_arg.  */
-           parm_size = ((parm_size + PARM_BOUNDARY - 1)
-                        / PARM_BOUNDARY * PARM_BOUNDARY);
-           total += parm_size;
-           formal_type = TREE_CHAIN (formal_type);
-         }
-      }
-
-  newsym = alloca (1 + strlen (asmname) + 1 + 10 + 1);
-  return IDENTIFIER_POINTER (get_identifier_with_length (newsym,
-       sprintf (newsym, "_%s@%u", asmname, total / BITS_PER_UNIT)));
-}
-
-/* Return string which is the former assembler name modified with a
-   prefix consisting of FASTCALL_PREFIX and a suffix consisting of an
-   atsign (@) followed by the number of bytes of arguments.  */
-
-static const char *
-gen_fastcall_decoration (tree decl)
-{
-  unsigned total = 0;
-  const char *asmname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
-  char *newsym;
-
-  if (TYPE_ARG_TYPES (TREE_TYPE (decl)))
-    if (TREE_VALUE (tree_last (TYPE_ARG_TYPES (TREE_TYPE (decl))))
-        == void_type_node)
-      {
-       tree formal_type = TYPE_ARG_TYPES (TREE_TYPE (decl));
-
-       /* Quit if we hit an incomplete type.  Error is reported
-          by convert_arguments in c-typeck.c or cp/typeck.c.  */
-       while (TREE_VALUE (formal_type) != void_type_node
-              && COMPLETE_TYPE_P (TREE_VALUE (formal_type)))   
-         {
-           int parm_size
-             = TREE_INT_CST_LOW (TYPE_SIZE (TREE_VALUE (formal_type)));
-           /* Must round up to include padding.  This is done the same
-              way as in store_one_arg.  */
-           parm_size = ((parm_size + PARM_BOUNDARY - 1)
-                        / PARM_BOUNDARY * PARM_BOUNDARY);
-           total += parm_size;
-           formal_type = TREE_CHAIN (formal_type);
-         }
-      }
+  if (formal_type != NULL_TREE)
+    {
+      /* These attributes are ignored for variadic functions in
+        i386.c:ix86_return_pops_args. For compatibility with MS
+        compiler do not add @0 suffix here.  */ 
+      if (TREE_VALUE (tree_last (formal_type)) != void_type_node)
+       return NULL_TREE;
+
+      /* Quit if we hit an incomplete type.  Error is reported
+        by convert_arguments in c-typeck.c or cp/typeck.c.  */
+      while (TREE_VALUE (formal_type) != void_type_node
+            && COMPLETE_TYPE_P (TREE_VALUE (formal_type)))     
+       {
+         unsigned parm_size
+           = TREE_INT_CST_LOW (TYPE_SIZE (TREE_VALUE (formal_type)));
+
+         /* Must round up to include padding.  This is done the same
+            way as in store_one_arg.  */
+         parm_size = ((parm_size + PARM_BOUNDARY - 1)
+                      / PARM_BOUNDARY * PARM_BOUNDARY);
+         total += parm_size;
+         formal_type = TREE_CHAIN (formal_type);
+       }
+    }
 
   newsym = alloca (1 + strlen (asmname) + 1 + 10 + 1);
-  return IDENTIFIER_POINTER (get_identifier_with_length (newsym,
-       sprintf (newsym, "%c%s@%d", FASTCALL_PREFIX, asmname,
-                total / BITS_PER_UNIT)));
+  return get_identifier_with_length (newsym,
+                                    sprintf (newsym,
+                                             "%c%s@%u",
+                                             prefix,
+                                             asmname,
+                                             total / BITS_PER_UNIT));
 }
 
 /* Return string which is the former assembler name modified with an 
    _n@ prefix where n represents the number of arguments passed in
    registers */
 
-static const char *
+static tree
 gen_regparm_prefix (tree decl, unsigned nregs)
 {
   unsigned total = 0;
@@ -125,35 +94,40 @@ gen_regparm_prefix (tree decl, unsigned nregs)
      of DECL_ASSEMBLER_NAME.  */
   const char *asmname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
   char *newsym;
+  tree formal_type = TYPE_ARG_TYPES (TREE_TYPE (decl));
 
-  if (TYPE_ARG_TYPES (TREE_TYPE (decl)))
-    if (TREE_VALUE (tree_last (TYPE_ARG_TYPES (TREE_TYPE (decl))))
-        == void_type_node)
-      {
-       tree formal_type = TYPE_ARG_TYPES (TREE_TYPE (decl));
-
-       /* Quit if we hit an incomplete type.  Error is reported
-          by convert_arguments in c-typeck.c or cp/typeck.c.  */
-       while (TREE_VALUE (formal_type) != void_type_node
-              && COMPLETE_TYPE_P (TREE_VALUE (formal_type)))   
-         {
-           unsigned parm_size
-             = TREE_INT_CST_LOW (TYPE_SIZE (TREE_VALUE (formal_type)));
-           /* Must round up to include padding.  This is done the same
-              way as in store_one_arg.  */
-           parm_size = ((parm_size + PARM_BOUNDARY - 1)
-                        / PARM_BOUNDARY * PARM_BOUNDARY);
-           total += parm_size;
-           formal_type = TREE_CHAIN (formal_type);
-         }
-      }
+  if (formal_type != NULL_TREE)
+    {
+      /* This attribute is ignored for variadic functions.  */ 
+      if (TREE_VALUE (tree_last (formal_type)) != void_type_node)
+       return NULL_TREE;
+
+      /* Quit if we hit an incomplete type.  Error is reported
+        by convert_arguments in c-typeck.c or cp/typeck.c.  */
+      while (TREE_VALUE (formal_type) != void_type_node
+            && COMPLETE_TYPE_P (TREE_VALUE (formal_type)))     
+       {
+         unsigned parm_size
+           = TREE_INT_CST_LOW (TYPE_SIZE (TREE_VALUE (formal_type)));
+
+         /* Must round up to include padding.  This is done the same
+            way as in store_one_arg.  */
+         parm_size = ((parm_size + PARM_BOUNDARY - 1)
+                      / PARM_BOUNDARY * PARM_BOUNDARY);
+         total += parm_size;
+         formal_type = TREE_CHAIN (formal_type);
+       }
+    }
 
   if (nregs > total / BITS_PER_WORD)
     nregs = total / BITS_PER_WORD;
   gcc_assert (nregs <= 9);
-  newsym = alloca (2 + strlen (asmname) + 1 + 1);
-  return IDENTIFIER_POINTER (get_identifier_with_length (newsym,
-       sprintf (newsym, "_%u@%s", nregs, asmname)));
+  newsym = alloca (3 + strlen (asmname) + 1);
+  return get_identifier_with_length (newsym,
+                                    sprintf (newsym,
+                                             "_%u@%s",
+                                             nregs,
+                                             asmname));
 }
 
 void
@@ -163,24 +137,31 @@ i386_nlm_encode_section_info (tree decl, rtx rtl, int first)
 
   if (first
       && TREE_CODE (decl) == FUNCTION_DECL
-      && *IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)) != '*')
+      && *IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)) != '*'
+      && !strchr (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)), '@'))
     {
       tree type_attributes = TYPE_ATTRIBUTES (TREE_TYPE (decl));
-      rtx rtlname = XEXP (rtl, 0);
-      if (GET_CODE (rtlname) == MEM)
-       rtlname = XEXP (rtlname, 0);
+      tree newid;
+
       if (lookup_attribute ("stdcall", type_attributes))
-       XSTR (rtlname, 0) = gen_stdcall_decoration (decl);
+       newid = gen_stdcall_or_fastcall_decoration (decl, '_');
       else if (lookup_attribute ("fastcall", type_attributes))
-       XSTR (rtlname, 0) = gen_fastcall_decoration (decl);
-      else
+       newid = gen_stdcall_or_fastcall_decoration (decl, FASTCALL_PREFIX);
+      else if ((newid = lookup_attribute ("regparm", type_attributes)) != NULL_TREE)
+       newid = gen_regparm_prefix (decl,
+                     TREE_INT_CST_LOW (TREE_VALUE (TREE_VALUE (newid))));
+      if (newid != NULL_TREE)  
        {
-         tree attr = lookup_attribute ("regparm", type_attributes);
-
-         if (attr)
-           XSTR (rtlname, 0) =
-             gen_regparm_prefix (decl,
-                     TREE_INT_CST_LOW (TREE_VALUE (TREE_VALUE (attr))));
+         rtx rtlname = XEXP (rtl, 0);
+
+         if (GET_CODE (rtlname) == MEM)
+           rtlname = XEXP (rtlname, 0);
+         XSTR (rtlname, 0) = IDENTIFIER_POINTER (newid);
+         /* These attributes must be present on first declaration,
+            change_decl_assembler_name will warn if they are added
+            later and the decl has been referenced, but duplicate_decls
+            should catch the mismatch before this is called.  */ 
+         change_decl_assembler_name (decl, newid);
        }
     }
 }
index 0eff188dfa827438d50ab2e25fe66d1e694f842f..fbca0dfe933585d942e0dbced5d56230b8d8f1f3 100644 (file)
@@ -40,7 +40,7 @@ SHLIB_LINK = set -e; \
        echo "name $(SHLIB_NAME)" >>@shlib_base_name@.def; \
        echo "version $(version)" | sed "s!\.!,!g" >>@shlib_base_name@.def; \
        touch libgcc/build; \
-       echo "build $$$$(($$$$(<libgcc/build)+0))" >>@shlib_base_name@.def; \
+       echo "build $$$$(expr $$$$(<libgcc/build)+0)" >>@shlib_base_name@.def; \
        echo "export @$(SHLIB_MAP)" >>@shlib_base_name@.def; \
        if mpkxdc -n -p @shlib_base_name@.xdc; \
                then echo "xdcdata @shlib_base_name@.xdc" >>@shlib_base_name@.def; \
@@ -50,7 +50,8 @@ SHLIB_LINK = set -e; \
                $(SHLIB_SRC) -posix -static-libgcc -lnetware \
                -Wl,--Map,--map-info,full,--strip-all,--def-file,@shlib_base_name@.def; \
        rm -f @shlib_base_name@.imp; $(LN_S) $(SHLIB_MAP) @shlib_base_name@.imp; \
-       echo $$$$(($$$$(<libgcc/build)+1)) >libgcc/build
+       rm -f libgcc.imp; $(LN_S) @shlib_base_name@.imp libgcc.imp; \
+       expr $$$$(<libgcc/build)+1 >libgcc/build
 
 # $(slibdir) double quoted to protect it from expansion while building
 # libgcc.mk.  We want this delayed until actual install time.
index 39bf199f1db740c5f8084a6f22ca4758136ae3aa..a9ac854c715733c2dd7d7e76958bd111033828f6 100644 (file)
@@ -178,7 +178,7 @@ __gthread_objc_mutex_allocate (objc_mutex_t mutex)
 {
   static const NX_LOCK_INFO_ALLOC (info, "GNU ObjC", 0);
 
-  if ((mutex->backend = NXMutexAlloc (NX_MUTEX_RECURSIVE/*???*/, 0, &info)) == NULL)
+  if ((mutex->backend = NXMutexAlloc (0, 0, &info)) == NULL)
     return 0;
   return -1;
 }
index 9ee49347c89a725d4209903e3cf056585ec53afc..baeae2779a666133aa60a8561e913cfbe86f54c3 100644 (file)
@@ -1,3 +1,10 @@
+2005-06-20  Jan Beulich  <jbeulich@novell.com>
+
+       * g++.old-deja/g++.jason/thunk2.C: On NetWare, also account for
+       unsupportable relocations.
+       * g++.old-deja/g++.other/store-expr1.C: Likewise.
+       * gcc.dg/20050321-2.c: xfail for NetWare.
+
 2005-06-20  Andreas Jaeger  <aj@suse.de>
 
        * gcc.target/i386/sseregparm-1.c, gcc.target/i386/sseregparm-2.c,
index 5694fa1b27007143a7356db6cbe07de69ebe5662..12c6449e9384b50cf00bf05e25a2c90822b049b4 100644 (file)
@@ -1,6 +1,6 @@
 // { dg-do run }
 // { dg-options "-fPIC" }
-// { dg-bogus "\[Uu\]nresolved symbol .(_GLOBAL_OFFSET_TABLE_|\[_.A-Za-z\]\[_.0-9A-Za-z\]*@(PLT|GOT|GOTOFF))" "PIC unsupported" { xfail *-*-netware* } 0 }
+// { dg-bogus "\[Uu\]nresolved symbol .(_GLOBAL_OFFSET_TABLE_|\[_.A-Za-z\]\[_.0-9A-Za-z\]*@(PLT|GOT|GOTOFF))|\[Bb\]ad fixup at .DATA.:" "PIC unsupported" { xfail *-*-netware* } 0 }
 // Test that non-variadic function calls using thunks and PIC work right.
 
 struct A {
index 31c81a02dd33a43b59de38329275f80f67607b3e..c1b19536be84bf91c689032cb752773c368fed8c 100644 (file)
@@ -1,7 +1,7 @@
 // { dg-do run { target i?86-*-* x86_64-*-* } }
 // { dg-require-effective-target ilp32 }
 // { dg-options "-mtune=i686 -O2 -fpic" }
-// { dg-bogus "\[Uu\]nresolved symbol .(_GLOBAL_OFFSET_TABLE_|\[_.A-Za-z\]\[_.0-9A-Za-z\]*@(PLT|GOT|GOTOFF))" "PIC unsupported" { xfail *-*-netware* } 0 }
+// { dg-bogus "\[Uu\]nresolved symbol .(_GLOBAL_OFFSET_TABLE_|\[_.A-Za-z\]\[_.0-9A-Za-z\]*@(PLT|GOT|GOTOFF))|\[Bb\]ad fixup at .DATA.:" "PIC unsupported" { xfail *-*-netware* } 0 }
 class G {};
 
 struct N {
index fcc9d2553fc8c6f07d9c2136a03ef93d1c76ad5f..06d87cc225bba6a0dc10d7d1ec28300ac6a24a29 100644 (file)
@@ -5,6 +5,7 @@
    figure out branch to lab is too far.  */
 /* { dg-do link { target fpic } } */
 /* { dg-options "-g1 -fpic" } */
+/* { dg-bogus "\[Uu\]nresolved symbol .(_GLOBAL_OFFSET_TABLE_|\[_.A-Za-z\]\[_.0-9A-Za-z\]*@(PLT|GOT|GOTOFF))" "PIC unsupported" { xfail *-*-netware* } 0 } */
 
 #define A(n) \
   case n##1: return n##1 * 131 + 63;   \