diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-02-23 07:00:35 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-02-23 07:00:35 +0000 |
commit | 813491d0029a21981f65785cacf0f4229315df5f (patch) | |
tree | 038dd7e767cab757a10ca9400a1952ae841999ce /gcc/config/arm | |
parent | f4618e1c2c649db169baee64b4791fe40205ca7c (diff) | |
download | gcc-813491d0029a21981f65785cacf0f4229315df5f.tar.gz |
2009-02-23 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r144379
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@144380 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/arm')
28 files changed, 143 insertions, 27 deletions
diff --git a/gcc/config/arm/aout.h b/gcc/config/arm/aout.h index 59c1bf70e5d..e9104220feb 100644 --- a/gcc/config/arm/aout.h +++ b/gcc/config/arm/aout.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for ARM with a.out - Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2004, 2007 + Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2004, 2007, 2008 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rearnsha@armltd.co.uk). diff --git a/gcc/config/arm/arm-cores.def b/gcc/config/arm/arm-cores.def index ca868fe2d0c..fba42127225 100644 --- a/gcc/config/arm/arm-cores.def +++ b/gcc/config/arm/arm-cores.def @@ -1,5 +1,6 @@ /* ARM CPU Cores - Copyright (C) 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009 + Free Software Foundation, Inc. Written by CodeSourcery, LLC This file is part of GCC. diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h index ab08ef446f6..8d03141e44b 100644 --- a/gcc/config/arm/arm-protos.h +++ b/gcc/config/arm/arm-protos.h @@ -1,5 +1,5 @@ /* Prototypes for exported functions defined in arm.c and pe.c - Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rearnsha@arm.com) Minor hacks by Nick Clifton (nickc@cygnus.com) diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index ddcdf5a619b..c25fc29e411 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -186,6 +186,9 @@ static void arm_cxx_determine_class_data_visibility (tree); static bool arm_cxx_class_data_always_comdat (void); static bool arm_cxx_use_aeabi_atexit (void); static void arm_init_libfuncs (void); +static tree arm_build_builtin_va_list (void); +static void arm_expand_builtin_va_start (tree, rtx); +static tree arm_gimplify_va_arg_expr (tree, tree, gimple_seq *, gimple_seq *); static bool arm_handle_option (size_t, const char *, int); static void arm_target_help (void); static unsigned HOST_WIDE_INT arm_shift_truncation_mask (enum machine_mode); @@ -383,6 +386,13 @@ static bool arm_allocate_stack_slots_for_args (void); #undef TARGET_MANGLE_TYPE #define TARGET_MANGLE_TYPE arm_mangle_type +#undef TARGET_BUILD_BUILTIN_VA_LIST +#define TARGET_BUILD_BUILTIN_VA_LIST arm_build_builtin_va_list +#undef TARGET_EXPAND_BUILTIN_VA_START +#define TARGET_EXPAND_BUILTIN_VA_START arm_expand_builtin_va_start +#undef TARGET_GIMPLIFY_VA_ARG_EXPR +#define TARGET_GIMPLIFY_VA_ARG_EXPR arm_gimplify_va_arg_expr + #ifdef HAVE_AS_TLS #undef TARGET_ASM_OUTPUT_DWARF_DTPREL #define TARGET_ASM_OUTPUT_DWARF_DTPREL arm_output_dwarf_dtprel @@ -914,6 +924,93 @@ arm_init_libfuncs (void) set_optab_libfunc (umod_optab, SImode, NULL); } +/* On AAPCS systems, this is the "struct __va_list". */ +static GTY(()) tree va_list_type; + +/* Return the type to use as __builtin_va_list. */ +static tree +arm_build_builtin_va_list (void) +{ + tree va_list_name; + tree ap_field; + + if (!TARGET_AAPCS_BASED) + return std_build_builtin_va_list (); + + /* AAPCS \S 7.1.4 requires that va_list be a typedef for a type + defined as: + + struct __va_list + { + void *__ap; + }; + + The C Library ABI further reinforces this definition in \S + 4.1. + + We must follow this definition exactly. The structure tag + name is visible in C++ mangled names, and thus forms a part + of the ABI. The field name may be used by people who + #include <stdarg.h>. */ + /* Create the type. */ + va_list_type = lang_hooks.types.make_type (RECORD_TYPE); + /* Give it the required name. */ + va_list_name = build_decl (TYPE_DECL, + get_identifier ("__va_list"), + va_list_type); + DECL_ARTIFICIAL (va_list_name) = 1; + TYPE_NAME (va_list_type) = va_list_name; + /* Create the __ap field. */ + ap_field = build_decl (FIELD_DECL, + get_identifier ("__ap"), + ptr_type_node); + DECL_ARTIFICIAL (ap_field) = 1; + DECL_FIELD_CONTEXT (ap_field) = va_list_type; + TYPE_FIELDS (va_list_type) = ap_field; + /* Compute its layout. */ + layout_type (va_list_type); + + return va_list_type; +} + +/* Return an expression of type "void *" pointing to the next + available argument in a variable-argument list. VALIST is the + user-level va_list object, of type __builtin_va_list. */ +static tree +arm_extract_valist_ptr (tree valist) +{ + if (TREE_TYPE (valist) == error_mark_node) + return error_mark_node; + + /* On an AAPCS target, the pointer is stored within "struct + va_list". */ + if (TARGET_AAPCS_BASED) + { + tree ap_field = TYPE_FIELDS (TREE_TYPE (valist)); + valist = build3 (COMPONENT_REF, TREE_TYPE (ap_field), + valist, ap_field, NULL_TREE); + } + + return valist; +} + +/* Implement TARGET_EXPAND_BUILTIN_VA_START. */ +static void +arm_expand_builtin_va_start (tree valist, rtx nextarg) +{ + valist = arm_extract_valist_ptr (valist); + std_expand_builtin_va_start (valist, nextarg); +} + +/* Implement TARGET_GIMPLIFY_VA_ARG_EXPR. */ +static tree +arm_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p, + gimple_seq *post_p) +{ + valist = arm_extract_valist_ptr (valist); + return std_gimplify_va_arg_expr (valist, type, pre_p, post_p); +} + /* Implement TARGET_HANDLE_OPTION. */ static bool @@ -19506,6 +19603,21 @@ arm_mangle_type (const_tree type) { arm_mangle_map_entry *pos = arm_mangle_map; + /* The ARM ABI documents (10th October 2008) say that "__va_list" + has to be managled as if it is in the "std" namespace. */ + if (TARGET_AAPCS_BASED + && lang_hooks.types_compatible_p (CONST_CAST_TREE (type), va_list_type)) + { + static bool warned; + if (!warned && warn_psabi) + { + warned = true; + inform (input_location, + "the mangling of %<va_list%> has changed in GCC 4.4"); + } + return "St9__va_list"; + } + if (TREE_CODE (type) != VECTOR_TYPE) return NULL; diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index fb636f3d540..7788793b300 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for ARM. Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 + 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl) and Martin Simmons (@harleqn.co.uk). diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 4eccd734b82..3128094f061 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -1,6 +1,6 @@ ;;- Machine description for ARM for GNU compiler ;; Copyright 1991, 1993, 1994, 1995, 1996, 1996, 1997, 1998, 1999, 2000, -;; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +;; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 ;; Free Software Foundation, Inc. ;; Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl) ;; and Martin Simmons (@harleqn.co.uk). diff --git a/gcc/config/arm/arm.opt b/gcc/config/arm/arm.opt index 1d07cedf0de..6aca3950db5 100644 --- a/gcc/config/arm/arm.opt +++ b/gcc/config/arm/arm.opt @@ -1,6 +1,6 @@ ; Options for the ARM port of the compiler. -; Copyright (C) 2005, 2007 Free Software Foundation, Inc. +; Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc. ; ; This file is part of GCC. ; diff --git a/gcc/config/arm/arm1020e.md b/gcc/config/arm/arm1020e.md index 397ddd5f97c..280af12f932 100644 --- a/gcc/config/arm/arm1020e.md +++ b/gcc/config/arm/arm1020e.md @@ -1,5 +1,5 @@ ;; ARM 1020E & ARM 1022E Pipeline Description -;; Copyright (C) 2005, 2007 Free Software Foundation, Inc. +;; Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc. ;; Contributed by Richard Earnshaw (richard.earnshaw@arm.com) ;; ;; This file is part of GCC. diff --git a/gcc/config/arm/bpabi.S b/gcc/config/arm/bpabi.S index 82ca140a6bc..2900219d2f6 100644 --- a/gcc/config/arm/bpabi.S +++ b/gcc/config/arm/bpabi.S @@ -1,6 +1,6 @@ /* Miscellaneous BPABI functions. - Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2007, 2008 Free Software Foundation, Inc. Contributed by CodeSourcery, LLC. This file is free software; you can redistribute it and/or modify it diff --git a/gcc/config/arm/bpabi.h b/gcc/config/arm/bpabi.h index bbd58da4d42..4d2974e32da 100644 --- a/gcc/config/arm/bpabi.h +++ b/gcc/config/arm/bpabi.h @@ -1,5 +1,5 @@ /* Configuration file for ARM BPABI targets. - Copyright (C) 2004, 2005, 2007, 2008 + Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc. Contributed by CodeSourcery, LLC diff --git a/gcc/config/arm/constraints.md b/gcc/config/arm/constraints.md index a671eb05823..0c8fa733f75 100644 --- a/gcc/config/arm/constraints.md +++ b/gcc/config/arm/constraints.md @@ -1,5 +1,5 @@ ;; Constraint definitions for ARM and Thumb -;; Copyright (C) 2006, 2007 Free Software Foundation, Inc. +;; Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc. ;; Contributed by ARM Ltd. ;; This file is part of GCC. diff --git a/gcc/config/arm/cortex-a8-neon.md b/gcc/config/arm/cortex-a8-neon.md index 93453b618db..10b335c3005 100644 --- a/gcc/config/arm/cortex-a8-neon.md +++ b/gcc/config/arm/cortex-a8-neon.md @@ -1,5 +1,5 @@ ;; ARM Cortex-A8 NEON scheduling description. -;; Copyright (C) 2007 Free Software Foundation, Inc. +;; Copyright (C) 2007, 2008 Free Software Foundation, Inc. ;; Contributed by CodeSourcery. ;; This file is part of GCC. diff --git a/gcc/config/arm/crti.asm b/gcc/config/arm/crti.asm index c77651a5191..a81b377d9b7 100644 --- a/gcc/config/arm/crti.asm +++ b/gcc/config/arm/crti.asm @@ -1,4 +1,4 @@ -# Copyright (C) 2001 Free Software Foundation, Inc. +# Copyright (C) 2001, 2008 Free Software Foundation, Inc. # Written By Nick Clifton # # This file is free software; you can redistribute it and/or modify it diff --git a/gcc/config/arm/crtn.asm b/gcc/config/arm/crtn.asm index 34b95d943d9..50143550400 100644 --- a/gcc/config/arm/crtn.asm +++ b/gcc/config/arm/crtn.asm @@ -1,4 +1,4 @@ -# Copyright (C) 2001, 2004 Free Software Foundation, Inc. +# Copyright (C) 2001, 2004, 2008 Free Software Foundation, Inc. # Written By Nick Clifton # # This file is free software; you can redistribute it and/or modify it diff --git a/gcc/config/arm/iwmmxt.md b/gcc/config/arm/iwmmxt.md index 668172f8407..5567e1a700d 100644 --- a/gcc/config/arm/iwmmxt.md +++ b/gcc/config/arm/iwmmxt.md @@ -1,6 +1,6 @@ ;; ??? This file needs auditing for thumb2 ;; Patterns for the Intel Wireless MMX technology architecture. -;; Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. ;; Contributed by Red Hat. ;; This file is part of GCC. diff --git a/gcc/config/arm/linux-atomic.c b/gcc/config/arm/linux-atomic.c index ac0b4d6d14b..c51466e1c39 100644 --- a/gcc/config/arm/linux-atomic.c +++ b/gcc/config/arm/linux-atomic.c @@ -1,5 +1,5 @@ /* Linux-specific atomic operations for ARM EABI. - Copyright (C) 2008 Free Software Foundation, Inc. + Copyright (C) 2008, 2009 Free Software Foundation, Inc. Contributed by CodeSourcery. This file is part of GCC. diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h index 7036e71f8b3..07455ee87fd 100644 --- a/gcc/config/arm/linux-elf.h +++ b/gcc/config/arm/linux-elf.h @@ -1,6 +1,6 @@ /* Definitions for ARM running Linux-based GNU systems using ELF Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007 + 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Contributed by Philip Blundell <philb@gnu.org> diff --git a/gcc/config/arm/neon.md b/gcc/config/arm/neon.md index dbbd209f79c..ab69ab08035 100644 --- a/gcc/config/arm/neon.md +++ b/gcc/config/arm/neon.md @@ -1,5 +1,5 @@ ;; ARM NEON coprocessor Machine Description -;; Copyright (C) 2006, 2007 Free Software Foundation, Inc. +;; Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. ;; Written by CodeSourcery. ;; ;; This file is part of GCC. diff --git a/gcc/config/arm/netbsd.h b/gcc/config/arm/netbsd.h index d9d39bd1466..4b8de79a4d4 100644 --- a/gcc/config/arm/netbsd.h +++ b/gcc/config/arm/netbsd.h @@ -1,5 +1,5 @@ /* NetBSD/arm a.out version. - Copyright (C) 1993, 1994, 1997, 1998, 2003, 2004, 2005, 2007 + Copyright (C) 1993, 1994, 1997, 1998, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. Contributed by Mark Brinicombe (amb@physig.ph.kcl.ac.uk) diff --git a/gcc/config/arm/pe.c b/gcc/config/arm/pe.c index 8b8adff0e14..365648c607c 100644 --- a/gcc/config/arm/pe.c +++ b/gcc/config/arm/pe.c @@ -1,5 +1,5 @@ /* Routines for GCC for ARM/pe. - Copyright (C) 1995, 1996, 2000, 2001, 2002, 2004, 2005, 2007 + Copyright (C) 1995, 1996, 2000, 2001, 2002, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. Contributed by Doug Evans (dje@cygnus.com). diff --git a/gcc/config/arm/predicates.md b/gcc/config/arm/predicates.md index 48e697fa9e4..c7d63355d34 100644 --- a/gcc/config/arm/predicates.md +++ b/gcc/config/arm/predicates.md @@ -1,5 +1,5 @@ ;; Predicate definitions for ARM and Thumb -;; Copyright (C) 2004, 2007 Free Software Foundation, Inc. +;; Copyright (C) 2004, 2007, 2008 Free Software Foundation, Inc. ;; Contributed by ARM Ltd. ;; This file is part of GCC. diff --git a/gcc/config/arm/rtems-elf.h b/gcc/config/arm/rtems-elf.h index ebeeed36a90..ee8c118112a 100644 --- a/gcc/config/arm/rtems-elf.h +++ b/gcc/config/arm/rtems-elf.h @@ -1,5 +1,5 @@ /* Definitions for RTEMS based ARM systems using ELF - Copyright (C) 2000, 2002, 2005, 2007 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2005, 2007, 2008 Free Software Foundation, Inc. This file is part of GCC. diff --git a/gcc/config/arm/symbian.h b/gcc/config/arm/symbian.h index af92c72b7ba..ff233a89faa 100644 --- a/gcc/config/arm/symbian.h +++ b/gcc/config/arm/symbian.h @@ -1,5 +1,5 @@ /* Configuration file for Symbian OS on ARM processors. - Copyright (C) 2004, 2005, 2007 + Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. Contributed by CodeSourcery, LLC diff --git a/gcc/config/arm/uclinux-eabi.h b/gcc/config/arm/uclinux-eabi.h index 5ba97bf591b..4455288b88e 100644 --- a/gcc/config/arm/uclinux-eabi.h +++ b/gcc/config/arm/uclinux-eabi.h @@ -1,5 +1,5 @@ /* Definitions for ARM EABI ucLinux - Copyright (C) 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc. Contributed by Paul Brook <paul@codesourcery.com> This file is part of GCC. diff --git a/gcc/config/arm/uclinux-elf.h b/gcc/config/arm/uclinux-elf.h index 89b96f257ba..50fd7658096 100644 --- a/gcc/config/arm/uclinux-elf.h +++ b/gcc/config/arm/uclinux-elf.h @@ -1,5 +1,6 @@ /* Definitions for ARM running ucLinux using ELF - Copyright (C) 1999, 2001, 2004, 2005, 2007 Free Software Foundation, Inc. + Copyright (C) 1999, 2001, 2004, 2005, 2007, 2008 + Free Software Foundation, Inc. Contributed by Philip Blundell <pb@nexus.co.uk> This file is part of GCC. diff --git a/gcc/config/arm/unknown-elf.h b/gcc/config/arm/unknown-elf.h index 331e40a1ece..6f5839a4537 100644 --- a/gcc/config/arm/unknown-elf.h +++ b/gcc/config/arm/unknown-elf.h @@ -1,5 +1,5 @@ /* Definitions for non-Linux based ARM systems using ELF - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007 + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc. Contributed by Catherine Moore <clm@cygnus.com> diff --git a/gcc/config/arm/unwind-arm.h b/gcc/config/arm/unwind-arm.h index f6d3dc15fdd..957ff00272a 100644 --- a/gcc/config/arm/unwind-arm.h +++ b/gcc/config/arm/unwind-arm.h @@ -1,5 +1,6 @@ /* Header file for the ARM EABI unwinder - Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 + Free Software Foundation, Inc. Contributed by Paul Brook This file is free software; you can redistribute it and/or modify it diff --git a/gcc/config/arm/vxworks.h b/gcc/config/arm/vxworks.h index a7610acca5d..8879fedb7d7 100644 --- a/gcc/config/arm/vxworks.h +++ b/gcc/config/arm/vxworks.h @@ -1,6 +1,7 @@ /* Definitions of target machine for GCC, for ARM with targetting the VXWorks run time environment. - Copyright (C) 1999, 2000, 2003, 2004, 2007 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2003, 2004, 2007, 2008 + Free Software Foundation, Inc. Contributed by: Mike Stump <mrs@wrs.com> Brought up to date by CodeSourcery, LLC. |