comparison gcc/system.h @ 55:77e2b8dfacca gcc-4.4.5

update it from 4.4.3 to 4.5.0
author ryoma <e075725@ie.u-ryukyu.ac.jp>
date Fri, 12 Feb 2010 23:39:51 +0900
parents a06113de4d67
children b7f97abdc517
comparison
equal deleted inserted replaced
52:c156f1bd5cd9 55:77e2b8dfacca
1 /* Get common system includes and various definitions and declarations based 1 /* Get common system includes and various definitions and declarations based
2 on autoconf macros. 2 on autoconf macros.
3 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008 3 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008,
4 2009
4 Free Software Foundation, Inc. 5 Free Software Foundation, Inc.
5 6
6 This file is part of GCC. 7 This file is part of GCC.
7 8
8 GCC is free software; you can redistribute it and/or modify it under 9 GCC is free software; you can redistribute it and/or modify it under
44 #ifndef NULL 45 #ifndef NULL
45 #define NULL 0 46 #define NULL 0
46 #endif 47 #endif
47 48
48 /* Use the unlocked open routines from libiberty. */ 49 /* Use the unlocked open routines from libiberty. */
50 #ifdef fopen /* fopen is a #define on VMS. */
51 #undef fopen
52 #endif
49 #define fopen(PATH,MODE) fopen_unlocked(PATH,MODE) 53 #define fopen(PATH,MODE) fopen_unlocked(PATH,MODE)
50 #define fdopen(FILDES,MODE) fdopen_unlocked(FILDES,MODE) 54 #define fdopen(FILDES,MODE) fdopen_unlocked(FILDES,MODE)
51 #define freopen(PATH,MODE,STREAM) freopen_unlocked(PATH,MODE,STREAM) 55 #define freopen(PATH,MODE,STREAM) freopen_unlocked(PATH,MODE,STREAM)
52 56
53 /* The compiler is not a multi-threaded application and therefore we 57 /* The compiler is not a multi-threaded application and therefore we
408 412
409 #if defined (HAVE_DECL_REALLOC) && !HAVE_DECL_REALLOC 413 #if defined (HAVE_DECL_REALLOC) && !HAVE_DECL_REALLOC
410 extern void *realloc (void *, size_t); 414 extern void *realloc (void *, size_t);
411 #endif 415 #endif
412 416
417 #ifdef HAVE_STDINT_H
418 #include <stdint.h>
419 #endif
420
421 #ifdef HAVE_INTTYPES_H
422 #include <inttypes.h>
423 #endif
424
413 /* If the system doesn't provide strsignal, we get it defined in 425 /* If the system doesn't provide strsignal, we get it defined in
414 libiberty but no declaration is supplied. */ 426 libiberty but no declaration is supplied. */
415 #if !defined (HAVE_STRSIGNAL) \ 427 #if !defined (HAVE_STRSIGNAL) \
416 || (defined (HAVE_DECL_STRSIGNAL) && !HAVE_DECL_STRSIGNAL) 428 || (defined (HAVE_DECL_STRSIGNAL) && !HAVE_DECL_STRSIGNAL)
417 # ifndef strsignal 429 # ifndef strsignal
450 #endif 462 #endif
451 463
452 /* 1 if we have C99 designated initializers. */ 464 /* 1 if we have C99 designated initializers. */
453 #if !defined(HAVE_DESIGNATED_INITIALIZERS) 465 #if !defined(HAVE_DESIGNATED_INITIALIZERS)
454 #define HAVE_DESIGNATED_INITIALIZERS \ 466 #define HAVE_DESIGNATED_INITIALIZERS \
455 ((GCC_VERSION >= 2007) || (__STDC_VERSION__ >= 199901L)) 467 (((GCC_VERSION >= 2007) || (__STDC_VERSION__ >= 199901L)) \
468 && !defined(__cplusplus))
456 #endif 469 #endif
457 470
458 #if HAVE_SYS_STAT_H 471 #if HAVE_SYS_STAT_H
459 # include <sys/stat.h> 472 # include <sys/stat.h>
460 #endif 473 #endif
511 /* Some systems have mkdir that takes a single argument. */ 524 /* Some systems have mkdir that takes a single argument. */
512 #ifdef MKDIR_TAKES_ONE_ARG 525 #ifdef MKDIR_TAKES_ONE_ARG
513 # define mkdir(a,b) mkdir(a) 526 # define mkdir(a,b) mkdir(a)
514 #endif 527 #endif
515 528
529 /* Provide a way to print an address via printf. */
530 #ifndef HOST_PTR_PRINTF
531 #define HOST_PTR_PRINTF "%p"
532 #endif /* ! HOST_PTR_PRINTF */
533
516 /* By default, colon separates directories in a path. */ 534 /* By default, colon separates directories in a path. */
517 #ifndef PATH_SEPARATOR 535 #ifndef PATH_SEPARATOR
518 #define PATH_SEPARATOR ':' 536 #define PATH_SEPARATOR ':'
519 #endif 537 #endif
520 538
573 591
574 /* Use gcc_assert(EXPR) to test invariants. */ 592 /* Use gcc_assert(EXPR) to test invariants. */
575 #if ENABLE_ASSERT_CHECKING 593 #if ENABLE_ASSERT_CHECKING
576 #define gcc_assert(EXPR) \ 594 #define gcc_assert(EXPR) \
577 ((void)(!(EXPR) ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0)) 595 ((void)(!(EXPR) ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0))
596 #elif (GCC_VERSION >= 4005)
597 #define gcc_assert(EXPR) \
598 ((void)(__builtin_expect(!(EXPR), 0) ? __builtin_unreachable(), 0 : 0))
578 #else 599 #else
579 /* Include EXPR, so that unused variable warnings do not occur. */ 600 /* Include EXPR, so that unused variable warnings do not occur. */
580 #define gcc_assert(EXPR) ((void)(0 && (EXPR))) 601 #define gcc_assert(EXPR) ((void)(0 && (EXPR)))
581 #endif 602 #endif
582 603
583 /* Use gcc_unreachable() to mark unreachable locations (like an 604 /* Use gcc_unreachable() to mark unreachable locations (like an
584 unreachable default case of a switch. Do not use gcc_assert(0). */ 605 unreachable default case of a switch. Do not use gcc_assert(0). */
606 #if (GCC_VERSION >= 4005) && !ENABLE_ASSERT_CHECKING
607 #define gcc_unreachable() __builtin_unreachable()
608 #else
585 #define gcc_unreachable() (fancy_abort (__FILE__, __LINE__, __FUNCTION__)) 609 #define gcc_unreachable() (fancy_abort (__FILE__, __LINE__, __FUNCTION__))
610 #endif
586 611
587 /* Provide a fake boolean type. We make no attempt to use the 612 /* Provide a fake boolean type. We make no attempt to use the
588 C99 _Bool, as it may not be available in the bootstrap compiler, 613 C99 _Bool, as it may not be available in the bootstrap compiler,
589 and even if it is, it is liable to be buggy. 614 and even if it is, it is liable to be buggy.
590 This must be after all inclusion of system headers, as some of 615 This must be after all inclusion of system headers, as some of
670 ASM_SIMPLIFY_DWARF_ADDR INIT_TARGET_OPTABS INIT_SUBTARGET_OPTABS \ 695 ASM_SIMPLIFY_DWARF_ADDR INIT_TARGET_OPTABS INIT_SUBTARGET_OPTABS \
671 INIT_GOFAST_OPTABS MULSI3_LIBCALL MULDI3_LIBCALL DIVSI3_LIBCALL \ 696 INIT_GOFAST_OPTABS MULSI3_LIBCALL MULDI3_LIBCALL DIVSI3_LIBCALL \
672 DIVDI3_LIBCALL UDIVSI3_LIBCALL UDIVDI3_LIBCALL MODSI3_LIBCALL \ 697 DIVDI3_LIBCALL UDIVSI3_LIBCALL UDIVDI3_LIBCALL MODSI3_LIBCALL \
673 MODDI3_LIBCALL UMODSI3_LIBCALL UMODDI3_LIBCALL BUILD_VA_LIST_TYPE \ 698 MODDI3_LIBCALL UMODSI3_LIBCALL UMODDI3_LIBCALL BUILD_VA_LIST_TYPE \
674 PRETEND_OUTGOING_VARARGS_NAMED STRUCT_VALUE_INCOMING_REGNUM \ 699 PRETEND_OUTGOING_VARARGS_NAMED STRUCT_VALUE_INCOMING_REGNUM \
675 ASM_OUTPUT_SECTION_NAME PROMOTE_FUNCTION_ARGS \ 700 ASM_OUTPUT_SECTION_NAME PROMOTE_FUNCTION_ARGS PROMOTE_FUNCTION_MODE \
676 STRUCT_VALUE_INCOMING STRICT_ARGUMENT_NAMING \ 701 STRUCT_VALUE_INCOMING STRICT_ARGUMENT_NAMING \
677 PROMOTE_FUNCTION_RETURN PROMOTE_PROTOTYPES STRUCT_VALUE_REGNUM \ 702 PROMOTE_FUNCTION_RETURN PROMOTE_PROTOTYPES STRUCT_VALUE_REGNUM \
678 SETUP_INCOMING_VARARGS EXPAND_BUILTIN_SAVEREGS \ 703 SETUP_INCOMING_VARARGS EXPAND_BUILTIN_SAVEREGS \
679 DEFAULT_SHORT_ENUMS SPLIT_COMPLEX_ARGS MD_ASM_CLOBBERS \ 704 DEFAULT_SHORT_ENUMS SPLIT_COMPLEX_ARGS MD_ASM_CLOBBERS \
680 HANDLE_PRAGMA_REDEFINE_EXTNAME HANDLE_PRAGMA_EXTERN_PREFIX \ 705 HANDLE_PRAGMA_REDEFINE_EXTNAME HANDLE_PRAGMA_EXTERN_PREFIX \
681 MUST_PASS_IN_STACK FUNCTION_ARG_PASS_BY_REFERENCE \ 706 MUST_PASS_IN_STACK FUNCTION_ARG_PASS_BY_REFERENCE \
682 VECTOR_MODE_SUPPORTED_P TARGET_SUPPORTS_HIDDEN \ 707 VECTOR_MODE_SUPPORTED_P TARGET_SUPPORTS_HIDDEN \
683 FUNCTION_ARG_PARTIAL_NREGS ASM_OUTPUT_DWARF_DTPREL \ 708 FUNCTION_ARG_PARTIAL_NREGS ASM_OUTPUT_DWARF_DTPREL \
684 ALLOCATE_INITIAL_VALUE 709 ALLOCATE_INITIAL_VALUE LEGITIMIZE_ADDRESS FRAME_POINTER_REQUIRED \
710 CAN_ELIMINATE TRAMPOLINE_TEMPLATE INITIALIZE_TRAMPOLINE \
711 TRAMPOLINE_ADJUST_ADDRESS STATIC_CHAIN STATIC_CHAIN_INCOMING
685 712
686 /* Other obsolete target macros, or macros that used to be in target 713 /* Other obsolete target macros, or macros that used to be in target
687 headers and were not used, and may be obsolete or may never have 714 headers and were not used, and may be obsolete or may never have
688 been used. */ 715 been used. */
689 #pragma GCC poison INT_ASM_OP ASM_OUTPUT_EH_REGION_BEG CPP_PREDEFINES \ 716 #pragma GCC poison INT_ASM_OP ASM_OUTPUT_EH_REGION_BEG CPP_PREDEFINES \
727 NON_SAVING_SETJMP TARGET_LATE_RTL_PROLOGUE_EPILOGUE \ 754 NON_SAVING_SETJMP TARGET_LATE_RTL_PROLOGUE_EPILOGUE \
728 CASE_DROPS_THROUGH TARGET_BELL TARGET_BS TARGET_CR TARGET_DIGIT0 \ 755 CASE_DROPS_THROUGH TARGET_BELL TARGET_BS TARGET_CR TARGET_DIGIT0 \
729 TARGET_ESC TARGET_FF TARGET_NEWLINE TARGET_TAB TARGET_VT \ 756 TARGET_ESC TARGET_FF TARGET_NEWLINE TARGET_TAB TARGET_VT \
730 LINK_LIBGCC_SPECIAL DONT_ACCESS_GBLS_AFTER_EPILOGUE \ 757 LINK_LIBGCC_SPECIAL DONT_ACCESS_GBLS_AFTER_EPILOGUE \
731 TARGET_OPTIONS TARGET_SWITCHES EXTRA_CC_MODES FINALIZE_PIC \ 758 TARGET_OPTIONS TARGET_SWITCHES EXTRA_CC_MODES FINALIZE_PIC \
732 PREDICATE_CODES SPECIAL_MODE_PREDICATES HOST_PTR_PRINTF \ 759 PREDICATE_CODES SPECIAL_MODE_PREDICATES UNALIGNED_WORD_ASM_OP \
733 EXTRA_SECTIONS EXTRA_SECTION_FUNCTIONS READONLY_DATA_SECTION \ 760 EXTRA_SECTIONS EXTRA_SECTION_FUNCTIONS READONLY_DATA_SECTION \
734 TARGET_ASM_EXCEPTION_SECTION TARGET_ASM_EH_FRAME_SECTION \ 761 TARGET_ASM_EXCEPTION_SECTION TARGET_ASM_EH_FRAME_SECTION \
735 SMALL_ARG_MAX ASM_OUTPUT_SHARED_BSS ASM_OUTPUT_SHARED_COMMON \ 762 SMALL_ARG_MAX ASM_OUTPUT_SHARED_BSS ASM_OUTPUT_SHARED_COMMON \
736 ASM_OUTPUT_SHARED_LOCAL UNALIGNED_WORD_ASM_OP \ 763 ASM_OUTPUT_SHARED_LOCAL ASM_MAKE_LABEL_LINKONCE \
737 ASM_MAKE_LABEL_LINKONCE 764 STACK_CHECK_PROBE_INTERVAL STACK_CHECK_PROBE_LOAD
738 765
739 /* Hooks that are no longer used. */ 766 /* Hooks that are no longer used. */
740 #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \ 767 #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \
741 LANG_HOOKS_MARK_TREE LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES \ 768 LANG_HOOKS_MARK_TREE LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES \
742 LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS \ 769 LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS \
743 LANG_HOOKS_PUSHLEVEL LANG_HOOKS_SET_BLOCK \ 770 LANG_HOOKS_PUSHLEVEL LANG_HOOKS_SET_BLOCK \
744 LANG_HOOKS_MAYBE_BUILD_CLEANUP LANG_HOOKS_UPDATE_DECL_AFTER_SAVING \ 771 LANG_HOOKS_MAYBE_BUILD_CLEANUP LANG_HOOKS_UPDATE_DECL_AFTER_SAVING \
745 LANG_HOOKS_POPLEVEL LANG_HOOKS_TRUTHVALUE_CONVERSION 772 LANG_HOOKS_POPLEVEL LANG_HOOKS_TRUTHVALUE_CONVERSION \
773 TARGET_PROMOTE_FUNCTION_ARGS TARGET_PROMOTE_FUNCTION_RETURN
746 774
747 /* Miscellaneous macros that are no longer used. */ 775 /* Miscellaneous macros that are no longer used. */
748 #pragma GCC poison USE_MAPPED_LOCATION 776 #pragma GCC poison USE_MAPPED_LOCATION
749 777
750 /* Libiberty macros that are no longer used in GCC. */ 778 /* Libiberty macros that are no longer used in GCC. */
784 modify its argument and the return value is only used in a const 812 modify its argument and the return value is only used in a const
785 context. (This can be somewhat dangerous as these assumptions can 813 context. (This can be somewhat dangerous as these assumptions can
786 change after the fact). Beyond these uses, most other cases of 814 change after the fact). Beyond these uses, most other cases of
787 using this macro should be viewed with extreme caution. */ 815 using this macro should be viewed with extreme caution. */
788 816
817 #ifdef __cplusplus
818 #define CONST_CAST2(TOTYPE,FROMTYPE,X) (const_cast<TOTYPE> (X))
819 #else
789 #if defined(__GNUC__) && GCC_VERSION > 4000 820 #if defined(__GNUC__) && GCC_VERSION > 4000
790 /* GCC 4.0.x has a bug where it may ICE on this expression, 821 /* GCC 4.0.x has a bug where it may ICE on this expression,
791 so does GCC 3.4.x (PR17436). */ 822 so does GCC 3.4.x (PR17436). */
792 #define CONST_CAST2(TOTYPE,FROMTYPE,X) ((__extension__(union {FROMTYPE _q; TOTYPE _nq;})(X))._nq) 823 #define CONST_CAST2(TOTYPE,FROMTYPE,X) ((__extension__(union {FROMTYPE _q; TOTYPE _nq;})(X))._nq)
793 #else 824 #else
794 #define CONST_CAST2(TOTYPE,FROMTYPE,X) ((TOTYPE)(FROMTYPE)(X)) 825 #define CONST_CAST2(TOTYPE,FROMTYPE,X) ((TOTYPE)(FROMTYPE)(X))
826 #endif
795 #endif 827 #endif
796 #define CONST_CAST(TYPE,X) CONST_CAST2(TYPE, const TYPE, (X)) 828 #define CONST_CAST(TYPE,X) CONST_CAST2(TYPE, const TYPE, (X))
797 #define CONST_CAST_TREE(X) CONST_CAST(union tree_node *, (X)) 829 #define CONST_CAST_TREE(X) CONST_CAST(union tree_node *, (X))
798 #define CONST_CAST_RTX(X) CONST_CAST(struct rtx_def *, (X)) 830 #define CONST_CAST_RTX(X) CONST_CAST(struct rtx_def *, (X))
799 #define CONST_CAST_BB(X) CONST_CAST(struct basic_block_def *, (X)) 831 #define CONST_CAST_BB(X) CONST_CAST(struct basic_block_def *, (X))