This commit was generated by cvs2svn to compensate for changes in r107590,
which included commits to RCS files with non-trunk default branches.
This commit is contained in:
commit
908ab21d03
19234
contrib/gcc/ChangeLog
19234
contrib/gcc/ChangeLog
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
/* Alias analysis for GNU C
|
||||
Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
Contributed by John Carr (jfc@mit.edu).
|
||||
|
||||
This file is part of GCC.
|
||||
@ -321,8 +321,8 @@ objects_must_conflict_p (t1, t2)
|
||||
then they may not conflict. */
|
||||
if ((t1 != 0 && readonly_fields_p (t1))
|
||||
|| (t2 != 0 && readonly_fields_p (t2))
|
||||
|| (t1 != 0 && TYPE_READONLY (t1))
|
||||
|| (t2 != 0 && TYPE_READONLY (t2)))
|
||||
|| (t1 != 0 && lang_hooks.honor_readonly && TYPE_READONLY (t1))
|
||||
|| (t2 != 0 && lang_hooks.honor_readonly && TYPE_READONLY (t2)))
|
||||
return 0;
|
||||
|
||||
/* If they are the same type, they must conflict. */
|
||||
|
@ -131,6 +131,22 @@ inline_forbidden_p (nodep, walk_subtrees, fn)
|
||||
|
||||
break;
|
||||
|
||||
case RECORD_TYPE:
|
||||
case UNION_TYPE:
|
||||
/* We cannot inline a function of the form
|
||||
|
||||
void F (int i) { struct S { int ar[i]; } s; }
|
||||
|
||||
Attempting to do so produces a catch-22 in tree-inline.c.
|
||||
If walk_tree examines the TYPE_FIELDS chain of RECORD_TYPE/
|
||||
UNION_TYPE nodes, then it goes into infinite recursion on a
|
||||
structure containing a pointer to its own type. If it doesn't,
|
||||
then the type node for S doesn't get adjusted properly when
|
||||
F is inlined, and we abort in find_function_data. */
|
||||
for (t = TYPE_FIELDS (node); t; t = TREE_CHAIN (t))
|
||||
if (variably_modified_type_p (TREE_TYPE (t)))
|
||||
return node;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -1527,6 +1527,7 @@ initelt:
|
||||
if (pedantic)
|
||||
pedwarn ("obsolete use of designated initializer with `:'"); }
|
||||
initval
|
||||
{}
|
||||
| initval
|
||||
;
|
||||
|
||||
@ -2700,12 +2701,14 @@ classdecl:
|
||||
{
|
||||
objc_declare_class ($2);
|
||||
}
|
||||
;
|
||||
|
||||
aliasdecl:
|
||||
ALIAS identifier identifier ';'
|
||||
{
|
||||
objc_declare_alias ($2, $3);
|
||||
}
|
||||
;
|
||||
|
||||
classdef:
|
||||
INTERFACE identifier protocolrefs '{'
|
||||
|
@ -46,9 +46,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
|
||||
#ifdef PUSH_ROUNDING
|
||||
|
||||
#ifndef PUSH_ARGS_REVERSED
|
||||
#if defined (STACK_GROWS_DOWNWARD) != defined (ARGS_GROW_DOWNWARD)
|
||||
#define PUSH_ARGS_REVERSED PUSH_ARGS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@ -2708,6 +2710,12 @@ expand_call (exp, target, ignore)
|
||||
if (pass == 0)
|
||||
{
|
||||
argblock = virtual_incoming_args_rtx;
|
||||
argblock
|
||||
#ifdef STACK_GROWS_DOWNWARD
|
||||
= plus_constant (argblock, current_function_pretend_args_size);
|
||||
#else
|
||||
= plus_constant (argblock, -current_function_pretend_args_size);
|
||||
#endif
|
||||
stored_args_map = sbitmap_alloc (args_size.constant);
|
||||
sbitmap_zero (stored_args_map);
|
||||
}
|
||||
@ -4276,7 +4284,7 @@ store_one_arg (arg, argblock, flags, variable_size, reg_parm_stack_space)
|
||||
struct arg_data *arg;
|
||||
rtx argblock;
|
||||
int flags;
|
||||
int variable_size ATTRIBUTE_UNUSED;
|
||||
int variable_size;
|
||||
int reg_parm_stack_space;
|
||||
{
|
||||
tree pval = arg->tree_value;
|
||||
@ -4351,14 +4359,22 @@ store_one_arg (arg, argblock, flags, variable_size, reg_parm_stack_space)
|
||||
emit_move_insn (arg->save_area, stack_area);
|
||||
}
|
||||
}
|
||||
|
||||
/* Now that we have saved any slots that will be overwritten
|
||||
by this store, mark all slots this store will use. We
|
||||
must do this before we actually expand the argument since
|
||||
the expansion itself may trigger library calls which might
|
||||
need to use the same stack slot. We only do it if we can't
|
||||
pass all arguments to a library call in registers. */
|
||||
if (arg->partial)
|
||||
{
|
||||
for (i = lower_bound; i < upper_bound; i++)
|
||||
stack_usage_map[i] = 1;
|
||||
|
||||
/* Set it so that we don't do it again. */
|
||||
variable_size = 1;
|
||||
}
|
||||
}
|
||||
/* Now that we have saved any slots that will be overwritten by this
|
||||
store, mark all slots this store will use. We must do this before
|
||||
we actually expand the argument since the expansion itself may
|
||||
trigger library calls which might need to use the same stack slot. */
|
||||
if (argblock && ! variable_size && arg->stack)
|
||||
for (i = lower_bound; i < upper_bound; i++)
|
||||
stack_usage_map[i] = 1;
|
||||
}
|
||||
|
||||
/* If this isn't going to be placed on both the stack and in registers,
|
||||
@ -4586,6 +4602,11 @@ store_one_arg (arg, argblock, flags, variable_size, reg_parm_stack_space)
|
||||
arg->value = arg->stack_slot;
|
||||
}
|
||||
|
||||
if (ACCUMULATE_OUTGOING_ARGS && !(flags & ECF_SIBCALL)
|
||||
&& argblock && ! variable_size && arg->stack)
|
||||
for (i = lower_bound; i < upper_bound; i++)
|
||||
stack_usage_map[i] = 1;
|
||||
|
||||
/* Once we have pushed something, pops can't safely
|
||||
be deferred during the rest of the arguments. */
|
||||
NO_DEFER_POP;
|
||||
|
@ -56,7 +56,31 @@ static void flow_dfs_compute_reverse_finish
|
||||
static void remove_fake_successors PARAMS ((basic_block));
|
||||
static bool need_fake_edge_p PARAMS ((rtx));
|
||||
static bool keep_with_call_p PARAMS ((rtx));
|
||||
static bool flow_active_insn_p PARAMS ((rtx));
|
||||
|
||||
/* Like active_insn_p, except keep the return value clobber around
|
||||
even after reload. */
|
||||
|
||||
static bool
|
||||
flow_active_insn_p (insn)
|
||||
rtx insn;
|
||||
{
|
||||
if (active_insn_p (insn))
|
||||
return true;
|
||||
|
||||
/* A clobber of the function return value exists for buggy
|
||||
programs that fail to return a value. It's effect is to
|
||||
keep the return value from being live across the entire
|
||||
function. If we allow it to be skipped, we introduce the
|
||||
possibility for register livetime aborts. */
|
||||
if (GET_CODE (PATTERN (insn)) == CLOBBER
|
||||
&& GET_CODE (XEXP (PATTERN (insn), 0)) == REG
|
||||
&& REG_FUNCTION_VALUE_P (XEXP (PATTERN (insn), 0)))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Return true if the block has no effect and only forwards control flow to
|
||||
its single destination. */
|
||||
|
||||
@ -71,12 +95,12 @@ forwarder_block_p (bb)
|
||||
return false;
|
||||
|
||||
for (insn = bb->head; insn != bb->end; insn = NEXT_INSN (insn))
|
||||
if (INSN_P (insn) && active_insn_p (insn))
|
||||
if (INSN_P (insn) && flow_active_insn_p (insn))
|
||||
return false;
|
||||
|
||||
return (!INSN_P (insn)
|
||||
|| (GET_CODE (insn) == JUMP_INSN && simplejump_p (insn))
|
||||
|| !active_insn_p (insn));
|
||||
|| !flow_active_insn_p (insn));
|
||||
}
|
||||
|
||||
/* Return nonzero if we can reach target from src by falling through. */
|
||||
|
@ -1638,7 +1638,8 @@ try_optimize_cfg (mode)
|
||||
/* If the jump insn has side effects,
|
||||
we can't kill the edge. */
|
||||
&& (GET_CODE (b->end) != JUMP_INSN
|
||||
|| onlyjump_p (b->end))
|
||||
|| (onlyjump_p (b->end)
|
||||
&& !tablejump_p (b->end)))
|
||||
&& merge_blocks (s, b, c, mode))
|
||||
changed_here = true;
|
||||
|
||||
|
@ -665,6 +665,7 @@ try_redirect_by_replacing_jump (e, target)
|
||||
edge tmp;
|
||||
rtx set;
|
||||
int fallthru = 0;
|
||||
rtx table;
|
||||
|
||||
/* Verify that all targets will be TARGET. */
|
||||
for (tmp = src->succ; tmp; tmp = tmp->succ_next)
|
||||
@ -674,6 +675,13 @@ try_redirect_by_replacing_jump (e, target)
|
||||
if (tmp || !onlyjump_p (insn))
|
||||
return false;
|
||||
|
||||
if (reload_completed && JUMP_LABEL (insn)
|
||||
&& (table = NEXT_INSN (JUMP_LABEL (insn))) != NULL_RTX
|
||||
&& GET_CODE (table) == JUMP_INSN
|
||||
&& (GET_CODE (PATTERN (table)) == ADDR_VEC
|
||||
|| GET_CODE (PATTERN (table)) == ADDR_DIFF_VEC))
|
||||
return false;
|
||||
|
||||
/* Avoid removing branch with side effects. */
|
||||
set = single_set (insn);
|
||||
if (!set || side_effects_p (set))
|
||||
|
@ -1405,7 +1405,7 @@ i[34567]86-*-rtems*|i[34567]86-*-rtemself*)
|
||||
i[34567]86-*-sco3.2v5*) # 80386 running SCO Open Server 5
|
||||
xm_defines=POSIX
|
||||
install_headers_dir=install-headers-cpio
|
||||
tm_file=i386/sco5.h
|
||||
tm_file="${tm_file} i386/att.h i386/sco5.h"
|
||||
if test x$gas = xyes
|
||||
then
|
||||
tm_file="usegas.h ${tm_file}"
|
||||
|
1331
contrib/gcc/config.guess
vendored
1331
contrib/gcc/config.guess
vendored
File diff suppressed because it is too large
Load Diff
@ -890,6 +890,7 @@ use_return_insn (iscond)
|
||||
{
|
||||
int regno;
|
||||
unsigned int func_type;
|
||||
unsigned long saved_int_regs;
|
||||
|
||||
/* Never use a return instruction before reload has run. */
|
||||
if (!reload_completed)
|
||||
@ -912,23 +913,31 @@ use_return_insn (iscond)
|
||||
&& !frame_pointer_needed))
|
||||
return 0;
|
||||
|
||||
saved_int_regs = arm_compute_save_reg_mask ();
|
||||
|
||||
/* Can't be done if interworking with Thumb, and any registers have been
|
||||
stacked. Similarly, on StrongARM, conditional returns are expensive
|
||||
if they aren't taken and registers have been stacked. */
|
||||
if (iscond && arm_is_strong && frame_pointer_needed)
|
||||
stacked. */
|
||||
if (TARGET_INTERWORK && saved_int_regs != 0)
|
||||
return 0;
|
||||
|
||||
if ((iscond && arm_is_strong)
|
||||
|| TARGET_INTERWORK)
|
||||
|
||||
/* On StrongARM, conditional returns are expensive if they aren't
|
||||
taken and multiple registers have been stacked. */
|
||||
if (iscond && arm_is_strong)
|
||||
{
|
||||
for (regno = 0; regno <= LAST_ARM_REGNUM; regno++)
|
||||
if (regs_ever_live[regno] && !call_used_regs[regno])
|
||||
return 0;
|
||||
/* Conditional return when just the LR is stored is a simple
|
||||
conditional-load instruction, that's not expensive. */
|
||||
if (saved_int_regs != 0 && saved_int_regs != (1 << LR_REGNUM))
|
||||
return 0;
|
||||
|
||||
if (flag_pic && regs_ever_live[PIC_OFFSET_TABLE_REGNUM])
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* If there are saved registers but the LR isn't saved, then we need
|
||||
two instructions for the return. */
|
||||
if (saved_int_regs && !(saved_int_regs & (1 << LR_REGNUM)))
|
||||
return 0;
|
||||
|
||||
/* Can't be done if any of the FPU regs are pushed,
|
||||
since this also requires an insn. */
|
||||
if (TARGET_HARD_FLOAT)
|
||||
|
@ -30,6 +30,12 @@ Boston, MA 02111-1307, USA. */
|
||||
#undef CPP_SPEC
|
||||
#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT} %{!m32:-D__LONG_MAX__=9223372036854775807L}"
|
||||
|
||||
/* The svr4 ABI for the i386 says that records and unions are returned
|
||||
in memory. In the 64bit compilation we will turn this flag off in
|
||||
override_options, as we never do pcc_struct_return scheme on this target. */
|
||||
#undef DEFAULT_PCC_STRUCT_RETURN
|
||||
#define DEFAULT_PCC_STRUCT_RETURN 1
|
||||
|
||||
/* Provide a LINK_SPEC. Here we provide support for the special GCC
|
||||
options -static and -shared, which allow us to link things in one
|
||||
of these three modes by applying the appropriate combinations of
|
||||
|
@ -31,7 +31,7 @@
|
||||
#define _MMINTRIN_H_INCLUDED
|
||||
|
||||
/* The data type intended for user use. */
|
||||
typedef unsigned long long __m64 __attribute__ ((__aligned__ (8)));
|
||||
typedef int __m64 __attribute__ ((__mode__ (__V2SI__)));
|
||||
|
||||
/* Internal data types for implementing the intrinsics. */
|
||||
typedef int __v2si __attribute__ ((__mode__ (__V2SI__)));
|
||||
@ -49,14 +49,16 @@ _mm_empty (void)
|
||||
static __inline __m64
|
||||
_mm_cvtsi32_si64 (int __i)
|
||||
{
|
||||
return (unsigned int) __i;
|
||||
long long __tmp = (unsigned int)__i;
|
||||
return (__m64) __tmp;
|
||||
}
|
||||
|
||||
/* Convert the lower 32 bits of the __m64 object into an integer. */
|
||||
static __inline int
|
||||
_mm_cvtsi64_si32 (__m64 __i)
|
||||
{
|
||||
return __i;
|
||||
long long __tmp = (long long)__i;
|
||||
return __tmp;
|
||||
}
|
||||
|
||||
/* Pack the four 16-bit values from M1 into the lower four 8-bit values of
|
||||
@ -269,7 +271,7 @@ _mm_mullo_pi16 (__m64 __m1, __m64 __m2)
|
||||
static __inline __m64
|
||||
_mm_sll_pi16 (__m64 __m, __m64 __count)
|
||||
{
|
||||
return (__m64) __builtin_ia32_psllw ((__v4hi)__m, __count);
|
||||
return (__m64) __builtin_ia32_psllw ((__v4hi)__m, (long long)__count);
|
||||
}
|
||||
|
||||
static __inline __m64
|
||||
@ -282,7 +284,7 @@ _mm_slli_pi16 (__m64 __m, int __count)
|
||||
static __inline __m64
|
||||
_mm_sll_pi32 (__m64 __m, __m64 __count)
|
||||
{
|
||||
return (__m64) __builtin_ia32_pslld ((__v2si)__m, __count);
|
||||
return (__m64) __builtin_ia32_pslld ((__v2si)__m, (long long)__count);
|
||||
}
|
||||
|
||||
static __inline __m64
|
||||
@ -293,22 +295,22 @@ _mm_slli_pi32 (__m64 __m, int __count)
|
||||
|
||||
/* Shift the 64-bit value in M left by COUNT. */
|
||||
static __inline __m64
|
||||
_mm_sll_pi64 (__m64 __m, __m64 __count)
|
||||
_mm_sll_si64 (__m64 __m, __m64 __count)
|
||||
{
|
||||
return (__m64) __builtin_ia32_psllq (__m, __count);
|
||||
return (__m64) __builtin_ia32_psllq ((long long)__m, (long long)__count);
|
||||
}
|
||||
|
||||
static __inline __m64
|
||||
_mm_slli_pi64 (__m64 __m, int __count)
|
||||
_mm_slli_si64 (__m64 __m, int __count)
|
||||
{
|
||||
return (__m64) __builtin_ia32_psllq (__m, __count);
|
||||
return (__m64) __builtin_ia32_psllq ((long long)__m, (long long)__count);
|
||||
}
|
||||
|
||||
/* Shift four 16-bit values in M right by COUNT; shift in the sign bit. */
|
||||
static __inline __m64
|
||||
_mm_sra_pi16 (__m64 __m, __m64 __count)
|
||||
{
|
||||
return (__m64) __builtin_ia32_psraw ((__v4hi)__m, __count);
|
||||
return (__m64) __builtin_ia32_psraw ((__v4hi)__m, (long long)__count);
|
||||
}
|
||||
|
||||
static __inline __m64
|
||||
@ -321,7 +323,7 @@ _mm_srai_pi16 (__m64 __m, int __count)
|
||||
static __inline __m64
|
||||
_mm_sra_pi32 (__m64 __m, __m64 __count)
|
||||
{
|
||||
return (__m64) __builtin_ia32_psrad ((__v2si)__m, __count);
|
||||
return (__m64) __builtin_ia32_psrad ((__v2si)__m, (long long)__count);
|
||||
}
|
||||
|
||||
static __inline __m64
|
||||
@ -334,7 +336,7 @@ _mm_srai_pi32 (__m64 __m, int __count)
|
||||
static __inline __m64
|
||||
_mm_srl_pi16 (__m64 __m, __m64 __count)
|
||||
{
|
||||
return (__m64) __builtin_ia32_psrlw ((__v4hi)__m, __count);
|
||||
return (__m64) __builtin_ia32_psrlw ((__v4hi)__m, (long long)__count);
|
||||
}
|
||||
|
||||
static __inline __m64
|
||||
@ -347,7 +349,7 @@ _mm_srli_pi16 (__m64 __m, int __count)
|
||||
static __inline __m64
|
||||
_mm_srl_pi32 (__m64 __m, __m64 __count)
|
||||
{
|
||||
return (__m64) __builtin_ia32_psrld ((__v2si)__m, __count);
|
||||
return (__m64) __builtin_ia32_psrld ((__v2si)__m, (long long)__count);
|
||||
}
|
||||
|
||||
static __inline __m64
|
||||
@ -358,22 +360,22 @@ _mm_srli_pi32 (__m64 __m, int __count)
|
||||
|
||||
/* Shift the 64-bit value in M left by COUNT; shift in zeros. */
|
||||
static __inline __m64
|
||||
_mm_srl_pi64 (__m64 __m, __m64 __count)
|
||||
_mm_srl_si64 (__m64 __m, __m64 __count)
|
||||
{
|
||||
return (__m64) __builtin_ia32_psrlq (__m, __count);
|
||||
return (__m64) __builtin_ia32_psrlq ((long long)__m, (long long)__count);
|
||||
}
|
||||
|
||||
static __inline __m64
|
||||
_mm_srli_pi64 (__m64 __m, int __count)
|
||||
_mm_srli_si64 (__m64 __m, int __count)
|
||||
{
|
||||
return (__m64) __builtin_ia32_psrlq (__m, __count);
|
||||
return (__m64) __builtin_ia32_psrlq ((long long)__m, (long long)__count);
|
||||
}
|
||||
|
||||
/* Bit-wise AND the 64-bit values in M1 and M2. */
|
||||
static __inline __m64
|
||||
_mm_and_si64 (__m64 __m1, __m64 __m2)
|
||||
{
|
||||
return __builtin_ia32_pand (__m1, __m2);
|
||||
return (__m64) __builtin_ia32_pand ((long long)__m1, (long long)__m2);
|
||||
}
|
||||
|
||||
/* Bit-wise complement the 64-bit value in M1 and bit-wise AND it with the
|
||||
@ -381,21 +383,21 @@ _mm_and_si64 (__m64 __m1, __m64 __m2)
|
||||
static __inline __m64
|
||||
_mm_andnot_si64 (__m64 __m1, __m64 __m2)
|
||||
{
|
||||
return __builtin_ia32_pandn (__m1, __m2);
|
||||
return (__m64) __builtin_ia32_pandn ((long long)__m1, (long long)__m2);
|
||||
}
|
||||
|
||||
/* Bit-wise inclusive OR the 64-bit values in M1 and M2. */
|
||||
static __inline __m64
|
||||
_mm_or_si64 (__m64 __m1, __m64 __m2)
|
||||
{
|
||||
return __builtin_ia32_por (__m1, __m2);
|
||||
return (__m64)__builtin_ia32_por ((long long)__m1, (long long)__m2);
|
||||
}
|
||||
|
||||
/* Bit-wise exclusive OR the 64-bit values in M1 and M2. */
|
||||
static __inline __m64
|
||||
_mm_xor_si64 (__m64 __m1, __m64 __m2)
|
||||
{
|
||||
return __builtin_ia32_pxor (__m1, __m2);
|
||||
return (__m64)__builtin_ia32_pxor ((long long)__m1, (long long)__m2);
|
||||
}
|
||||
|
||||
/* Compare eight 8-bit values. The result of the comparison is 0xFF if the
|
||||
@ -444,7 +446,7 @@ _mm_cmpgt_pi32 (__m64 __m1, __m64 __m2)
|
||||
static __inline __m64
|
||||
_mm_setzero_si64 (void)
|
||||
{
|
||||
return __builtin_ia32_mmx_zero ();
|
||||
return (__m64)__builtin_ia32_mmx_zero ();
|
||||
}
|
||||
|
||||
/* Creates a vector of two 32-bit values; I0 is least significant. */
|
||||
|
@ -245,13 +245,21 @@ _mm_cmple_ss (__m128 __A, __m128 __B)
|
||||
static __inline __m128
|
||||
_mm_cmpgt_ss (__m128 __A, __m128 __B)
|
||||
{
|
||||
return (__m128) __builtin_ia32_cmpgtss ((__v4sf)__A, (__v4sf)__B);
|
||||
return (__m128) __builtin_ia32_movss ((__v4sf) __A,
|
||||
(__v4sf)
|
||||
__builtin_ia32_cmpltss ((__v4sf) __B,
|
||||
(__v4sf)
|
||||
__A));
|
||||
}
|
||||
|
||||
static __inline __m128
|
||||
_mm_cmpge_ss (__m128 __A, __m128 __B)
|
||||
{
|
||||
return (__m128) __builtin_ia32_cmpgess ((__v4sf)__A, (__v4sf)__B);
|
||||
return (__m128) __builtin_ia32_movss ((__v4sf) __A,
|
||||
(__v4sf)
|
||||
__builtin_ia32_cmpless ((__v4sf) __B,
|
||||
(__v4sf)
|
||||
__A));
|
||||
}
|
||||
|
||||
static __inline __m128
|
||||
@ -275,13 +283,21 @@ _mm_cmpnle_ss (__m128 __A, __m128 __B)
|
||||
static __inline __m128
|
||||
_mm_cmpngt_ss (__m128 __A, __m128 __B)
|
||||
{
|
||||
return (__m128) __builtin_ia32_cmpngtss ((__v4sf)__A, (__v4sf)__B);
|
||||
return (__m128) __builtin_ia32_movss ((__v4sf) __A,
|
||||
(__v4sf)
|
||||
__builtin_ia32_cmpnltss ((__v4sf) __B,
|
||||
(__v4sf)
|
||||
__A));
|
||||
}
|
||||
|
||||
static __inline __m128
|
||||
_mm_cmpnge_ss (__m128 __A, __m128 __B)
|
||||
{
|
||||
return (__m128) __builtin_ia32_cmpngess ((__v4sf)__A, (__v4sf)__B);
|
||||
return (__m128) __builtin_ia32_movss ((__v4sf) __A,
|
||||
(__v4sf)
|
||||
__builtin_ia32_cmpnless ((__v4sf) __B,
|
||||
(__v4sf)
|
||||
__A));
|
||||
}
|
||||
|
||||
static __inline __m128
|
||||
@ -1017,7 +1033,7 @@ _mm_prefetch (void *__P, enum _mm_hint __I)
|
||||
static __inline void
|
||||
_mm_stream_pi (__m64 *__P, __m64 __A)
|
||||
{
|
||||
__builtin_ia32_movntq (__P, __A);
|
||||
__builtin_ia32_movntq (__P, (long long)__A);
|
||||
}
|
||||
|
||||
/* Likewise. The address must be 16-byte aligned. */
|
||||
@ -1049,8 +1065,8 @@ _mm_pause (void)
|
||||
do { \
|
||||
__v4sf __r0 = (row0), __r1 = (row1), __r2 = (row2), __r3 = (row3); \
|
||||
__v4sf __t0 = __builtin_ia32_shufps (__r0, __r1, 0x44); \
|
||||
__v4sf __t1 = __builtin_ia32_shufps (__r0, __r1, 0xEE); \
|
||||
__v4sf __t2 = __builtin_ia32_shufps (__r2, __r3, 0x44); \
|
||||
__v4sf __t2 = __builtin_ia32_shufps (__r0, __r1, 0xEE); \
|
||||
__v4sf __t1 = __builtin_ia32_shufps (__r2, __r3, 0x44); \
|
||||
__v4sf __t3 = __builtin_ia32_shufps (__r2, __r3, 0xEE); \
|
||||
(row0) = __builtin_ia32_shufps (__t0, __t1, 0x88); \
|
||||
(row1) = __builtin_ia32_shufps (__t0, __t1, 0xDD); \
|
||||
|
@ -2011,6 +2011,7 @@ rs6000_legitimate_address (mode, x, reg_ok_strict)
|
||||
if (LEGITIMATE_INDIRECT_ADDRESS_P (x, reg_ok_strict))
|
||||
return 1;
|
||||
if ((GET_CODE (x) == PRE_INC || GET_CODE (x) == PRE_DEC)
|
||||
&& !ALTIVEC_VECTOR_MODE (mode)
|
||||
&& TARGET_UPDATE
|
||||
&& LEGITIMATE_INDIRECT_ADDRESS_P (XEXP (x, 0), reg_ok_strict))
|
||||
return 1;
|
||||
@ -6920,7 +6921,7 @@ rs6000_reverse_condition (mode, code)
|
||||
{
|
||||
/* Reversal of FP compares takes care -- an ordered compare
|
||||
becomes an unordered compare and vice versa. */
|
||||
if (mode == CCFPmode)
|
||||
if (mode == CCFPmode && !flag_unsafe_math_optimizations)
|
||||
return reverse_condition_maybe_unordered (code);
|
||||
else
|
||||
return reverse_condition (code);
|
||||
@ -7073,7 +7074,14 @@ output_cbranch (op, label, reversed, insn)
|
||||
reverse_condition_maybe_unordered here always but this
|
||||
makes the resulting assembler clearer. */
|
||||
if (really_reversed)
|
||||
code = rs6000_reverse_condition (mode, code);
|
||||
{
|
||||
/* Reversal of FP compares takes care -- an ordered compare
|
||||
becomes an unordered compare and vice versa. */
|
||||
if (mode == CCFPmode)
|
||||
code = reverse_condition_maybe_unordered (code);
|
||||
else
|
||||
code = reverse_condition (code);
|
||||
}
|
||||
|
||||
switch (code)
|
||||
{
|
||||
|
301
contrib/gcc/config/s390/fixdfdi.h
Normal file
301
contrib/gcc/config/s390/fixdfdi.h
Normal file
@ -0,0 +1,301 @@
|
||||
/* Definitions of target machine for GNU compiler, for IBM S/390
|
||||
Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
Contributed by Hartmut Penner (hpenner@de.ibm.com) and
|
||||
Ulrich Weigand (uweigand@de.ibm.com).
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef L_fixunsdfdi
|
||||
#define EXPD(fp) (((fp.l.upper) >> 20) & 0x7FF)
|
||||
#define EXCESSD 1022
|
||||
#define SIGNBIT 0x80000000
|
||||
#define SIGND(fp) ((fp.l.upper) & SIGNBIT)
|
||||
#define MANTD_LL(fp) ((fp.ll & (HIDDEND_LL-1)) | HIDDEND_LL)
|
||||
#define FRACD_LL(fp) (fp.ll & (HIDDEND_LL-1))
|
||||
#define HIDDEND_LL ((UDItype_x)1 << 52)
|
||||
|
||||
typedef int DItype_x __attribute__ ((mode (DI)));
|
||||
typedef unsigned int UDItype_x __attribute__ ((mode (DI)));
|
||||
typedef int SItype_x __attribute__ ((mode (SI)));
|
||||
typedef unsigned int USItype_x __attribute__ ((mode (SI)));
|
||||
|
||||
union double_long {
|
||||
double d;
|
||||
struct {
|
||||
SItype_x upper;
|
||||
USItype_x lower;
|
||||
} l;
|
||||
UDItype_x ll;
|
||||
};
|
||||
|
||||
|
||||
/* convert double to unsigned int */
|
||||
UDItype_x
|
||||
__fixunsdfdi (double a1)
|
||||
{
|
||||
register union double_long dl1;
|
||||
register int exp;
|
||||
register UDItype_x l;
|
||||
|
||||
dl1.d = a1;
|
||||
|
||||
/* +/- 0, denormalized, negativ */
|
||||
|
||||
if (!EXPD (dl1) || SIGND(dl1))
|
||||
return 0;
|
||||
|
||||
exp = EXPD (dl1) - EXCESSD - 53;
|
||||
|
||||
/* number < 1 */
|
||||
|
||||
if (exp < -53)
|
||||
return 0;
|
||||
|
||||
/* NaN */
|
||||
|
||||
if ((EXPD(dl1) == 0x7ff) && (FRACD_LL(dl1) != 0)) /* NaN */
|
||||
return 0x0ULL;
|
||||
|
||||
/* Number big number & + inf */
|
||||
|
||||
if (exp >= 12) {
|
||||
return 0xFFFFFFFFFFFFFFFFULL;
|
||||
}
|
||||
|
||||
l = MANTD_LL(dl1);
|
||||
|
||||
/* shift down until exp < 12 or l = 0 */
|
||||
if (exp > 0)
|
||||
l <<= exp;
|
||||
else
|
||||
l >>= -exp;
|
||||
|
||||
return l;
|
||||
}
|
||||
#define __fixunsdfdi ___fixunsdfdi
|
||||
#endif
|
||||
#undef L_fixunsdfdi
|
||||
|
||||
#ifdef L_fixdfdi
|
||||
#define EXPD(fp) (((fp.l.upper) >> 20) & 0x7FF)
|
||||
#define EXCESSD 1022
|
||||
#define SIGNBIT 0x80000000
|
||||
#define SIGND(fp) ((fp.l.upper) & SIGNBIT)
|
||||
#define MANTD_LL(fp) ((fp.ll & (HIDDEND_LL-1)) | HIDDEND_LL)
|
||||
#define FRACD_LL(fp) (fp.ll & (HIDDEND_LL-1))
|
||||
#define HIDDEND_LL ((UDItype_x)1 << 52)
|
||||
|
||||
typedef int DItype_x __attribute__ ((mode (DI)));
|
||||
typedef unsigned int UDItype_x __attribute__ ((mode (DI)));
|
||||
typedef int SItype_x __attribute__ ((mode (SI)));
|
||||
typedef unsigned int USItype_x __attribute__ ((mode (SI)));
|
||||
|
||||
union double_long {
|
||||
double d;
|
||||
struct {
|
||||
SItype_x upper;
|
||||
USItype_x lower;
|
||||
} l;
|
||||
UDItype_x ll;
|
||||
};
|
||||
|
||||
/* convert double to int */
|
||||
DItype_x
|
||||
__fixdfdi (double a1)
|
||||
{
|
||||
register union double_long dl1;
|
||||
register int exp;
|
||||
register DItype_x l;
|
||||
|
||||
dl1.d = a1;
|
||||
|
||||
/* +/- 0, denormalized */
|
||||
|
||||
if (!EXPD (dl1))
|
||||
return 0;
|
||||
|
||||
exp = EXPD (dl1) - EXCESSD - 53;
|
||||
|
||||
/* number < 1 */
|
||||
|
||||
if (exp < -53)
|
||||
return 0;
|
||||
|
||||
/* NaN */
|
||||
|
||||
if ((EXPD(dl1) == 0x7ff) && (FRACD_LL(dl1) != 0)) /* NaN */
|
||||
return 0x8000000000000000ULL;
|
||||
|
||||
/* Number big number & +/- inf */
|
||||
|
||||
if (exp >= 11) {
|
||||
l = (long long)1<<63;
|
||||
if (!SIGND(dl1))
|
||||
l--;
|
||||
return l;
|
||||
}
|
||||
|
||||
l = MANTD_LL(dl1);
|
||||
|
||||
/* shift down until exp < 12 or l = 0 */
|
||||
if (exp > 0)
|
||||
l <<= exp;
|
||||
else
|
||||
l >>= -exp;
|
||||
|
||||
return (SIGND (dl1) ? -l : l);
|
||||
}
|
||||
#define __fixdfdi ___fixdfdi
|
||||
#endif
|
||||
#undef L_fixdfdi
|
||||
|
||||
#ifdef L_fixunssfdi
|
||||
#define EXP(fp) (((fp.l) >> 23) & 0xFF)
|
||||
#define EXCESS 126
|
||||
#define SIGNBIT 0x80000000
|
||||
#define SIGN(fp) ((fp.l) & SIGNBIT)
|
||||
#define HIDDEN (1 << 23)
|
||||
#define MANT(fp) (((fp.l) & 0x7FFFFF) | HIDDEN)
|
||||
#define FRAC(fp) ((fp.l) & 0x7FFFFF)
|
||||
|
||||
typedef int DItype_x __attribute__ ((mode (DI)));
|
||||
typedef unsigned int UDItype_x __attribute__ ((mode (DI)));
|
||||
typedef int SItype_x __attribute__ ((mode (SI)));
|
||||
typedef unsigned int USItype_x __attribute__ ((mode (SI)));
|
||||
|
||||
union float_long
|
||||
{
|
||||
float f;
|
||||
USItype_x l;
|
||||
};
|
||||
|
||||
/* convert float to unsigned int */
|
||||
UDItype_x
|
||||
__fixunssfdi (float a1)
|
||||
{
|
||||
register union float_long fl1;
|
||||
register int exp;
|
||||
register UDItype_x l;
|
||||
|
||||
fl1.f = a1;
|
||||
|
||||
/* +/- 0, denormalized, negativ */
|
||||
|
||||
if (!EXP (fl1) || SIGN(fl1))
|
||||
return 0;
|
||||
|
||||
exp = EXP (fl1) - EXCESS - 24;
|
||||
|
||||
/* number < 1 */
|
||||
|
||||
if (exp < -24)
|
||||
return 0;
|
||||
|
||||
/* NaN */
|
||||
|
||||
if ((EXP(fl1) == 0xff) && (FRAC(fl1) != 0)) /* NaN */
|
||||
return 0x0ULL;
|
||||
|
||||
/* Number big number & + inf */
|
||||
|
||||
if (exp >= 41) {
|
||||
return 0xFFFFFFFFFFFFFFFFULL;
|
||||
}
|
||||
|
||||
l = MANT(fl1);
|
||||
|
||||
if (exp > 0)
|
||||
l <<= exp;
|
||||
else
|
||||
l >>= -exp;
|
||||
|
||||
return l;
|
||||
}
|
||||
#define __fixunssfdi ___fixunssfdi
|
||||
#endif
|
||||
#undef L_fixunssfdi
|
||||
|
||||
#ifdef L_fixsfdi
|
||||
#define EXP(fp) (((fp.l) >> 23) & 0xFF)
|
||||
#define EXCESS 126
|
||||
#define SIGNBIT 0x80000000
|
||||
#define SIGN(fp) ((fp.l) & SIGNBIT)
|
||||
#define HIDDEN (1 << 23)
|
||||
#define MANT(fp) (((fp.l) & 0x7FFFFF) | HIDDEN)
|
||||
#define FRAC(fp) ((fp.l) & 0x7FFFFF)
|
||||
|
||||
typedef int DItype_x __attribute__ ((mode (DI)));
|
||||
typedef unsigned int UDItype_x __attribute__ ((mode (DI)));
|
||||
typedef int SItype_x __attribute__ ((mode (SI)));
|
||||
typedef unsigned int USItype_x __attribute__ ((mode (SI)));
|
||||
|
||||
union float_long
|
||||
{
|
||||
float f;
|
||||
USItype_x l;
|
||||
};
|
||||
|
||||
/* convert double to int */
|
||||
DItype_x
|
||||
__fixsfdi (float a1)
|
||||
{
|
||||
register union float_long fl1;
|
||||
register int exp;
|
||||
register DItype_x l;
|
||||
|
||||
fl1.f = a1;
|
||||
|
||||
/* +/- 0, denormalized */
|
||||
|
||||
if (!EXP (fl1))
|
||||
return 0;
|
||||
|
||||
exp = EXP (fl1) - EXCESS - 24;
|
||||
|
||||
/* number < 1 */
|
||||
|
||||
if (exp < -24)
|
||||
return 0;
|
||||
|
||||
/* NaN */
|
||||
|
||||
if ((EXP(fl1) == 0xff) && (FRAC(fl1) != 0)) /* NaN */
|
||||
return 0x8000000000000000ULL;
|
||||
|
||||
/* Number big number & +/- inf */
|
||||
|
||||
if (exp >= 40) {
|
||||
l = (long long)1<<63;
|
||||
if (!SIGN(fl1))
|
||||
l--;
|
||||
return l;
|
||||
}
|
||||
|
||||
l = MANT(fl1);
|
||||
|
||||
if (exp > 0)
|
||||
l <<= exp;
|
||||
else
|
||||
l >>= -exp;
|
||||
|
||||
return (SIGN (fl1) ? -l : l);
|
||||
}
|
||||
#define __fixsfdi ___fixsfdi
|
||||
#endif
|
||||
#undef L_fixsfdi
|
||||
|
21
contrib/gcc/config/s390/libgcc-glibc.ver
Normal file
21
contrib/gcc/config/s390/libgcc-glibc.ver
Normal file
@ -0,0 +1,21 @@
|
||||
# In order to work around the very problems that force us to now generally
|
||||
# create a libgcc.so, glibc reexported a number of routines from libgcc.a.
|
||||
# By now choosing the same version tags for these specific routines, we
|
||||
# maintain enough binary compatibility to allow future versions of glibc
|
||||
# to defer implementation of these routines to libgcc.so via DT_AUXILIARY.
|
||||
|
||||
# Note that we cannot use the default libgcc-glibc.ver file on s390x,
|
||||
# because GLIBC_2.0 does not exist on this architecture, as the first
|
||||
# ever glibc release on the platform was GLIBC_2.2.
|
||||
|
||||
%inherit GCC_3.0 GLIBC_2.2
|
||||
GLIBC_2.2 {
|
||||
__register_frame
|
||||
__register_frame_table
|
||||
__deregister_frame
|
||||
__register_frame_info
|
||||
__deregister_frame_info
|
||||
__frame_state_for
|
||||
__register_frame_info_table
|
||||
}
|
||||
|
308
contrib/gcc/config/s390/linux.h
Normal file
308
contrib/gcc/config/s390/linux.h
Normal file
@ -0,0 +1,308 @@
|
||||
/* Definitions for Linux for S/390.
|
||||
Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
Contributed by Hartmut Penner (hpenner@de.ibm.com) and
|
||||
Ulrich Weigand (uweigand@de.ibm.com).
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _LINUX_H
|
||||
#define _LINUX_H
|
||||
|
||||
/* Target specific version string. */
|
||||
|
||||
#ifdef DEFAULT_TARGET_64BIT
|
||||
#undef TARGET_VERSION
|
||||
#define TARGET_VERSION fprintf (stderr, " (Linux for zSeries)");
|
||||
#else
|
||||
#undef TARGET_VERSION
|
||||
#define TARGET_VERSION fprintf (stderr, " (Linux for S/390)");
|
||||
#endif
|
||||
|
||||
|
||||
/* Target specific type definitions. */
|
||||
|
||||
/* ??? Do we really want long as size_t on 31-bit? */
|
||||
#undef SIZE_TYPE
|
||||
#define SIZE_TYPE (TARGET_64BIT ? "long unsigned int" : "long unsigned int")
|
||||
#undef PTRDIFF_TYPE
|
||||
#define PTRDIFF_TYPE (TARGET_64BIT ? "long int" : "int")
|
||||
|
||||
#undef WCHAR_TYPE
|
||||
#define WCHAR_TYPE "int"
|
||||
#undef WCHAR_TYPE_SIZE
|
||||
#define WCHAR_TYPE_SIZE 32
|
||||
|
||||
|
||||
/* Target specific preprocessor settings. */
|
||||
|
||||
#define NO_BUILTIN_SIZE_TYPE
|
||||
#define NO_BUILTIN_PTRDIFF_TYPE
|
||||
|
||||
#define CPP_PREDEFINES \
|
||||
"-Dunix -Asystem(unix) -D__gnu_linux__ -Dlinux -Asystem(linux) -D__ELF__ \
|
||||
-Acpu(s390) -Amachine(s390) -D__s390__"
|
||||
|
||||
#define CPP_ARCH31_SPEC \
|
||||
"-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=int"
|
||||
#define CPP_ARCH64_SPEC \
|
||||
"-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int \
|
||||
-D__s390x__ -D__LONG_MAX__=9223372036854775807L"
|
||||
|
||||
#ifdef DEFAULT_TARGET_64BIT
|
||||
#undef CPP_SPEC
|
||||
#define CPP_SPEC "%{m31:%(cpp_arch31)} %{!m31:%(cpp_arch64)}"
|
||||
#else
|
||||
#undef CPP_SPEC
|
||||
#define CPP_SPEC "%{m64:%(cpp_arch64)} %{!m64:%(cpp_arch31)}"
|
||||
#endif
|
||||
|
||||
|
||||
/* Target specific compiler settings. */
|
||||
|
||||
/* ??? -fcaller-saves sometimes doesn't work. Fix this! */
|
||||
#undef CC1_SPEC
|
||||
#define CC1_SPEC "-fno-caller-saves"
|
||||
#undef CC1PLUS_SPEC
|
||||
#define CC1PLUS_SPEC "-fno-caller-saves"
|
||||
|
||||
|
||||
/* Target specific assembler settings. */
|
||||
|
||||
#ifdef DEFAULT_TARGET_64BIT
|
||||
#undef ASM_SPEC
|
||||
#define ASM_SPEC "%{m31:-m31 -Aesa}"
|
||||
#else
|
||||
#undef ASM_SPEC
|
||||
#define ASM_SPEC "%{m64:-m64 -Aesame}"
|
||||
#endif
|
||||
|
||||
|
||||
/* Target specific linker settings. */
|
||||
|
||||
#define LINK_ARCH31_SPEC \
|
||||
"-m elf_s390 \
|
||||
%{shared:-shared} \
|
||||
%{!shared: \
|
||||
%{static:-static} \
|
||||
%{!static: \
|
||||
%{rdynamic:-export-dynamic} \
|
||||
%{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
|
||||
|
||||
#define LINK_ARCH64_SPEC \
|
||||
"-m elf64_s390 \
|
||||
%{shared:-shared} \
|
||||
%{!shared: \
|
||||
%{static:-static} \
|
||||
%{!static: \
|
||||
%{rdynamic:-export-dynamic} \
|
||||
%{!dynamic-linker:-dynamic-linker /lib/ld64.so.1}}}"
|
||||
|
||||
#ifdef DEFAULT_TARGET_64BIT
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC "%{m31:%(link_arch31)} %{!m31:%(link_arch64)}"
|
||||
#else
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC "%{m64:%(link_arch64)} %{!m64:%(link_arch31)}"
|
||||
#endif
|
||||
|
||||
|
||||
/* This macro defines names of additional specifications to put in the specs
|
||||
that can be used in various specifications like CC1_SPEC. Its definition
|
||||
is an initializer with a subgrouping for each command option. */
|
||||
|
||||
#define EXTRA_SPECS \
|
||||
{ "cpp_arch31", CPP_ARCH31_SPEC }, \
|
||||
{ "cpp_arch64", CPP_ARCH64_SPEC }, \
|
||||
{ "link_arch31", LINK_ARCH31_SPEC }, \
|
||||
{ "link_arch64", LINK_ARCH64_SPEC }, \
|
||||
|
||||
|
||||
/* Character to start a comment. */
|
||||
|
||||
#define ASM_COMMENT_START "#"
|
||||
|
||||
|
||||
/* Assembler pseudos to introduce constants of various size. */
|
||||
|
||||
#define ASM_DOUBLE "\t.double"
|
||||
|
||||
/* The LOCAL_LABEL_PREFIX variable is used by dbxelf.h. */
|
||||
#define LOCAL_LABEL_PREFIX "."
|
||||
|
||||
/* Prefix for internally generated assembler labels. */
|
||||
#define LPREFIX ".L"
|
||||
|
||||
|
||||
/* This is how to output the definition of a user-level label named NAME,
|
||||
such as the label on a static function or variable NAME. */
|
||||
|
||||
#undef ASM_OUTPUT_LABEL
|
||||
#define ASM_OUTPUT_LABEL(FILE, NAME) \
|
||||
(assemble_name (FILE, NAME), fputs (":\n", FILE))
|
||||
|
||||
/* Store in OUTPUT a string (made with alloca) containing
|
||||
an assembler-name for a local static variable named NAME.
|
||||
LABELNO is an integer which is different for each call. */
|
||||
|
||||
#undef ASM_FORMAT_PRIVATE_NAME
|
||||
#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
|
||||
( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
|
||||
sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
|
||||
|
||||
|
||||
/* internal macro to output long */
|
||||
#define _ASM_OUTPUT_LONG(FILE, VALUE) \
|
||||
fprintf (FILE, "\t.long\t0x%lX\n", VALUE);
|
||||
|
||||
|
||||
/* This is how to output an element of a case-vector that is absolute. */
|
||||
|
||||
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
|
||||
fprintf (FILE, "%s%s%d\n", integer_asm_op (UNITS_PER_WORD, TRUE), \
|
||||
LPREFIX, VALUE)
|
||||
|
||||
/* This is how to output an element of a case-vector that is relative. */
|
||||
|
||||
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
|
||||
fprintf (FILE, "%s%s%d-%s%d\n", integer_asm_op (UNITS_PER_WORD, TRUE), \
|
||||
LPREFIX, VALUE, LPREFIX, REL)
|
||||
|
||||
|
||||
|
||||
/* This is how to output an assembler line
|
||||
that says to advance the location counter
|
||||
to a multiple of 2**LOG bytes. */
|
||||
|
||||
#undef ASM_OUTPUT_ALIGN
|
||||
#define ASM_OUTPUT_ALIGN(FILE, LOG) \
|
||||
if ((LOG)!=0) fprintf ((FILE), "\t.align\t%d\n", 1<<(LOG))
|
||||
|
||||
/* This is how to output an assembler line
|
||||
that says to advance the location counter by SIZE bytes. */
|
||||
|
||||
#undef ASM_OUTPUT_SKIP
|
||||
#define ASM_OUTPUT_SKIP(FILE, SIZE) \
|
||||
fprintf ((FILE), "\t.set\t.,.+%u\n", (SIZE))
|
||||
|
||||
/* This is how to output assembler code to declare an
|
||||
uninitialized external linkage data object. */
|
||||
|
||||
#undef ASM_OUTPUT_ALIGNED_BSS
|
||||
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
|
||||
asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
|
||||
|
||||
/* Output before read-only data. */
|
||||
|
||||
#define TEXT_SECTION_ASM_OP ".text"
|
||||
|
||||
/* Output before writable (initialized) data. */
|
||||
|
||||
#define DATA_SECTION_ASM_OP ".data"
|
||||
|
||||
/* Output before writable (uninitialized) data. */
|
||||
|
||||
#define BSS_SECTION_ASM_OP ".bss"
|
||||
|
||||
/* This is how to output a command to make the user-level label named NAME
|
||||
defined for reference from other files. */
|
||||
|
||||
#define ASM_GLOBALIZE_LABEL(FILE, NAME) \
|
||||
(fputs (".globl ", FILE), assemble_name (FILE, NAME), fputs ("\n", FILE))
|
||||
|
||||
/* Select section for constant in constant pool.
|
||||
We are in the right section.
|
||||
undef for 64 bit mode (linux64.h).
|
||||
*/
|
||||
|
||||
#undef SELECT_RTX_SECTION
|
||||
#define SELECT_RTX_SECTION(MODE, X, ALIGN)
|
||||
|
||||
|
||||
/* Output code to add DELTA to the first argument, and then jump to FUNCTION.
|
||||
Used for C++ multiple inheritance. */
|
||||
#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
|
||||
do { \
|
||||
if (TARGET_64BIT) \
|
||||
{ \
|
||||
if (flag_pic) \
|
||||
{ \
|
||||
fprintf (FILE, "\tlarl 1,0f\n"); \
|
||||
fprintf (FILE, "\tagf %d,0(1)\n", \
|
||||
aggregate_value_p (TREE_TYPE \
|
||||
(TREE_TYPE (FUNCTION))) ? 3 :2 ); \
|
||||
fprintf (FILE, "\tlarl 1,"); \
|
||||
assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
|
||||
fprintf (FILE, "@GOTENT\n"); \
|
||||
fprintf (FILE, "\tlg 1,0(1)\n"); \
|
||||
fprintf (FILE, "\tbr 1\n"); \
|
||||
fprintf (FILE, "0:\t.long "); \
|
||||
fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, (DELTA)); \
|
||||
fprintf (FILE, "\n"); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
fprintf (FILE, "\tlarl 1,0f\n"); \
|
||||
fprintf (FILE, "\tagf %d,0(1)\n", \
|
||||
aggregate_value_p (TREE_TYPE \
|
||||
(TREE_TYPE (FUNCTION))) ? 3 :2 ); \
|
||||
fprintf (FILE, "\tjg "); \
|
||||
assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
|
||||
fprintf (FILE, "\n"); \
|
||||
fprintf (FILE, "0:\t.long "); \
|
||||
fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, (DELTA)); \
|
||||
fprintf (FILE, "\n"); \
|
||||
} \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
if (flag_pic) \
|
||||
{ \
|
||||
fprintf (FILE, "\tbras 1,0f\n"); \
|
||||
fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_-.\n"); \
|
||||
fprintf (FILE, "\t.long "); \
|
||||
assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
|
||||
fprintf (FILE, "@GOT\n"); \
|
||||
fprintf (FILE, "\t.long "); \
|
||||
fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, (DELTA)); \
|
||||
fprintf (FILE, "\n"); \
|
||||
fprintf (FILE, "0:\tal %d,8(1)\n", \
|
||||
aggregate_value_p (TREE_TYPE \
|
||||
(TREE_TYPE (FUNCTION))) ? 3 : 2 ); \
|
||||
fprintf (FILE, "\tl 0,4(1)\n"); \
|
||||
fprintf (FILE, "\tal 1,0(1)\n"); \
|
||||
fprintf (FILE, "\talr 1,0\n"); \
|
||||
fprintf (FILE, "\tl 1,0(1)\n"); \
|
||||
fprintf (FILE, "\tbr 1\n"); \
|
||||
} else { \
|
||||
fprintf (FILE, "\tbras 1,0f\n"); \
|
||||
fprintf (FILE, "\t.long "); \
|
||||
assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
|
||||
fprintf (FILE, "-.\n"); \
|
||||
fprintf (FILE, "\t.long "); \
|
||||
fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, (DELTA)); \
|
||||
fprintf (FILE, "\n"); \
|
||||
fprintf (FILE, "0:\tal %d,4(1)\n", \
|
||||
aggregate_value_p (TREE_TYPE \
|
||||
(TREE_TYPE (FUNCTION))) ? 3 : 2 ); \
|
||||
fprintf (FILE, "\tal 1,0(1)\n"); \
|
||||
fprintf (FILE, "\tbr 1\n"); \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#endif
|
85
contrib/gcc/config/s390/s390-protos.h
Normal file
85
contrib/gcc/config/s390/s390-protos.h
Normal file
@ -0,0 +1,85 @@
|
||||
/* Definitions of target machine for GNU compiler, for IBM S/390.
|
||||
Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
Contributed by Hartmut Penner (hpenner@de.ibm.com)
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Declare functions in s390.c. */
|
||||
|
||||
extern void optimization_options PARAMS ((int, int));
|
||||
extern void override_options PARAMS ((void));
|
||||
extern int s390_arg_frame_offset PARAMS ((void));
|
||||
extern void s390_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
|
||||
extern void s390_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
|
||||
extern void s390_emit_prologue PARAMS ((void));
|
||||
extern void s390_emit_epilogue PARAMS ((void));
|
||||
extern void s390_function_profiler PARAMS ((FILE *, int));
|
||||
|
||||
#ifdef RTX_CODE
|
||||
extern int const0_operand PARAMS ((rtx, enum machine_mode));
|
||||
extern int consttable_operand PARAMS ((rtx, enum machine_mode));
|
||||
extern int larl_operand PARAMS ((rtx, enum machine_mode));
|
||||
extern int fp_operand PARAMS ((rtx, enum machine_mode));
|
||||
extern int s_operand PARAMS ((rtx, enum machine_mode));
|
||||
extern int s_imm_operand PARAMS ((rtx, enum machine_mode));
|
||||
extern int bras_sym_operand PARAMS ((rtx, enum machine_mode));
|
||||
extern int load_multiple_operation PARAMS ((rtx, enum machine_mode));
|
||||
extern int store_multiple_operation PARAMS ((rtx, enum machine_mode));
|
||||
extern int s390_single_hi PARAMS ((rtx, enum machine_mode, int));
|
||||
extern int s390_extract_hi PARAMS ((rtx, enum machine_mode, int));
|
||||
extern int s390_single_qi PARAMS ((rtx, enum machine_mode, int));
|
||||
extern int s390_extract_qi PARAMS ((rtx, enum machine_mode, int));
|
||||
|
||||
extern int s390_match_ccmode PARAMS ((rtx, enum machine_mode));
|
||||
extern enum machine_mode s390_select_ccmode PARAMS ((enum rtx_code, rtx, rtx));
|
||||
extern int symbolic_reference_mentioned_p PARAMS ((rtx));
|
||||
extern int legitimate_la_operand_p PARAMS ((rtx));
|
||||
extern rtx legitimize_la_operand PARAMS ((rtx));
|
||||
extern int legitimate_pic_operand_p PARAMS ((rtx));
|
||||
extern int legitimate_constant_p PARAMS ((rtx));
|
||||
extern int legitimate_reload_constant_p PARAMS ((rtx));
|
||||
extern int legitimate_address_p PARAMS ((enum machine_mode, rtx, int));
|
||||
extern rtx legitimize_pic_address PARAMS ((rtx, rtx));
|
||||
extern rtx legitimize_address PARAMS ((rtx, rtx, enum machine_mode));
|
||||
extern enum reg_class s390_preferred_reload_class PARAMS ((rtx, enum reg_class));
|
||||
extern enum reg_class s390_secondary_input_reload_class PARAMS ((enum reg_class, enum machine_mode, rtx));
|
||||
extern int s390_plus_operand PARAMS ((rtx, enum machine_mode));
|
||||
extern void s390_expand_plus_operand PARAMS ((rtx, rtx, rtx));
|
||||
extern void emit_pic_move PARAMS ((rtx *, enum machine_mode));
|
||||
|
||||
extern void s390_output_symbolic_const PARAMS ((FILE *, rtx));
|
||||
extern void print_operand_address PARAMS ((FILE *, rtx));
|
||||
extern void print_operand PARAMS ((FILE *, rtx, int));
|
||||
extern void s390_output_constant_pool PARAMS ((FILE *));
|
||||
extern void s390_trampoline_template PARAMS ((FILE *));
|
||||
extern void s390_initialize_trampoline PARAMS ((rtx, rtx, rtx));
|
||||
extern rtx s390_gen_rtx_const_DI PARAMS ((int, int));
|
||||
extern rtx s390_simplify_dwarf_addr PARAMS ((rtx));
|
||||
#endif /* RTX_CODE */
|
||||
|
||||
#ifdef TREE_CODE
|
||||
extern int s390_function_arg_pass_by_reference PARAMS ((enum machine_mode, tree));
|
||||
extern void s390_function_arg_advance PARAMS ((CUMULATIVE_ARGS *, enum machine_mode, tree, int));
|
||||
extern tree s390_build_va_list PARAMS ((void));
|
||||
#ifdef RTX_CODE
|
||||
extern rtx s390_function_arg PARAMS ((CUMULATIVE_ARGS *, enum machine_mode, tree, int));
|
||||
extern void s390_va_start PARAMS ((int, tree, rtx));
|
||||
extern rtx s390_va_arg PARAMS ((tree, tree));
|
||||
#endif /* RTX_CODE */
|
||||
#endif /* TREE_CODE */
|
||||
|
4346
contrib/gcc/config/s390/s390.c
Normal file
4346
contrib/gcc/config/s390/s390.c
Normal file
File diff suppressed because it is too large
Load Diff
1389
contrib/gcc/config/s390/s390.h
Normal file
1389
contrib/gcc/config/s390/s390.h
Normal file
File diff suppressed because it is too large
Load Diff
6727
contrib/gcc/config/s390/s390.md
Normal file
6727
contrib/gcc/config/s390/s390.md
Normal file
File diff suppressed because it is too large
Load Diff
27
contrib/gcc/config/s390/s390x.h
Normal file
27
contrib/gcc/config/s390/s390x.h
Normal file
@ -0,0 +1,27 @@
|
||||
/* Definitions of target machine for IBM zSeries 64-bit
|
||||
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||
Contributed by Hartmut Penner (hpenner@de.ibm.com) and
|
||||
Ulrich Weigand (uweigand@de.ibm.com).
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _S390X_H
|
||||
#define _S390X_H
|
||||
|
||||
#define DEFAULT_TARGET_64BIT
|
||||
|
||||
#endif
|
7
contrib/gcc/config/s390/t-linux
Normal file
7
contrib/gcc/config/s390/t-linux
Normal file
@ -0,0 +1,7 @@
|
||||
# The crtbegin and crtend must not depend on a small GOT
|
||||
CRTSTUFF_T_CFLAGS = -O2 -fPIC
|
||||
CRTSTUFF_T_CFLAGS_S = -O2 -fPIC
|
||||
|
||||
# Compile libgcc2.a with pic.
|
||||
TARGET_LIBGCC2_CFLAGS = -fPIC -include $(srcdir)/config/s390/fixdfdi.h
|
||||
|
3
contrib/gcc/config/s390/t-linux64
Normal file
3
contrib/gcc/config/s390/t-linux64
Normal file
@ -0,0 +1,3 @@
|
||||
# Override t-slibgcc-elf-ver to export some libgcc symbols with
|
||||
# the symbol versions that glibc used.
|
||||
SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver $(srcdir)/config/s390/libgcc-glibc.ver
|
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,191 @@
|
||||
2002-11-19 Release Manager
|
||||
|
||||
* GCC 3.2.1 Released.
|
||||
|
||||
2002-11-19 Release Manager
|
||||
|
||||
* GCC 3.2.1 Released.
|
||||
|
||||
2002-11-18 Release Manager
|
||||
|
||||
* GCC 3.2.1 Released.
|
||||
|
||||
2002-11-11 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
PR c++/7788
|
||||
* rtti.c (unemitted_tinfo_decl_p): Check it has a field.
|
||||
|
||||
2002-11-02 Zack Weinberg <zack@codesourcery.com>
|
||||
|
||||
PR c/7353 redux
|
||||
* decl2.c (grokfield): Reject TYPE_DECLs with initializers.
|
||||
|
||||
2002-11-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
|
||||
|
||||
PR C++/2521
|
||||
* typeck.c (build_x_unary_op): Handle pointer-to-member.
|
||||
|
||||
2002-10-30 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/8160
|
||||
* typeck2.c (process_init_constructor): Call complete_array_type.
|
||||
|
||||
PR c++/8149
|
||||
* decl.c (make_typename_type): Issue errors about invalid results.
|
||||
|
||||
2002-10-29 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/8287
|
||||
* decl.c (finish_destructor_body): Create the label to jump to
|
||||
when returning from a destructor here.
|
||||
(finish_function_body): Rather than here.
|
||||
|
||||
* semantics.c (finish_alignof): Call complete_type before calling
|
||||
c_alignof.
|
||||
* decl2.c (build_expr_from_tree): Use
|
||||
finish_sizeof/finish_alignof.
|
||||
|
||||
2002-10-10 Jim Wilson <wilson@redhat.com>
|
||||
|
||||
* decl.c (duplicate_decls): Don't call decl_attributes.
|
||||
|
||||
2002-10-25 Zack Weinberg <zack@codesourcery.com>
|
||||
|
||||
PR middle-end/6994
|
||||
* cp-lang.c (cp_var_mod_type_p): New: C++ hook for
|
||||
variably_modified_type_p.
|
||||
* cp-tree.h: Remove prototype of variably_modified_type_p.
|
||||
* tree.c (variably_modified_type_p): Remove; now implemented
|
||||
in language-independent code.
|
||||
|
||||
PR c++/7266
|
||||
* decl.c (grokdeclarator): Check that TREE_OPERAND 0 of a
|
||||
SCOPE_REF is not null before dereferencing it.
|
||||
|
||||
2002-10-24 David Edelsohn <edelsohn@gnu.org>
|
||||
|
||||
PR c++/7228
|
||||
* cp-tree.h (CLASSTYPE_READONLY_FIELDS_NEED_INIT): Check that
|
||||
lang_type structure exists before accessing field.
|
||||
(SET_CLASSTYPE_READONLY_FIELDS_NEED_INIT): New macro.
|
||||
(CLASSTYPE_REF_FIELDS_NEED_INIT): Similar.
|
||||
(SET_CLASSTYPE_REF_FIELDS_NEED_INIT): New macro.
|
||||
* class.c (check_field_decls): Use new macros.
|
||||
* typeck2.c (process_init_constructor): Remove redundant check for
|
||||
existence of lang_type structure.
|
||||
|
||||
2002-10-23 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/8067
|
||||
* decl.c (maybe_inject_for_scope_var): Ignore __FUNCTION__ and
|
||||
related variables.
|
||||
|
||||
2002-10-23 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/7679
|
||||
* spew.c (next_token): Do not return an endless stream of
|
||||
END_OF_SAVED_INPUT tokens.
|
||||
(snarf_method): Add three END_OF_SAVED_INPUT tokens to the end of
|
||||
the cached token stream.
|
||||
(snarf_defarg): Likewise.
|
||||
|
||||
2002-10-22 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/6579
|
||||
* spew.c (snarf_parenthesized_expression): New function.
|
||||
(snarf_block): Use it.
|
||||
|
||||
2002-10-21 Matthias Klose <doko@debian.org>
|
||||
|
||||
* Backport, without whitespace change:
|
||||
2002-06-19 Akim Demaille <akim@epita.fr>
|
||||
* parse.y (TYPENAME): Rename as tTYPENAME to avoid the clash with
|
||||
decl.h's TYPENAME.
|
||||
* spew.c, lex.c: Adjust.
|
||||
* parse.y (explicit_instantiation): Add empty action to override
|
||||
the default $$ = $1 where it introduces a type clash.
|
||||
|
||||
2002-10-21 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/8218
|
||||
* cp-tree.h (lang_type_class): Add contains_empty_class_p.
|
||||
(CLASSTYPE_CONTAINS_EMPTY_CLASS_P): New macro.
|
||||
* class.c (check_bases): Update CLASSTYPE_CONTAINS_EMPTY_CLASS_P.
|
||||
(check_field_decls): Likewise.
|
||||
(layout_class_type): Likewise.
|
||||
(finish_struct_1): Initialize it.
|
||||
(walk_subobject_offsets): Use it to prune searches.
|
||||
|
||||
2002-10-18 Zack Weinberg <zack@codesourcery.com>
|
||||
|
||||
* decl.c (start_decl): Point users of the old initialized-
|
||||
typedef extension at __typeof__.
|
||||
|
||||
2002-10-18 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
PR c++/7676
|
||||
* class.c (add_method): Compare template parms too.
|
||||
|
||||
2002-10-17 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
* mangle.c (globals): Add entity and need_abi_warning.
|
||||
(write_prefix): Likewise.
|
||||
(write_template_prefix): Likewise.
|
||||
(start_mangling): Add entity parameter.
|
||||
(finish_mangling): Warn about names whose mangling will change.
|
||||
(mangle_decl_string): Adjust.
|
||||
(mangle_type_string): Likewise.
|
||||
(mangle_special_for_type): Likewise.
|
||||
(mangle_ctor_vtbl_for_type): Likewise.
|
||||
(mangle_thunk): Likewise.
|
||||
(mangle_guard_variable): Likewise.
|
||||
(mangle_ref_init_variable): Likewise.
|
||||
|
||||
PR c++/7584
|
||||
* class.c (handle_using_decl): Allow the declaration used to be
|
||||
from an ambiguous base.
|
||||
|
||||
2002-10-16 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/7478
|
||||
* cvt.c (convert_to_reference): Allow references as the incoming
|
||||
type.
|
||||
|
||||
PR c++/8134
|
||||
* tree.c (zero_init_p): Always return 1.
|
||||
|
||||
PR c++/7524
|
||||
* method.c (do_build_assign_ref): Use cp_build_qualified_type, not
|
||||
build_qualified_type.
|
||||
|
||||
2002-10-14 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/7176
|
||||
* lex.c (do_identifier): Add another option for the parsing
|
||||
parameter.
|
||||
* parse.y (do_id): Use it.
|
||||
|
||||
2002-10-11 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/5661
|
||||
* cp-tree.h (variably_modified_type_p): New function.
|
||||
(grokdeclarator) Tighten check for variably modified types as
|
||||
fields.
|
||||
* pt.c (convert_template_argument): Do not allow variably modified
|
||||
types as template arguments.
|
||||
* tree.c (variably_modified_type_p): New function.
|
||||
|
||||
2002-10-11 Jason Molenda <jmolenda@apple.com>
|
||||
|
||||
* init.c (build_field_list): Provide uses_unions_p with a default
|
||||
value.
|
||||
|
||||
2002-10-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
|
||||
|
||||
PRs C++/6803, C++/7721 and C++/7803
|
||||
* decl.c (grokdeclarator): Gracefully handle template-name as
|
||||
decl-specifier.
|
||||
|
||||
2002-10-09 Zack Weinberg <zack@codesourcery.com>
|
||||
|
||||
PR c/7353
|
||||
|
@ -945,6 +945,13 @@ add_method (type, method, error_p)
|
||||
&& (TYPE_QUALS (TREE_TYPE (TREE_VALUE (parms1)))
|
||||
!= TYPE_QUALS (TREE_TYPE (TREE_VALUE (parms2)))))
|
||||
same = 0;
|
||||
|
||||
/* For templates, the template parms must be identical. */
|
||||
if (TREE_CODE (fn) == TEMPLATE_DECL
|
||||
&& !comp_template_parms (DECL_TEMPLATE_PARMS (fn),
|
||||
DECL_TEMPLATE_PARMS (method)))
|
||||
same = 0;
|
||||
|
||||
if (! DECL_STATIC_FUNCTION_P (fn))
|
||||
parms1 = TREE_CHAIN (parms1);
|
||||
if (! DECL_STATIC_FUNCTION_P (method))
|
||||
@ -1150,9 +1157,12 @@ handle_using_decl (using_decl, t)
|
||||
tree flist = NULL_TREE;
|
||||
tree old_value;
|
||||
|
||||
binfo = binfo_or_else (ctype, t);
|
||||
binfo = lookup_base (t, ctype, ba_any, NULL);
|
||||
if (! binfo)
|
||||
return;
|
||||
{
|
||||
error_not_base_type (t, ctype);
|
||||
return;
|
||||
}
|
||||
|
||||
if (name == constructor_name (ctype)
|
||||
|| name == constructor_name_full (ctype))
|
||||
@ -1338,6 +1348,8 @@ check_bases (t, cant_have_default_ctor_p, cant_have_const_ctor_p,
|
||||
TYPE_OVERLOADS_ARRAY_REF (t) |= TYPE_OVERLOADS_ARRAY_REF (basetype);
|
||||
TYPE_OVERLOADS_ARROW (t) |= TYPE_OVERLOADS_ARROW (basetype);
|
||||
TYPE_POLYMORPHIC_P (t) |= TYPE_POLYMORPHIC_P (basetype);
|
||||
CLASSTYPE_CONTAINS_EMPTY_CLASS_P (t)
|
||||
|= CLASSTYPE_CONTAINS_EMPTY_CLASS_P (basetype);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3237,10 +3249,18 @@ check_field_decls (t, access_decls, empty_p,
|
||||
;
|
||||
else
|
||||
{
|
||||
tree element_type;
|
||||
|
||||
/* The class is non-empty. */
|
||||
*empty_p = 0;
|
||||
/* The class is not even nearly empty. */
|
||||
CLASSTYPE_NEARLY_EMPTY_P (t) = 0;
|
||||
/* If one of the data members contains an empty class,
|
||||
so does T. */
|
||||
element_type = strip_array_types (type);
|
||||
if (CLASS_TYPE_P (element_type)
|
||||
&& CLASSTYPE_CONTAINS_EMPTY_CLASS_P (element_type))
|
||||
CLASSTYPE_CONTAINS_EMPTY_CLASS_P (t) = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3322,7 +3342,7 @@ check_field_decls (t, access_decls, empty_p,
|
||||
{
|
||||
CLASSTYPE_NON_POD_P (t) = 1;
|
||||
if (DECL_INITIAL (x) == NULL_TREE)
|
||||
CLASSTYPE_REF_FIELDS_NEED_INIT (t) = 1;
|
||||
SET_CLASSTYPE_REF_FIELDS_NEED_INIT (t, 1);
|
||||
|
||||
/* ARM $12.6.2: [A member initializer list] (or, for an
|
||||
aggregate, initialization by a brace-enclosed list) is the
|
||||
@ -3356,7 +3376,7 @@ check_field_decls (t, access_decls, empty_p,
|
||||
{
|
||||
C_TYPE_FIELDS_READONLY (t) = 1;
|
||||
if (DECL_INITIAL (x) == NULL_TREE)
|
||||
CLASSTYPE_READONLY_FIELDS_NEED_INIT (t) = 1;
|
||||
SET_CLASSTYPE_READONLY_FIELDS_NEED_INIT (t, 1);
|
||||
|
||||
/* ARM $12.6.2: [A member initializer list] (or, for an
|
||||
aggregate, initialization by a brace-enclosed list) is the
|
||||
@ -3372,8 +3392,9 @@ check_field_decls (t, access_decls, empty_p,
|
||||
else if (IS_AGGR_TYPE (type))
|
||||
{
|
||||
C_TYPE_FIELDS_READONLY (t) |= C_TYPE_FIELDS_READONLY (type);
|
||||
CLASSTYPE_READONLY_FIELDS_NEED_INIT (t)
|
||||
|= CLASSTYPE_READONLY_FIELDS_NEED_INIT (type);
|
||||
SET_CLASSTYPE_READONLY_FIELDS_NEED_INIT (t,
|
||||
CLASSTYPE_READONLY_FIELDS_NEED_INIT (t)
|
||||
| CLASSTYPE_READONLY_FIELDS_NEED_INIT (type));
|
||||
}
|
||||
|
||||
/* Core issue 80: A nonstatic data member is required to have a
|
||||
@ -3507,6 +3528,10 @@ walk_subobject_offsets (type, f, offset, offsets, max_offset, vbases_p)
|
||||
tree field;
|
||||
int i;
|
||||
|
||||
/* Avoid recursing into objects that are not interesting. */
|
||||
if (!CLASSTYPE_CONTAINS_EMPTY_CLASS_P (type))
|
||||
return 0;
|
||||
|
||||
/* Record the location of TYPE. */
|
||||
r = (*f) (type, offset, offsets);
|
||||
if (r)
|
||||
@ -3552,9 +3577,15 @@ walk_subobject_offsets (type, f, offset, offsets, max_offset, vbases_p)
|
||||
}
|
||||
else if (TREE_CODE (type) == ARRAY_TYPE)
|
||||
{
|
||||
tree element_type = strip_array_types (type);
|
||||
tree domain = TYPE_DOMAIN (type);
|
||||
tree index;
|
||||
|
||||
/* Avoid recursing into objects that are not interesting. */
|
||||
if (!CLASS_TYPE_P (element_type)
|
||||
|| !CLASSTYPE_CONTAINS_EMPTY_CLASS_P (element_type))
|
||||
return 0;
|
||||
|
||||
/* Step through each of the elements in the array. */
|
||||
for (index = size_zero_node;
|
||||
INT_CST_LT (index, TYPE_MAX_VALUE (domain));
|
||||
@ -4267,6 +4298,7 @@ check_bases_and_members (t, empty_p)
|
||||
/* Assume that the class is nearly empty; we'll clear this flag if
|
||||
it turns out not to be nearly empty. */
|
||||
CLASSTYPE_NEARLY_EMPTY_P (t) = 1;
|
||||
CLASSTYPE_CONTAINS_EMPTY_CLASS_P (t) = 0;
|
||||
|
||||
/* Check all the base-classes. */
|
||||
check_bases (t, &cant_have_default_ctor, &cant_have_const_ctor,
|
||||
@ -4974,6 +5006,10 @@ layout_class_type (t, empty_p, vfuns_p, virtuals_p)
|
||||
CLASSTYPE_ALIGN (t) = TYPE_ALIGN (t);
|
||||
CLASSTYPE_USER_ALIGN (t) = TYPE_USER_ALIGN (t);
|
||||
|
||||
/* Every empty class contains an empty class. */
|
||||
if (*empty_p)
|
||||
CLASSTYPE_CONTAINS_EMPTY_CLASS_P (t) = 1;
|
||||
|
||||
/* Set the TYPE_DECL for this type to contain the right
|
||||
value for DECL_OFFSET, so that we can use it as part
|
||||
of a COMPONENT_REF for multiple inheritance. */
|
||||
|
@ -30,6 +30,7 @@ Boston, MA 02111-1307, USA. */
|
||||
|
||||
static HOST_WIDE_INT cxx_get_alias_set PARAMS ((tree));
|
||||
static tree cp_expr_size PARAMS ((tree));
|
||||
static bool cp_var_mod_type_p PARAMS ((tree));
|
||||
|
||||
#undef LANG_HOOKS_NAME
|
||||
#define LANG_HOOKS_NAME "GNU C++"
|
||||
@ -84,6 +85,8 @@ static tree cp_expr_size PARAMS ((tree));
|
||||
cp_copy_res_decl_for_inlining
|
||||
#undef LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P
|
||||
#define LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P anon_aggr_type_p
|
||||
#undef LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P
|
||||
#define LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P cp_var_mod_type_p
|
||||
#undef LANG_HOOKS_TREE_INLINING_START_INLINING
|
||||
#define LANG_HOOKS_TREE_INLINING_START_INLINING cp_start_inlining
|
||||
#undef LANG_HOOKS_TREE_INLINING_END_INLINING
|
||||
@ -130,3 +133,21 @@ cp_expr_size (exp)
|
||||
/* Use the default code. */
|
||||
return lhd_expr_size (exp);
|
||||
}
|
||||
|
||||
/* Returns true if T is a variably modified type, in the sense of C99.
|
||||
This routine needs only check cases that cannot be handled by the
|
||||
language-independent logic in tree-inline.c. */
|
||||
|
||||
static bool
|
||||
cp_var_mod_type_p (tree type)
|
||||
{
|
||||
/* If TYPE is a pointer-to-member, it is variably modified if either
|
||||
the class or the member are variably modified. */
|
||||
if (TYPE_PTRMEM_P (type) || TYPE_PTRMEMFUNC_P (type))
|
||||
return (variably_modified_type_p (TYPE_PTRMEM_CLASS_TYPE (type))
|
||||
|| variably_modified_type_p (TYPE_PTRMEM_POINTED_TO_TYPE (type)));
|
||||
|
||||
/* All other types are not variably modified. */
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1251,6 +1251,7 @@ struct lang_type
|
||||
unsigned java_interface : 1;
|
||||
|
||||
unsigned non_zero_init : 1;
|
||||
unsigned contains_empty_class_p : 1;
|
||||
|
||||
/* When adding a flag here, consider whether or not it ought to
|
||||
apply to a template instance if it applies to the template. If
|
||||
@ -1259,7 +1260,7 @@ struct lang_type
|
||||
/* There are some bits left to fill out a 32-bit word. Keep track
|
||||
of this by updating the size of this bitfield whenever you add or
|
||||
remove a flag. */
|
||||
unsigned dummy : 7;
|
||||
unsigned dummy : 6;
|
||||
|
||||
int vsize;
|
||||
|
||||
@ -1520,6 +1521,10 @@ struct lang_type
|
||||
#define CLASSTYPE_NEARLY_EMPTY_P(NODE) \
|
||||
(TYPE_LANG_SPECIFIC (NODE)->nearly_empty_p)
|
||||
|
||||
/* Nonzero if this class contains an empty subobject. */
|
||||
#define CLASSTYPE_CONTAINS_EMPTY_CLASS_P(NODE) \
|
||||
(TYPE_LANG_SPECIFIC (NODE)->contains_empty_class_p)
|
||||
|
||||
/* A list of class types of which this type is a friend. The
|
||||
TREE_VALUE is normally a TYPE, but will be a TEMPLATE_DECL in the
|
||||
case of a template friend. */
|
||||
@ -1534,13 +1539,21 @@ struct lang_type
|
||||
#define CLASSTYPE_DECLARED_CLASS(NODE) \
|
||||
(TYPE_LANG_SPECIFIC (NODE)->declared_class)
|
||||
|
||||
/* Nonzero if this class has const members which have no specified initialization. */
|
||||
#define CLASSTYPE_READONLY_FIELDS_NEED_INIT(NODE) \
|
||||
(TYPE_LANG_SPECIFIC (NODE)->const_needs_init)
|
||||
/* Nonzero if this class has const members
|
||||
which have no specified initialization. */
|
||||
#define CLASSTYPE_READONLY_FIELDS_NEED_INIT(NODE) \
|
||||
(TYPE_LANG_SPECIFIC (NODE) \
|
||||
? TYPE_LANG_SPECIFIC (NODE)->const_needs_init : 0)
|
||||
#define SET_CLASSTYPE_READONLY_FIELDS_NEED_INIT(NODE, VALUE) \
|
||||
(TYPE_LANG_SPECIFIC (NODE)->const_needs_init = (VALUE))
|
||||
|
||||
/* Nonzero if this class has ref members which have no specified initialization. */
|
||||
#define CLASSTYPE_REF_FIELDS_NEED_INIT(NODE) \
|
||||
(TYPE_LANG_SPECIFIC (NODE)->ref_needs_init)
|
||||
/* Nonzero if this class has ref members
|
||||
which have no specified initialization. */
|
||||
#define CLASSTYPE_REF_FIELDS_NEED_INIT(NODE) \
|
||||
(TYPE_LANG_SPECIFIC (NODE) \
|
||||
? TYPE_LANG_SPECIFIC (NODE)->ref_needs_init : 0)
|
||||
#define SET_CLASSTYPE_REF_FIELDS_NEED_INIT(NODE, VALUE) \
|
||||
(TYPE_LANG_SPECIFIC (NODE)->ref_needs_init = (VALUE))
|
||||
|
||||
/* Nonzero if this class is included from a header file which employs
|
||||
`#pragma interface', and it is not included in its implementation file. */
|
||||
|
@ -464,12 +464,13 @@ convert_to_reference (reftype, expr, convtype, flags, decl)
|
||||
tree decl;
|
||||
{
|
||||
register tree type = TYPE_MAIN_VARIANT (TREE_TYPE (reftype));
|
||||
register tree intype = TREE_TYPE (expr);
|
||||
register tree intype;
|
||||
tree rval = NULL_TREE;
|
||||
tree rval_as_conversion = NULL_TREE;
|
||||
int i;
|
||||
|
||||
if (TREE_CODE (type) == FUNCTION_TYPE && intype == unknown_type_node)
|
||||
if (TREE_CODE (type) == FUNCTION_TYPE
|
||||
&& TREE_TYPE (expr) == unknown_type_node)
|
||||
{
|
||||
expr = instantiate_type (type, expr,
|
||||
(flags & LOOKUP_COMPLAIN)
|
||||
@ -479,6 +480,11 @@ convert_to_reference (reftype, expr, convtype, flags, decl)
|
||||
|
||||
intype = TREE_TYPE (expr);
|
||||
}
|
||||
else
|
||||
{
|
||||
expr = convert_from_reference (expr);
|
||||
intype = TREE_TYPE (expr);
|
||||
}
|
||||
|
||||
my_friendly_assert (TREE_CODE (intype) != REFERENCE_TYPE, 364);
|
||||
|
||||
|
@ -1519,7 +1519,13 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist)
|
||||
/* friend or constructor went bad. */
|
||||
return value;
|
||||
if (TREE_TYPE (value) == error_mark_node)
|
||||
return error_mark_node;
|
||||
return error_mark_node;
|
||||
|
||||
if (TREE_CODE (value) == TYPE_DECL && init)
|
||||
{
|
||||
error ("typedef `%D' is initialized (use __typeof__ instead)", value);
|
||||
init = NULL_TREE;
|
||||
}
|
||||
|
||||
/* Pass friendly classes back. */
|
||||
if (TREE_CODE (value) == VOID_TYPE)
|
||||
@ -3795,10 +3801,8 @@ build_expr_from_tree (t)
|
||||
case ALIGNOF_EXPR:
|
||||
{
|
||||
tree r = build_expr_from_tree (TREE_OPERAND (t, 0));
|
||||
if (!TYPE_P (r))
|
||||
return TREE_CODE (t) == SIZEOF_EXPR ? expr_sizeof (r) : c_alignof_expr (r);
|
||||
else
|
||||
return TREE_CODE (t) == SIZEOF_EXPR ? c_sizeof (r) : c_alignof (r);
|
||||
return (TREE_CODE (t) == SIZEOF_EXPR
|
||||
? finish_sizeof (r) : finish_alignof (r));
|
||||
}
|
||||
|
||||
case MODOP_EXPR:
|
||||
|
@ -348,6 +348,8 @@ build_field_list (t, list, uses_unions_p)
|
||||
{
|
||||
tree fields;
|
||||
|
||||
*uses_unions_p = 0;
|
||||
|
||||
/* Note whether or not T is a union. */
|
||||
if (TREE_CODE (t) == UNION_TYPE)
|
||||
*uses_unions_p = 1;
|
||||
|
@ -90,10 +90,11 @@ extern YYSTYPE yylval; /* the semantic value of the */
|
||||
int warn_traditional = 0;
|
||||
int flag_digraphs = 1;
|
||||
|
||||
/* the declaration found for the last IDENTIFIER token read in.
|
||||
yylex must look this up to detect typedefs, which get token type TYPENAME,
|
||||
so it is left around in case the identifier is not a typedef but is
|
||||
used in a context which makes it a reference to a variable. */
|
||||
/* the declaration found for the last IDENTIFIER token read in. yylex
|
||||
must look this up to detect typedefs, which get token type
|
||||
tTYPENAME, so it is left around in case the identifier is not a
|
||||
typedef but is used in a context which makes it a reference to a
|
||||
variable. */
|
||||
tree lastiddecl;
|
||||
|
||||
/* Array for holding counts of the numbers of tokens seen. */
|
||||
@ -739,7 +740,7 @@ yyprint (file, yychar, yylval)
|
||||
switch (yychar)
|
||||
{
|
||||
case IDENTIFIER:
|
||||
case TYPENAME:
|
||||
case tTYPENAME:
|
||||
case TYPESPEC:
|
||||
case PTYPENAME:
|
||||
case PFUNCNAME:
|
||||
@ -977,7 +978,7 @@ check_for_missing_semicolon (type)
|
||||
if ((yychar > 255
|
||||
&& yychar != SCSPEC
|
||||
&& yychar != IDENTIFIER
|
||||
&& yychar != TYPENAME
|
||||
&& yychar != tTYPENAME
|
||||
&& yychar != CV_QUALIFIER
|
||||
&& yychar != SELFNAME)
|
||||
|| yychar == 0 /* EOF */)
|
||||
@ -1194,7 +1195,7 @@ do_identifier (token, parsing, args)
|
||||
tree args;
|
||||
{
|
||||
register tree id;
|
||||
int lexing = (parsing == 1);
|
||||
int lexing = (parsing == 1 || parsing == 3);
|
||||
|
||||
if (! lexing)
|
||||
id = lookup_name (token, 0);
|
||||
@ -1216,7 +1217,7 @@ do_identifier (token, parsing, args)
|
||||
|
||||
/* Remember that this name has been used in the class definition, as per
|
||||
[class.scope0] */
|
||||
if (id && parsing)
|
||||
if (id && parsing && parsing != 3)
|
||||
maybe_note_name_used_in_class (token, id);
|
||||
|
||||
if (id == error_mark_node)
|
||||
|
@ -93,6 +93,13 @@ static struct globals
|
||||
/* An array of the current substitution candidates, in the order
|
||||
we've seen them. */
|
||||
varray_type substitutions;
|
||||
|
||||
/* The entity that is being mangled. */
|
||||
tree entity;
|
||||
|
||||
/* True if the mangling will be different in a future version of the
|
||||
ABI. */
|
||||
bool need_abi_warning;
|
||||
} G;
|
||||
|
||||
/* Indices into subst_identifiers. These are identifiers used in
|
||||
@ -186,8 +193,8 @@ static const char *mangle_decl_string PARAMS ((tree));
|
||||
|
||||
/* Control functions. */
|
||||
|
||||
static inline void start_mangling PARAMS ((void));
|
||||
static inline const char *finish_mangling PARAMS ((void));
|
||||
static inline void start_mangling PARAMS ((tree));
|
||||
static inline const char *finish_mangling PARAMS ((bool));
|
||||
static tree mangle_special_for_type PARAMS ((tree, const char *));
|
||||
|
||||
/* Foreign language functions. */
|
||||
@ -884,6 +891,10 @@ write_prefix (node)
|
||||
template_info = CLASSTYPE_TEMPLATE_INFO (node);
|
||||
}
|
||||
|
||||
/* In G++ 3.2, the name of the template parameter was used. */
|
||||
if (TREE_CODE (node) == TEMPLATE_TYPE_PARM)
|
||||
G.need_abi_warning = true;
|
||||
|
||||
if (template_info != NULL)
|
||||
/* Templated. */
|
||||
{
|
||||
@ -955,6 +966,10 @@ write_template_prefix (node)
|
||||
if (find_substitution (substitution))
|
||||
return;
|
||||
|
||||
/* In G++ 3.2, the name of the template template parameter was used. */
|
||||
if (TREE_CODE (TREE_TYPE (template)) == TEMPLATE_TEMPLATE_PARM)
|
||||
G.need_abi_warning = true;
|
||||
|
||||
write_prefix (context);
|
||||
write_unqualified_name (decl);
|
||||
|
||||
@ -1823,6 +1838,10 @@ write_expression (expr)
|
||||
write_template_arg_literal (expr);
|
||||
else if (DECL_P (expr))
|
||||
{
|
||||
/* G++ 3.2 incorrectly mangled non-type template arguments of
|
||||
enumeration type using their names. */
|
||||
if (code == CONST_DECL)
|
||||
G.need_abi_warning = 1;
|
||||
write_char ('L');
|
||||
write_mangled_name (expr);
|
||||
write_char ('E');
|
||||
@ -1878,7 +1897,12 @@ write_expression (expr)
|
||||
if (TREE_CODE (TREE_OPERAND (expr, 1)) == IDENTIFIER_NODE)
|
||||
write_source_name (TREE_OPERAND (expr, 1));
|
||||
else
|
||||
write_encoding (TREE_OPERAND (expr, 1));
|
||||
{
|
||||
/* G++ 3.2 incorrectly put out both the "sr" code and
|
||||
the nested name of the qualified name. */
|
||||
G.need_abi_warning = 1;
|
||||
write_encoding (TREE_OPERAND (expr, 1));
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -1983,6 +2007,10 @@ write_template_arg (node)
|
||||
write_template_template_arg (node);
|
||||
else if (DECL_P (node))
|
||||
{
|
||||
/* G++ 3.2 incorrectly mangled non-type template arguments of
|
||||
enumeration type using their names. */
|
||||
if (code == CONST_DECL)
|
||||
G.need_abi_warning = 1;
|
||||
write_char ('L');
|
||||
write_char ('Z');
|
||||
write_encoding (node);
|
||||
@ -2152,16 +2180,23 @@ write_substitution (seq_id)
|
||||
/* Start mangling a new name or type. */
|
||||
|
||||
static inline void
|
||||
start_mangling ()
|
||||
start_mangling (tree entity)
|
||||
{
|
||||
G.entity = entity;
|
||||
G.need_abi_warning = false;
|
||||
obstack_free (&G.name_obstack, obstack_base (&G.name_obstack));
|
||||
}
|
||||
|
||||
/* Done with mangling. Return the generated mangled name. */
|
||||
|
||||
static inline const char *
|
||||
finish_mangling ()
|
||||
finish_mangling (bool warn)
|
||||
{
|
||||
if (warn_abi && warn && G.need_abi_warning)
|
||||
warning ("the mangled name of `%D' will change in a future "
|
||||
"version of GCC",
|
||||
G.entity);
|
||||
|
||||
/* Clear all the substitutions. */
|
||||
VARRAY_POP_ALL (G.substitutions);
|
||||
|
||||
@ -2197,7 +2232,7 @@ mangle_decl_string (decl)
|
||||
{
|
||||
const char *result;
|
||||
|
||||
start_mangling ();
|
||||
start_mangling (decl);
|
||||
|
||||
if (TREE_CODE (decl) == TYPE_DECL)
|
||||
write_type (TREE_TYPE (decl));
|
||||
@ -2224,7 +2259,7 @@ mangle_decl_string (decl)
|
||||
write_string (" *INTERNAL* ");
|
||||
}
|
||||
|
||||
result = finish_mangling ();
|
||||
result = finish_mangling (/*warn=*/true);
|
||||
if (DEBUG_MANGLE)
|
||||
fprintf (stderr, "mangle_decl_string = '%s'\n\n", result);
|
||||
return result;
|
||||
@ -2249,9 +2284,9 @@ mangle_type_string (type)
|
||||
{
|
||||
const char *result;
|
||||
|
||||
start_mangling ();
|
||||
start_mangling (type);
|
||||
write_type (type);
|
||||
result = finish_mangling ();
|
||||
result = finish_mangling (/*warn=*/false);
|
||||
if (DEBUG_MANGLE)
|
||||
fprintf (stderr, "mangle_type_string = '%s'\n\n", result);
|
||||
return result;
|
||||
@ -2279,7 +2314,7 @@ mangle_special_for_type (type, code)
|
||||
|
||||
/* We don't have an actual decl here for the special component, so
|
||||
we can't just process the <encoded-name>. Instead, fake it. */
|
||||
start_mangling ();
|
||||
start_mangling (type);
|
||||
|
||||
/* Start the mangling. */
|
||||
write_string ("_Z");
|
||||
@ -2287,7 +2322,7 @@ mangle_special_for_type (type, code)
|
||||
|
||||
/* Add the type. */
|
||||
write_type (type);
|
||||
result = finish_mangling ();
|
||||
result = finish_mangling (/*warn=*/false);
|
||||
|
||||
if (DEBUG_MANGLE)
|
||||
fprintf (stderr, "mangle_special_for_type = %s\n\n", result);
|
||||
@ -2354,7 +2389,7 @@ mangle_ctor_vtbl_for_type (type, binfo)
|
||||
{
|
||||
const char *result;
|
||||
|
||||
start_mangling ();
|
||||
start_mangling (type);
|
||||
|
||||
write_string ("_Z");
|
||||
write_string ("TC");
|
||||
@ -2363,7 +2398,7 @@ mangle_ctor_vtbl_for_type (type, binfo)
|
||||
write_char ('_');
|
||||
write_type (BINFO_TYPE (binfo));
|
||||
|
||||
result = finish_mangling ();
|
||||
result = finish_mangling (/*warn=*/false);
|
||||
if (DEBUG_MANGLE)
|
||||
fprintf (stderr, "mangle_ctor_vtbl_for_type = %s\n\n", result);
|
||||
return get_identifier (result);
|
||||
@ -2387,7 +2422,7 @@ mangle_thunk (fn_decl, offset, vcall_offset)
|
||||
{
|
||||
const char *result;
|
||||
|
||||
start_mangling ();
|
||||
start_mangling (fn_decl);
|
||||
|
||||
write_string ("_Z");
|
||||
/* The <special-name> for virtual thunks is Tv, for non-virtual
|
||||
@ -2413,7 +2448,7 @@ mangle_thunk (fn_decl, offset, vcall_offset)
|
||||
/* Scoped name. */
|
||||
write_encoding (fn_decl);
|
||||
|
||||
result = finish_mangling ();
|
||||
result = finish_mangling (/*warn=*/false);
|
||||
if (DEBUG_MANGLE)
|
||||
fprintf (stderr, "mangle_thunk = %s\n\n", result);
|
||||
return get_identifier (result);
|
||||
@ -2454,7 +2489,7 @@ tree
|
||||
mangle_guard_variable (variable)
|
||||
tree variable;
|
||||
{
|
||||
start_mangling ();
|
||||
start_mangling (variable);
|
||||
write_string ("_ZGV");
|
||||
if (strncmp (IDENTIFIER_POINTER (DECL_NAME (variable)), "_ZGR", 4) == 0)
|
||||
/* The name of a guard variable for a reference temporary should refer
|
||||
@ -2462,7 +2497,7 @@ mangle_guard_variable (variable)
|
||||
write_string (IDENTIFIER_POINTER (DECL_NAME (variable)) + 4);
|
||||
else
|
||||
write_name (variable, /*ignore_local_scope=*/0);
|
||||
return get_identifier (finish_mangling ());
|
||||
return get_identifier (finish_mangling (/*warn=*/false));
|
||||
}
|
||||
|
||||
/* Return an identifier for the name of a temporary variable used to
|
||||
@ -2473,10 +2508,10 @@ tree
|
||||
mangle_ref_init_variable (variable)
|
||||
tree variable;
|
||||
{
|
||||
start_mangling ();
|
||||
start_mangling (variable);
|
||||
write_string ("_ZGR");
|
||||
write_name (variable, /*ignore_local_scope=*/0);
|
||||
return get_identifier (finish_mangling ());
|
||||
return get_identifier (finish_mangling (/*warn=*/false));
|
||||
}
|
||||
|
||||
|
||||
|
@ -688,7 +688,7 @@ do_build_assign_ref (fndecl)
|
||||
|
||||
comp = build (COMPONENT_REF, TREE_TYPE (field), comp, field);
|
||||
init = build (COMPONENT_REF,
|
||||
build_qualified_type (TREE_TYPE (field), cvquals),
|
||||
cp_build_qualified_type (TREE_TYPE (field), cvquals),
|
||||
init, field);
|
||||
|
||||
if (DECL_NAME (field))
|
||||
|
@ -253,7 +253,7 @@ cp_parse_init ()
|
||||
/* All identifiers that are declared typedefs in the current block.
|
||||
In some contexts, they are treated just like IDENTIFIER,
|
||||
but they can also serve as typespecs in declarations. */
|
||||
%token TYPENAME
|
||||
%token tTYPENAME
|
||||
%token SELFNAME
|
||||
|
||||
/* A template function. */
|
||||
@ -315,7 +315,7 @@ cp_parse_init ()
|
||||
%nonassoc IF
|
||||
%nonassoc ELSE
|
||||
|
||||
%left IDENTIFIER PFUNCNAME TYPENAME SELFNAME PTYPENAME SCSPEC TYPESPEC CV_QUALIFIER ENUM AGGR ELLIPSIS TYPEOF SIGOF OPERATOR NSNAME TYPENAME_KEYWORD ATTRIBUTE
|
||||
%left IDENTIFIER PFUNCNAME tTYPENAME SELFNAME PTYPENAME SCSPEC TYPESPEC CV_QUALIFIER ENUM AGGR ELLIPSIS TYPEOF SIGOF OPERATOR NSNAME TYPENAME_KEYWORD ATTRIBUTE
|
||||
|
||||
%left '{' ',' ';'
|
||||
|
||||
@ -345,7 +345,7 @@ cp_parse_init ()
|
||||
|
||||
%type <code> unop
|
||||
|
||||
%type <ttype> identifier IDENTIFIER TYPENAME CONSTANT expr nonnull_exprlist
|
||||
%type <ttype> identifier IDENTIFIER tTYPENAME CONSTANT expr nonnull_exprlist
|
||||
%type <ttype> PFUNCNAME maybe_identifier
|
||||
%type <ttype> paren_expr_or_null nontrivial_exprlist SELFNAME
|
||||
%type <ttype> expr_no_commas expr_no_comma_rangle
|
||||
@ -994,7 +994,7 @@ member_init:
|
||||
|
||||
identifier:
|
||||
IDENTIFIER
|
||||
| TYPENAME
|
||||
| tTYPENAME
|
||||
| SELFNAME
|
||||
| PTYPENAME
|
||||
| NSNAME
|
||||
@ -1031,17 +1031,21 @@ explicit_instantiation:
|
||||
{ do_type_instantiation ($4.t, $1, 1);
|
||||
yyungetc (';', 1); }
|
||||
end_explicit_instantiation
|
||||
{}
|
||||
| SCSPEC TEMPLATE begin_explicit_instantiation typed_declspecs
|
||||
declarator
|
||||
{ tree specs = strip_attrs ($4.t);
|
||||
do_decl_instantiation (specs, $5, $1); }
|
||||
end_explicit_instantiation
|
||||
{}
|
||||
| SCSPEC TEMPLATE begin_explicit_instantiation notype_declarator
|
||||
{ do_decl_instantiation (NULL_TREE, $4, $1); }
|
||||
end_explicit_instantiation
|
||||
{}
|
||||
| SCSPEC TEMPLATE begin_explicit_instantiation constructor_declarator
|
||||
{ do_decl_instantiation (NULL_TREE, $4, $1); }
|
||||
end_explicit_instantiation
|
||||
{}
|
||||
;
|
||||
|
||||
begin_explicit_instantiation:
|
||||
@ -1060,7 +1064,7 @@ template_type:
|
||||
PTYPENAME '<' template_arg_list_opt template_close_bracket
|
||||
.finish_template_type
|
||||
{ $$ = $5; }
|
||||
| TYPENAME '<' template_arg_list_opt template_close_bracket
|
||||
| tTYPENAME '<' template_arg_list_opt template_close_bracket
|
||||
.finish_template_type
|
||||
{ $$ = $5; }
|
||||
| self_template_type
|
||||
@ -1507,7 +1511,7 @@ do_id:
|
||||
don't do_identifier; we only do that for unqualified
|
||||
identifiers. */
|
||||
if (!lastiddecl || TREE_CODE (lastiddecl) != TREE_LIST)
|
||||
$$ = do_identifier ($<ttype>-1, 1, NULL_TREE);
|
||||
$$ = do_identifier ($<ttype>-1, 3, NULL_TREE);
|
||||
else
|
||||
$$ = $<ttype>-1;
|
||||
}
|
||||
@ -1532,7 +1536,7 @@ object_template_id:
|
||||
|
||||
unqualified_id:
|
||||
notype_unqualified_id
|
||||
| TYPENAME
|
||||
| tTYPENAME
|
||||
| SELFNAME
|
||||
;
|
||||
|
||||
@ -2767,7 +2771,7 @@ after_type_component_declarator0:
|
||||
after_type_declarator maybeasm maybe_attribute maybe_init
|
||||
{ $$ = parse_field0 ($1, $<ftype>0.t, $<ftype>0.lookups,
|
||||
$3, $2, $4); }
|
||||
| TYPENAME ':' expr_no_commas maybe_attribute
|
||||
| tTYPENAME ':' expr_no_commas maybe_attribute
|
||||
{ $$ = parse_bitfield0 ($1, $<ftype>0.t, $<ftype>0.lookups,
|
||||
$4, $3); }
|
||||
;
|
||||
@ -2790,7 +2794,7 @@ notype_component_declarator0:
|
||||
after_type_component_declarator:
|
||||
after_type_declarator maybeasm maybe_attribute maybe_init
|
||||
{ $$ = parse_field ($1, $3, $2, $4); }
|
||||
| TYPENAME ':' expr_no_commas maybe_attribute
|
||||
| tTYPENAME ':' expr_no_commas maybe_attribute
|
||||
{ $$ = parse_bitfield ($1, $4, $3); }
|
||||
;
|
||||
|
||||
@ -3062,7 +3066,7 @@ functional_cast:
|
||||
;
|
||||
|
||||
type_name:
|
||||
TYPENAME
|
||||
tTYPENAME
|
||||
| SELFNAME
|
||||
| template_type %prec EMPTY
|
||||
;
|
||||
@ -3086,7 +3090,7 @@ nested_name_specifier:
|
||||
/* Why the @#$%^& do type_name and notype_identifier need to be expanded
|
||||
inline here?!? (jason) */
|
||||
nested_name_specifier_1:
|
||||
TYPENAME SCOPE
|
||||
tTYPENAME SCOPE
|
||||
{
|
||||
if (TREE_CODE ($1) == IDENTIFIER_NODE)
|
||||
{
|
||||
@ -3172,7 +3176,7 @@ typename_sub1:
|
||||
/* This needs to return a TYPE_DECL for simple names so that we don't
|
||||
forget what name was used. */
|
||||
typename_sub2:
|
||||
TYPENAME SCOPE
|
||||
tTYPENAME SCOPE
|
||||
{
|
||||
if (TREE_CODE ($1) != TYPE_DECL)
|
||||
$$ = lastiddecl;
|
||||
@ -3610,7 +3614,7 @@ label_colon:
|
||||
{ finish_label_stmt ($1); }
|
||||
| PTYPENAME ':'
|
||||
{ finish_label_stmt ($1); }
|
||||
| TYPENAME ':'
|
||||
| tTYPENAME ':'
|
||||
{ finish_label_stmt ($1); }
|
||||
| SELFNAME ':'
|
||||
{ finish_label_stmt ($1); }
|
||||
|
@ -3430,6 +3430,16 @@ convert_template_argument (parm, arg, args, complain, i, in_decl)
|
||||
val, t);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
/* In order to avoid all sorts of complications, we do
|
||||
not allow variably-modified types as template
|
||||
arguments. */
|
||||
if (variably_modified_type_p (val))
|
||||
{
|
||||
error ("template-argument `%T' is a variably modified type",
|
||||
val);
|
||||
return error_mark_node;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1413,11 +1413,13 @@ unemitted_tinfo_decl_p (t, data)
|
||||
TREE_CODE (t) == VAR_DECL
|
||||
/* whos name points back to itself */
|
||||
&& IDENTIFIER_GLOBAL_VALUE (DECL_NAME (t)) == t
|
||||
/* whos name's type is non-null */
|
||||
/* whose name's type is non-null */
|
||||
&& TREE_TYPE (DECL_NAME (t))
|
||||
/* and whos type is a struct */
|
||||
/* and whose type is a struct */
|
||||
&& TREE_CODE (TREE_TYPE (t)) == RECORD_TYPE
|
||||
/* with a first field of our pseudo type info */
|
||||
/* with a field */
|
||||
&& TYPE_FIELDS (TREE_TYPE (t))
|
||||
/* which is our pseudo type info */
|
||||
&& TREE_TYPE (TYPE_FIELDS (TREE_TYPE (t))) == ti_desc_type_node)
|
||||
return 1;
|
||||
return 0;
|
||||
|
@ -2117,7 +2117,7 @@ finish_alignof (t)
|
||||
if (processing_template_decl)
|
||||
return build_min_nt (ALIGNOF_EXPR, t);
|
||||
|
||||
return TYPE_P (t) ? c_alignof (t) : c_alignof_expr (t);
|
||||
return TYPE_P (t) ? c_alignof (complete_type (t)) : c_alignof_expr (t);
|
||||
}
|
||||
|
||||
/* Generate RTL for the statement T, and its substatements, and any
|
||||
|
@ -115,6 +115,7 @@ static SPEW_INLINE int read_process_identifier PARAMS ((YYSTYPE *));
|
||||
static SPEW_INLINE void feed_input PARAMS ((struct unparsed_text *));
|
||||
static SPEW_INLINE void snarf_block PARAMS ((const char *, int));
|
||||
static tree snarf_defarg PARAMS ((void));
|
||||
static void snarf_parenthesized_expression PARAMS ((const char *, int));
|
||||
static int frob_id PARAMS ((int, int, tree *));
|
||||
|
||||
/* The list of inline functions being held off until we reach the end of
|
||||
@ -141,10 +142,11 @@ static enum cpp_ttype last_token;
|
||||
static tree last_token_id;
|
||||
|
||||
/* From lex.c: */
|
||||
/* the declaration found for the last IDENTIFIER token read in.
|
||||
yylex must look this up to detect typedefs, which get token type TYPENAME,
|
||||
so it is left around in case the identifier is not a typedef but is
|
||||
used in a context which makes it a reference to a variable. */
|
||||
/* the declaration found for the last IDENTIFIER token read in. yylex
|
||||
must look this up to detect typedefs, which get token type
|
||||
tTYPENAME, so it is left around in case the identifier is not a
|
||||
typedef but is used in a context which makes it a reference to a
|
||||
variable. */
|
||||
extern tree lastiddecl; /* let our brains leak out here too */
|
||||
extern int yychar; /* the lookahead symbol */
|
||||
extern YYSTYPE yylval; /* the semantic value of the */
|
||||
@ -483,9 +485,8 @@ add_token (t)
|
||||
memcpy (t, feed->input->pos, sizeof (struct token));
|
||||
return (feed->input->pos++)->yychar;
|
||||
}
|
||||
|
||||
memcpy (t, &Teosi, sizeof (struct token));
|
||||
return END_OF_SAVED_INPUT;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Shift the next token onto the fifo. */
|
||||
@ -628,11 +629,11 @@ identifier_type (decl)
|
||||
if (t && t == decl)
|
||||
return SELFNAME;
|
||||
|
||||
return TYPENAME;
|
||||
return tTYPENAME;
|
||||
}
|
||||
|
||||
/* token[0] == AGGR (struct/union/enum)
|
||||
Thus, token[1] is either a TYPENAME or a TYPENAME_DEFN.
|
||||
Thus, token[1] is either a tTYPENAME or a TYPENAME_DEFN.
|
||||
If token[2] == '{' or ':' then it's TYPENAME_DEFN.
|
||||
It's also a definition if it's a forward declaration (as in 'struct Foo;')
|
||||
which we can tell if token[2] == ';' *and* token[-1] != FRIEND or NEW. */
|
||||
@ -644,7 +645,7 @@ do_aggr ()
|
||||
|
||||
scan_tokens (2);
|
||||
yc1 = nth_token (1)->yychar;
|
||||
if (yc1 != TYPENAME && yc1 != IDENTIFIER && yc1 != PTYPENAME)
|
||||
if (yc1 != tTYPENAME && yc1 != IDENTIFIER && yc1 != PTYPENAME)
|
||||
return;
|
||||
yc2 = nth_token (2)->yychar;
|
||||
if (yc2 == ';')
|
||||
@ -659,7 +660,7 @@ do_aggr ()
|
||||
|
||||
switch (yc1)
|
||||
{
|
||||
case TYPENAME:
|
||||
case tTYPENAME:
|
||||
nth_token (1)->yychar = TYPENAME_DEFN;
|
||||
break;
|
||||
case PTYPENAME:
|
||||
@ -757,7 +758,7 @@ yylex ()
|
||||
break;
|
||||
}
|
||||
case IDENTIFIER_DEFN:
|
||||
case TYPENAME:
|
||||
case tTYPENAME:
|
||||
case TYPENAME_DEFN:
|
||||
case PTYPENAME:
|
||||
case PTYPENAME_DEFN:
|
||||
@ -897,7 +898,7 @@ frob_id (yyc, peek, idp)
|
||||
yyc = identifier_type (trrr);
|
||||
switch(yyc)
|
||||
{
|
||||
case TYPENAME:
|
||||
case tTYPENAME:
|
||||
case SELFNAME:
|
||||
case NSNAME:
|
||||
case PTYPENAME:
|
||||
@ -1031,6 +1032,38 @@ process_next_inline (i)
|
||||
}
|
||||
|
||||
|
||||
/* Accumulate the tokens that make up a parenthesized expression in T,
|
||||
having already read the opening parenthesis. */
|
||||
|
||||
static void
|
||||
snarf_parenthesized_expression (starting_file, starting_line)
|
||||
const char *starting_file;
|
||||
int starting_line;
|
||||
{
|
||||
int yyc;
|
||||
int level = 1;
|
||||
|
||||
while (1)
|
||||
{
|
||||
size_t point;
|
||||
|
||||
point = obstack_object_size (&inline_text_obstack);
|
||||
obstack_blank (&inline_text_obstack, sizeof (struct token));
|
||||
yyc = add_token ((struct token *)
|
||||
(obstack_base (&inline_text_obstack) + point));
|
||||
if (yyc == '(')
|
||||
++level;
|
||||
else if (yyc == ')' && --level == 0)
|
||||
break;
|
||||
else if (yyc == 0)
|
||||
{
|
||||
error_with_file_and_line (starting_file, starting_line,
|
||||
"end of file read inside definition");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Subroutine of snarf_method, deals with actual absorption of the block. */
|
||||
|
||||
static SPEW_INLINE void
|
||||
@ -1113,6 +1146,8 @@ snarf_block (starting_file, starting_line)
|
||||
else if (look_for_semicolon && blev == 0)
|
||||
break;
|
||||
}
|
||||
else if (yyc == '(' && blev == 0)
|
||||
snarf_parenthesized_expression (starting_file, starting_line);
|
||||
else if (yyc == 0)
|
||||
{
|
||||
error_with_file_and_line (starting_file, starting_line,
|
||||
@ -1131,12 +1166,27 @@ snarf_method (decl)
|
||||
int starting_lineno = lineno;
|
||||
const char *starting_filename = input_filename;
|
||||
size_t len;
|
||||
int i;
|
||||
|
||||
struct unparsed_text *meth;
|
||||
|
||||
/* Leave room for the header, then absorb the block. */
|
||||
obstack_blank (&inline_text_obstack, sizeof (struct unparsed_text));
|
||||
snarf_block (starting_filename, starting_lineno);
|
||||
/* Add three END_OF_SAVED_INPUT tokens. We used to provide an
|
||||
infinite stream of END_OF_SAVED_INPUT tokens -- but that can
|
||||
cause the compiler to get stuck in an infinite loop when
|
||||
encountering invalid code. We need more than one because the
|
||||
parser sometimes peeks ahead several tokens. */
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
size_t point = obstack_object_size (&inline_text_obstack);
|
||||
obstack_blank (&inline_text_obstack, sizeof (struct token));
|
||||
memcpy ((struct token *)
|
||||
(obstack_base (&inline_text_obstack) + point),
|
||||
&Teosi,
|
||||
sizeof (struct token));
|
||||
}
|
||||
|
||||
len = obstack_object_size (&inline_text_obstack);
|
||||
meth = (struct unparsed_text *) obstack_finish (&inline_text_obstack);
|
||||
@ -1187,6 +1237,7 @@ snarf_defarg ()
|
||||
size_t point;
|
||||
size_t len;
|
||||
struct unparsed_text *buf;
|
||||
int i;
|
||||
tree arg;
|
||||
|
||||
obstack_blank (&inline_text_obstack, sizeof (struct unparsed_text));
|
||||
@ -1216,6 +1267,20 @@ snarf_defarg ()
|
||||
push_token ((struct token *) (obstack_base (&inline_text_obstack) + point));
|
||||
/* This is the documented way to shrink a growing obstack block. */
|
||||
obstack_blank (&inline_text_obstack, - (int) sizeof (struct token));
|
||||
/* Add three END_OF_SAVED_INPUT tokens. We used to provide an
|
||||
infinite stream of END_OF_SAVED_INPUT tokens -- but that can
|
||||
cause the compiler to get stuck in an infinite loop when
|
||||
encountering invalid code. We need more than one because the
|
||||
parser sometimes peeks ahead several tokens. */
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
point = obstack_object_size (&inline_text_obstack);
|
||||
obstack_blank (&inline_text_obstack, sizeof (struct token));
|
||||
memcpy ((struct token *)
|
||||
(obstack_base (&inline_text_obstack) + point),
|
||||
&Teosi,
|
||||
sizeof (struct token));
|
||||
}
|
||||
|
||||
done:
|
||||
len = obstack_object_size (&inline_text_obstack);
|
||||
@ -1448,7 +1513,7 @@ debug_yychar (yy)
|
||||
{
|
||||
if (yy<256)
|
||||
fprintf (stderr, "->%d < %c >\n", lineno, yy);
|
||||
else if (yy == IDENTIFIER || yy == TYPENAME)
|
||||
else if (yy == IDENTIFIER || yy == tTYPENAME)
|
||||
{
|
||||
const char *id;
|
||||
if (TREE_CODE (yylval.ttype) == IDENTIFIER_NODE)
|
||||
|
@ -1903,19 +1903,19 @@ pod_type_p (t)
|
||||
|
||||
int
|
||||
zero_init_p (t)
|
||||
tree t;
|
||||
tree t ATTRIBUTE_UNUSED;
|
||||
{
|
||||
t = strip_array_types (t);
|
||||
/* This is not a correct implementation of this function. As a
|
||||
result, pointers-to-members will not be correctly
|
||||
zero-initialized.
|
||||
|
||||
/* NULL pointers to data members are initialized with -1. */
|
||||
if (TYPE_PTRMEM_P (t))
|
||||
return 0;
|
||||
|
||||
/* Classes that contain types that can't be zero-initialized, cannot
|
||||
be zero-initialized themselves. */
|
||||
if (CLASS_TYPE_P (t) && CLASSTYPE_NON_ZERO_INIT_P (t))
|
||||
return 0;
|
||||
However, using a correct implementation of this function results
|
||||
in many other failures. Correcting these other failures required
|
||||
a major infrastructure improvement, which was undertaken in the
|
||||
GCC 3.3 source base.
|
||||
|
||||
In order to reduce risk, these changes were not ported to the GCC
|
||||
3.2 source base. */
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -4167,6 +4167,25 @@ build_x_unary_op (code, xarg)
|
||||
}
|
||||
if (code == ADDR_EXPR)
|
||||
{
|
||||
/* A pointer to member-function can be formed only by saying
|
||||
&X::mf. */
|
||||
if (!flag_ms_extensions && TREE_CODE (TREE_TYPE (xarg)) == METHOD_TYPE
|
||||
&& (TREE_CODE (xarg) != OFFSET_REF || !PTRMEM_OK_P (xarg)))
|
||||
{
|
||||
if (TREE_CODE (xarg) != OFFSET_REF)
|
||||
{
|
||||
error ("invalid use of '%E' to form a pointer-to-member-function. Use a qualified-id.",
|
||||
xarg);
|
||||
return error_mark_node;
|
||||
}
|
||||
else
|
||||
{
|
||||
error ("parenthesis around '%E' cannot be used to form a pointer-to-member-function",
|
||||
xarg);
|
||||
PTRMEM_OK_P (xarg) = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (TREE_CODE (xarg) == OFFSET_REF)
|
||||
{
|
||||
ptrmem = PTRMEM_OK_P (xarg);
|
||||
|
@ -863,8 +863,7 @@ process_init_constructor (type, init, elts)
|
||||
{
|
||||
if (TREE_READONLY (field))
|
||||
error ("uninitialized const member `%D'", field);
|
||||
else if (TYPE_LANG_SPECIFIC (TREE_TYPE (field))
|
||||
&& CLASSTYPE_READONLY_FIELDS_NEED_INIT (TREE_TYPE (field)))
|
||||
else if (CLASSTYPE_READONLY_FIELDS_NEED_INIT (TREE_TYPE (field)))
|
||||
error ("member `%D' with uninitialized const fields",
|
||||
field);
|
||||
else if (TREE_CODE (TREE_TYPE (field)) == REFERENCE_TYPE)
|
||||
@ -976,6 +975,8 @@ process_init_constructor (type, init, elts)
|
||||
return error_mark_node;
|
||||
|
||||
result = build (CONSTRUCTOR, type, NULL_TREE, nreverse (members));
|
||||
if (TREE_CODE (type) == ARRAY_TYPE && TYPE_DOMAIN (type) == NULL_TREE)
|
||||
complete_array_type (type, result, /*do_default=*/0);
|
||||
if (init)
|
||||
TREE_HAS_CONSTRUCTOR (result) = TREE_HAS_CONSTRUCTOR (init);
|
||||
if (allconstant) TREE_CONSTANT (result) = 1;
|
||||
|
@ -113,3 +113,44 @@ interpretations of the C++ ABI by different vendors, bugs in the ABI, or
|
||||
bugs in the implementation of the ABI in different compilers.
|
||||
GCC's @code{-Wabi} switch warns when G++ generates code that is
|
||||
probably not compatible with the C++ ABI@.
|
||||
|
||||
The C++ library used with a C++ compiler includes the Standard C++
|
||||
Library, with functionality defined in the C++ Standard, plus language
|
||||
runtime support. The runtime support is included in a C++ ABI, but there
|
||||
is no formal ABI for the Standard C++ Library. Two implementations
|
||||
of that library are interoperable if one follows the de-facto ABI of the
|
||||
other and if they are both built with the same compiler, or with compilers
|
||||
that conform to the same ABI for C++ compiler and runtime support.
|
||||
|
||||
When G++ and another C++ compiler conform to the same C++ ABI, but the
|
||||
implementations of the Standard C++ Library that they normally use do not
|
||||
follow the same ABI for the Standard C++ Library, object files built with
|
||||
those compilers can be used in the same program only if they use the same
|
||||
C++ library. This requires specifying the location of the C++ library
|
||||
header files when invoking the compiler whose usual library is not being
|
||||
used. The location of GCC's C++ header files depends on how the GCC
|
||||
build was configured, but can be seen by using the G++ @option{-v} option.
|
||||
With default configuration options for G++ 3.2 the compile line for a
|
||||
different C++ compiler needs to include
|
||||
|
||||
@example
|
||||
-I@var{gcc_install_directory}/include/c++/3.2
|
||||
@end example
|
||||
|
||||
Similarly, compiling code with G++ that must use a C++ library other
|
||||
than the GNU C++ library requires specifying the location of the header
|
||||
files for that other library.
|
||||
|
||||
The most straightforward way to link a program to use a particular
|
||||
C++ library is to use a C++ driver that specifies that C++ library by
|
||||
default. The @command{g++} driver, for example, tells the linker where
|
||||
to find GCC's C++ library (@file{libstdc++}) plus the other libraries
|
||||
and startup files it needs, in the proper order.
|
||||
|
||||
If a program must use a different C++ library and it's not possible
|
||||
to do the final link using a C++ driver that uses that library by default,
|
||||
it is necessary to tell @command{g++} the location and name of that
|
||||
library. It might also be necessary to specify different startup files
|
||||
and other runtime support libraries, and to suppress the use of GCC's
|
||||
support libraries with one or more of the options @option{-nostdlib},
|
||||
@option{-nostartfiles}, and @option{-nodefaultlibs}.
|
||||
|
@ -14,10 +14,6 @@ in this list are accidental. Feel free to contact
|
||||
or some of your contributions are not listed. Please keep this list in
|
||||
alphabetical order.
|
||||
|
||||
Some projects operating under the GCC project maintain their own list
|
||||
of contributors, such as
|
||||
@uref{http://gcc.gnu.org/libstdc++/,the C++ library}.
|
||||
|
||||
@itemize @bullet
|
||||
|
||||
@item
|
||||
@ -25,7 +21,8 @@ Analog Devices helped implement the support for complex data types
|
||||
and iterators.
|
||||
|
||||
@item
|
||||
John David Anglin for improvements to libstdc++-v3 and the HP-UX port.
|
||||
John David Anglin for threading-related fixes and improvements to
|
||||
libstdc++-v3, and the HP-UX port.
|
||||
|
||||
@item
|
||||
James van Artsdalen wrote the code that makes efficient use of
|
||||
@ -37,6 +34,26 @@ Alasdair Baird for various bugfixes.
|
||||
@item
|
||||
Gerald Baumgartner added the signature extension to the C++ front end.
|
||||
|
||||
@item
|
||||
Godmar Back for his Java improvements and encouragement.
|
||||
|
||||
@item
|
||||
Scott Bambrough for help porting the Java compiler.
|
||||
|
||||
@item
|
||||
Jon Beniston for his Win32 port of Java.
|
||||
|
||||
@item
|
||||
Geoff Berry for his Java object serialization work and various patches.
|
||||
|
||||
@item
|
||||
Eric Blake for helping to make GCJ and libgcj conform to the
|
||||
specifications.
|
||||
|
||||
@item
|
||||
Hans-J. Boehm for his @uref{http://www.hpl.hp.com/personal/Hans_Boehm/gc/,,
|
||||
garbage collector}, IA-64 libffi port, and other Java work.
|
||||
|
||||
@item
|
||||
Neil Booth for work on cpplib, lang hooks, debug hooks and other
|
||||
miscellaneous clean-ups.
|
||||
@ -44,9 +61,9 @@ miscellaneous clean-ups.
|
||||
@item
|
||||
Per Bothner for his direction via the steering committee and various
|
||||
improvements to our infrastructure for supporting new languages. Chill
|
||||
and Java front end implementations. Initial implementations of
|
||||
cpplib, fix-header, config.guess, libio, and past C++ library
|
||||
(libg++) maintainer.
|
||||
front end implementation. Initial implementations of
|
||||
cpplib, fix-header, config.guess, libio, and past C++ library (libg++)
|
||||
maintainer. Dreaming up, designing and implementing much of GCJ.
|
||||
|
||||
@item
|
||||
Devon Bowen helped port GCC to the Tahoe.
|
||||
@ -66,6 +83,9 @@ Christian Bruel for improvements to local store elimination.
|
||||
@item
|
||||
Herman A.J. ten Brugge for various fixes.
|
||||
|
||||
@item
|
||||
Joerg Brunsmann for Java compiler hacking and help with the GCJ FAQ.
|
||||
|
||||
@item
|
||||
Joe Buck for his direction via the steering committee.
|
||||
|
||||
@ -73,25 +93,46 @@ Joe Buck for his direction via the steering committee.
|
||||
Craig Burley for leadership of the Fortran effort.
|
||||
|
||||
@item
|
||||
Paolo Carlini for his work on libstdc++-v3.
|
||||
Stephan Buys for contributing Doxygen notes for libstdc++.
|
||||
|
||||
@item
|
||||
Paolo Carlini for libstdc++ work: lots of efficiency improvements to
|
||||
the string class, hard detective work on the frustrating localization
|
||||
issues, and keeping up with the problem reports.
|
||||
|
||||
@item
|
||||
John Carr for his alias work, SPARC hacking, infrastructure improvements,
|
||||
previous contributions to the steering committee, loop optimizations, etc.
|
||||
|
||||
@item
|
||||
Steve Chamberlain wrote the support for the Hitachi SH and H8 processors
|
||||
and the PicoJava processor.
|
||||
Steve Chamberlain for support for the Hitachi SH and H8 processors
|
||||
and the PicoJava processor, and for GCJ config fixes.
|
||||
|
||||
@item
|
||||
Glenn Chambers for help with the GCJ FAQ.
|
||||
|
||||
@item
|
||||
John-Marc Chandonia for various libgcj patches.
|
||||
|
||||
@item
|
||||
Scott Christley for his Objective-C contributions.
|
||||
|
||||
@item
|
||||
Eric Christopher for his Java porting help and clean-ups.
|
||||
|
||||
@item
|
||||
Branko Cibej for more warning contributions.
|
||||
|
||||
@item
|
||||
Nick Clifton for arm, mcore, fr30, v850, m32r work, @option{--help}, and other random
|
||||
hacking.
|
||||
The @uref{http://www.classpath.org,,GNU Classpath project}
|
||||
for all of their merged runtime code.
|
||||
|
||||
@item
|
||||
Nick Clifton for arm, mcore, fr30, v850, m32r work, @option{--help}, and
|
||||
other random hacking.
|
||||
|
||||
@item
|
||||
Michael Cook for libstdc++ cleanup patches to reduce warnings.
|
||||
|
||||
@item
|
||||
Ralf Corsepius for SH testing and minor bugfixing.
|
||||
@ -111,22 +152,51 @@ Dario Dariol contributed the four varieties of sample programs
|
||||
that print a copy of their source.
|
||||
|
||||
@item
|
||||
Ulrich Drepper for his work on the C++ runtime libraries, glibc,
|
||||
testing of GCC using glibc, ISO C99 support, CFG dumping support, etc.
|
||||
Russell Davidson for fstream and stringstream fixes in libstdc++.
|
||||
|
||||
@item
|
||||
Mo DeJong for GCJ and libgcj bug fixes.
|
||||
|
||||
@item
|
||||
Gabriel Dos Reis for contributions to g++, contributions and
|
||||
maintenance of GCC diagnostics infrastructure, libstdc++-v3,
|
||||
including valarray<>, complex<>, maintaining the numerics library
|
||||
(including that pesky <limits> :-) and keeping up-to-date anything
|
||||
to do with numbers.
|
||||
|
||||
@item
|
||||
Ulrich Drepper for his work on glibc, testing of GCC using glibc, ISO C99
|
||||
support, CFG dumping support, etc., plus support of the C++ runtime
|
||||
libraries including for all kinds of C interface issues, contributing and
|
||||
maintaining complex<>, sanity checking and disbursement, configuration
|
||||
architecture, libio maintenance, and early math work.
|
||||
|
||||
@item
|
||||
Richard Earnshaw for his ongoing work with the ARM@.
|
||||
|
||||
@item
|
||||
David Edelsohn for his direction via the steering committee,
|
||||
ongoing work with the RS6000/PowerPC port, and help cleaning up Haifa
|
||||
loop changes.
|
||||
David Edelsohn for his direction via the steering committee, ongoing work
|
||||
with the RS6000/PowerPC port, help cleaning up Haifa loop changes, and
|
||||
for doing the entire AIX port of libstdc++ with his bare hands.
|
||||
|
||||
@item
|
||||
Kevin Ediger for the floating point formatting of num_put::do_put in
|
||||
libstdc++.
|
||||
|
||||
@item
|
||||
Phil Edwards for libstdc++ work including configuration hackery,
|
||||
documentation maintainer, chief breaker of the web pages, the occasional
|
||||
iostream bugfix, and work on shared library symbol versioning.
|
||||
|
||||
@item
|
||||
Paul Eggert for random hacking all over GCC@.
|
||||
|
||||
@item
|
||||
Mark Elbrecht for various DJGPP improvements.
|
||||
Mark Elbrecht for various DJGPP improvements, and for libstdc++
|
||||
configuration support for locales and fstream-related fixes.
|
||||
|
||||
@item
|
||||
Vadim Egorov for libstdc++ fixes in strings, streambufs, and iostreams.
|
||||
|
||||
@item
|
||||
Ben Elliston for his work to move the Objective-C runtime into its
|
||||
@ -142,6 +212,9 @@ and SPARC work.
|
||||
@item
|
||||
Fred Fish for BeOS support and Ada fixes.
|
||||
|
||||
@item
|
||||
Ivan Fontes Garcia for the Portugese translation of the GCJ FAQ.
|
||||
|
||||
@item
|
||||
Peter Gerwinski for various bugfixes and the Pascal front end.
|
||||
|
||||
@ -149,6 +222,9 @@ Peter Gerwinski for various bugfixes and the Pascal front end.
|
||||
Kaveh Ghazi for his direction via the steering committee and
|
||||
amazing work to make @samp{-W -Wall} useful.
|
||||
|
||||
@item
|
||||
John Gilmore for a donation to the FSF earmarked improving GNU Java.
|
||||
|
||||
@item
|
||||
Judy Goldberg for c++ contributions.
|
||||
|
||||
@ -161,6 +237,9 @@ via the steering committee.
|
||||
@item
|
||||
Anthony Green for his @option{-Os} contributions and Java front end work.
|
||||
|
||||
@item
|
||||
Stu Grossman for gdb hacking, allowing GCJ developers to debug our code.
|
||||
|
||||
@item
|
||||
Michael K. Gschwind contributed the port to the PDP-11.
|
||||
|
||||
@ -175,7 +254,7 @@ Bruno Haible for improvements in the runtime overhead for EH, new
|
||||
warnings and assorted bugfixes.
|
||||
|
||||
@item
|
||||
Andrew Haley for his Java work.
|
||||
Andrew Haley for his amazing Java compiler and library efforts.
|
||||
|
||||
@item
|
||||
Chris Hanson assisted in making GCC work on HP-UX for the 9000 series 300.
|
||||
@ -222,7 +301,8 @@ Andreas Jaeger for various fixes to the MIPS port
|
||||
|
||||
@item
|
||||
Jakub Jelinek for his SPARC work and sibling call optimizations as well
|
||||
as lots of bug fixes and test cases.
|
||||
as lots of bug fixes and test cases, and for improving the Java build
|
||||
system.
|
||||
|
||||
@item
|
||||
Janis Johnson for ia64 testing and fixes and for her quality improvement
|
||||
@ -231,18 +311,30 @@ sidetracks.
|
||||
@item
|
||||
J. Kean Johnston for OpenServer support.
|
||||
|
||||
@item
|
||||
Tim Josling for the sample language treelang based originally on Richard
|
||||
Kenner's "``toy'' language".
|
||||
|
||||
@item
|
||||
Nicolai Josuttis for additional libstdc++ documentation.
|
||||
|
||||
@item
|
||||
Klaus Kaempf for his ongoing work to make alpha-vms a viable target.
|
||||
|
||||
@item
|
||||
David Kashtan of SRI adapted GCC to VMS@.
|
||||
|
||||
@item
|
||||
Ryszard Kabatek for many, many libstdc++ bugfixes and optimizations of
|
||||
strings, especially member functions, and for auto_ptr fixes.
|
||||
|
||||
@item
|
||||
Geoffrey Keating for his ongoing work to make the PPC work for GNU/Linux
|
||||
and his automatic regression tester.
|
||||
|
||||
@item
|
||||
Brendan Kehoe for his ongoing work with g++.
|
||||
Brendan Kehoe for his ongoing work with g++ and for a lot of early work
|
||||
in just about every part of libstdc++.
|
||||
|
||||
@item
|
||||
Oliver M. Kellogg of Deutsche Aerospace contributed the port to the
|
||||
@ -260,8 +352,9 @@ elimination and delay slot scheduling. Richard Kenner was also the
|
||||
head maintainer of GCC for several years.
|
||||
|
||||
@item
|
||||
Mumit Khan for various contributions to the cygwin and mingw32 ports and
|
||||
maintaining binary releases for Windows hosts.
|
||||
Mumit Khan for various contributions to the Cygwin and Mingw32 ports and
|
||||
maintaining binary releases for Windows hosts, and for massive libstdc++
|
||||
porting work to Cygwin/Mingw32.
|
||||
|
||||
@item
|
||||
Robin Kirkham for cpu32 support.
|
||||
@ -299,12 +392,16 @@ Ted Lemon wrote parts of the RTL reader and printer.
|
||||
Kriang Lerdsuwanakij for improvements to demangler and various c++ fixes.
|
||||
|
||||
@item
|
||||
Warren Levy major work on libgcj (Java Runtime Library) and random
|
||||
work on the Java front end.
|
||||
Warren Levy for tremendous work on libgcj (Java Runtime Library) and
|
||||
random work on the Java front end.
|
||||
|
||||
@item
|
||||
Alain Lichnewsky ported GCC to the MIPS CPU.
|
||||
|
||||
@item
|
||||
Oskar Liljeblad for hacking on AWT and his many Java bug reports and
|
||||
patches.
|
||||
|
||||
@item
|
||||
Robert Lipe for OpenServer support, new testsuites, testing, etc.
|
||||
|
||||
@ -317,7 +414,8 @@ runtime libraries.
|
||||
|
||||
@item
|
||||
Martin von L@"owis for internal consistency checking infrastructure,
|
||||
and various C++ improvements including namespace support.
|
||||
various C++ improvements including namespace support, and tons of
|
||||
assistance with libstdc++/compiler merges.
|
||||
|
||||
@item
|
||||
H.J. Lu for his previous contributions to the steering committee, many x86
|
||||
@ -331,13 +429,29 @@ Andrew MacLeod for his ongoing work in building a real EH system,
|
||||
various code generation improvements, work on the global optimizer, etc.
|
||||
|
||||
@item
|
||||
Vladimir Makarov for hacking some ugly i960 problems, PowerPC
|
||||
hacking improvements to compile-time performance and overall knowledge
|
||||
and direction in the area of instruction scheduling.
|
||||
Vladimir Makarov for hacking some ugly i960 problems, PowerPC hacking
|
||||
improvements to compile-time performance, overall knowledge and
|
||||
direction in the area of instruction scheduling, and design and
|
||||
implementation of the automaton based instruction scheduler.
|
||||
|
||||
@item
|
||||
Bob Manson for his behind the scenes work on dejagnu.
|
||||
|
||||
@item
|
||||
Philip Martin for lots of libstdc++ string and vector iterator fixes and
|
||||
improvements, and string clean up and testsuites.
|
||||
|
||||
@item
|
||||
All of the Mauve project
|
||||
@uref{http://sources.redhat.com/cgi-bin/cvsweb.cgi/~checkout~/mauve/THANKS?rev=1.2&cvsroot=mauve&only_with_tag=HEAD,,contributors},
|
||||
for Java test code.
|
||||
|
||||
@item
|
||||
Bryce McKinlay for numerous GCJ and libgcj fixes and improvements.
|
||||
|
||||
@item
|
||||
Adam Megacz for his work on the Win32 port of GCJ.
|
||||
|
||||
@item
|
||||
Michael Meissner for LRS framework, ia32, m32r, v850, m88k, MIPS,
|
||||
powerpc, haifa, ECOFF debug support, and other assorted hacking.
|
||||
@ -354,6 +468,10 @@ developers.
|
||||
@item
|
||||
Gary Miller ported GCC to Charles River Data Systems machines.
|
||||
|
||||
@item
|
||||
Alfred Minarik for libstdc++ string and ios bugfixes, and turning the
|
||||
entire libstdc++ testsuite namespace-compatible.
|
||||
|
||||
@item
|
||||
Mark Mitchell for his direction via the steering committee, mountains of
|
||||
C++ work, load/store hoisting out of loops, alias analysis improvements,
|
||||
@ -369,13 +487,17 @@ maintenance, and his ongoing work to make us make Fortran run fast.
|
||||
@item
|
||||
Jason Molenda for major help in the care and feeding of all the services
|
||||
on the gcc.gnu.org (formerly egcs.cygnus.com) machine---mail, web
|
||||
services, ftp services, etc etc.
|
||||
services, ftp services, etc etc. Doing all this work on scrap paper and
|
||||
the backs of envelopes would have been... difficult.
|
||||
|
||||
@item
|
||||
Catherine Moore for fixing various ugly problems we have sent her
|
||||
way, including the haifa bug which was killing the Alpha & PowerPC
|
||||
Linux kernels.
|
||||
|
||||
@item
|
||||
Mike Moreton for his various Java patches.
|
||||
|
||||
@item
|
||||
David Mosberger-Tang for various Alpha improvements.
|
||||
|
||||
@ -395,7 +517,14 @@ Joseph S. Myers for his work on the PDP-11 port, format checking and ISO
|
||||
C99 support, and continuous emphasis on (and contributions to) documentation.
|
||||
|
||||
@item
|
||||
Nathan Myers for his work on libstdc++-v3.
|
||||
Nathan Myers for his work on libstdc++-v3: architecture and authorship
|
||||
through the first three snapshots, including implementation of locale
|
||||
infrastructure, string, shadow C headers, and the initial project
|
||||
documentation (DESIGN, CHECKLIST, and so forth). Later, more work on
|
||||
MT-safe string and shadow headers.
|
||||
|
||||
@item
|
||||
Felix Natter for documentation on porting libstdc++.
|
||||
|
||||
@item
|
||||
NeXT, Inc.@: donated the front end that supports the Objective-C
|
||||
@ -415,20 +544,22 @@ improvements.
|
||||
|
||||
@item
|
||||
Alexandre Oliva for various build infrastructure improvements, scripts and
|
||||
amazing testing work.
|
||||
amazing testing work, including keeping libtool issues sane and happy.
|
||||
|
||||
@item
|
||||
Melissa O'Neill for various NeXT fixes.
|
||||
|
||||
@item
|
||||
Rainer Orth for random MIPS work, including improvements to our o32
|
||||
ABI support, improvements to dejagnu's MIPS support, etc.
|
||||
ABI support, improvements to dejagnu's MIPS support, Java configuration
|
||||
clean-ups and porting work, etc.
|
||||
|
||||
@item
|
||||
Paul Petersen wrote the machine description for the Alliant FX/8.
|
||||
|
||||
@item
|
||||
Alexandre Petit-Bianco for his Java work.
|
||||
Alexandre Petit-Bianco for implementing much of the Java compiler and
|
||||
continued Java maintainership.
|
||||
|
||||
@item
|
||||
Matthias Pfaller for major improvements to the NS32k port.
|
||||
@ -447,19 +578,20 @@ Ken Raeburn for various improvements to checker, MIPS ports and various
|
||||
cleanups in the compiler.
|
||||
|
||||
@item
|
||||
David Reese of Sun Microsystems contributed to the Solaris on PowerPC
|
||||
port.
|
||||
Rolf W. Rasmussen for hacking on AWT.
|
||||
|
||||
@item
|
||||
Gabriel Dos Reis for contributions and maintenance of libstdc++-v3,
|
||||
including valarray implementation and limits support.
|
||||
David Reese of Sun Microsystems contributed to the Solaris on PowerPC
|
||||
port.
|
||||
|
||||
@item
|
||||
Joern Rennecke for maintaining the sh port, loop, regmove & reload
|
||||
hacking.
|
||||
|
||||
@item
|
||||
Loren J. Rittle for improvements to libstdc++-v3 and the FreeBSD port.
|
||||
Loren J. Rittle for improvements to libstdc++-v3 including the FreeBSD
|
||||
port, threading fixes, thread-related configury changes, critical
|
||||
threading documentation, and solutions to really tricky I/O problems.
|
||||
|
||||
@item
|
||||
Craig Rodrigues for processing tons of bug reports.
|
||||
@ -473,12 +605,19 @@ Ken Rose for fixes to our delay slot filling code.
|
||||
@item
|
||||
Paul Rubin wrote most of the preprocessor.
|
||||
|
||||
@item
|
||||
Chip Salzenberg for libstdc++ patches and improvements to locales, traits,
|
||||
Makefiles, libio, libtool hackery, and ``long long'' support.
|
||||
|
||||
@item
|
||||
Juha Sarlin for improvements to the H8 code generator.
|
||||
|
||||
@item
|
||||
Greg Satz assisted in making GCC work on HP-UX for the 9000 series 300.
|
||||
|
||||
@item
|
||||
Bradley Schatz for his work on the GCJ FAQ.
|
||||
|
||||
@item
|
||||
Peter Schauer wrote the code to allow debugging to work on the Alpha.
|
||||
|
||||
@ -490,6 +629,14 @@ Bernd Schmidt for various code generation improvements and major
|
||||
work in the reload pass as well a serving as release manager for
|
||||
GCC 2.95.3.
|
||||
|
||||
@item
|
||||
Peter Schmid for constant testing of libstdc++ -- especially application
|
||||
testing, going above and beyond what was requested for the release
|
||||
criteria -- and libstdc++ header file tweaks.
|
||||
|
||||
@item
|
||||
Jason Schroeder for jcf-dump patches.
|
||||
|
||||
@item
|
||||
Andreas Schwab for his work on the m68k port.
|
||||
|
||||
@ -505,6 +652,10 @@ Jeffrey Siegal for helping RMS with the original design of GCC, some
|
||||
code which handles the parse tree and RTL data structures, constant
|
||||
folding and help with the original VAX & m68k ports.
|
||||
|
||||
@item
|
||||
Kenny Simpson for prompting libstdc++ fixes due to defect reports from
|
||||
the LWG (thereby keeping us in line with updates from the ISO).
|
||||
|
||||
@item
|
||||
Franz Sirl for his ongoing work with making the PPC port stable
|
||||
for linux.
|
||||
@ -519,7 +670,11 @@ Christopher Smith did the port for Convex machines.
|
||||
Randy Smith finished the Sun FPA support.
|
||||
|
||||
@item
|
||||
Scott Snyder for various fixes.
|
||||
Scott Snyder for queue, iterator, istream, and string fixes and libstdc++
|
||||
testsuite entries.
|
||||
|
||||
@item
|
||||
Brad Spencer for contributions to the GLIBCPP_FORCE_NEW technique.
|
||||
|
||||
@item
|
||||
Richard Stallman, for writing the original gcc and launching the GNU project.
|
||||
@ -537,10 +692,16 @@ Jonathan Stone wrote the machine description for the Pyramid computer.
|
||||
@item
|
||||
Graham Stott for various infrastructure improvements.
|
||||
|
||||
@item
|
||||
John Stracke for his Java HTTP protocol fixes.
|
||||
|
||||
@item
|
||||
Mike Stump for his Elxsi port, g++ contributions over the years and more
|
||||
recently his vxworks contributions
|
||||
|
||||
@item
|
||||
Jeff Sturm for Java porting help, bug fixes, and encouragement.
|
||||
|
||||
@item
|
||||
Shigeya Suzuki for this fixes for the bsdi platforms.
|
||||
|
||||
@ -557,15 +718,21 @@ Gary Thomas for his ongoing work to make the PPC work for GNU/Linux.
|
||||
@item
|
||||
Philipp Thomas for random bugfixes throughout the compiler
|
||||
|
||||
@item
|
||||
Jason Thorpe for thread support in libstdc++ on NetBSD.
|
||||
|
||||
@item
|
||||
Kresten Krab Thorup wrote the run time support for the Objective-C
|
||||
language.
|
||||
language and the fantastic Java bytecode interpreter.
|
||||
|
||||
@item
|
||||
Michael Tiemann for random bugfixes, the first instruction scheduler,
|
||||
initial C++ support, function integration, NS32k, SPARC and M88k
|
||||
machine description work, delay slot scheduling.
|
||||
|
||||
@item
|
||||
Andreas Tobler for his work porting libgcj to Darwin.
|
||||
|
||||
@item
|
||||
Teemu Torma for thread safe exception handling support.
|
||||
|
||||
@ -574,15 +741,27 @@ Leonard Tower wrote parts of the parser, RTL generator, and RTL
|
||||
definitions, and of the VAX machine description.
|
||||
|
||||
@item
|
||||
Tom Tromey for internationalization support and his Java work.
|
||||
Tom Tromey for internationalization support and for his many Java
|
||||
contributions and libgcj maintainership.
|
||||
|
||||
@item
|
||||
Lassi Tuura for improvements to config.guess to determine HP processor
|
||||
types.
|
||||
|
||||
@item
|
||||
Petter Urkedal for libstdc++ CXXFLAGS, math, and algorithms fixes.
|
||||
|
||||
@item
|
||||
Brent Verner for work with the libstdc++ cshadow files and their
|
||||
associated configure steps.
|
||||
|
||||
@item
|
||||
Todd Vierling for contributions for NetBSD ports.
|
||||
|
||||
@item
|
||||
Jonathan Wakely for contributing libstdc++ Doxygen notes and XHTML
|
||||
guidance.
|
||||
|
||||
@item
|
||||
Dean Wakerley for converting the install documentation from HTML to texinfo
|
||||
in time for GCC 3.0.
|
||||
@ -590,6 +769,11 @@ in time for GCC 3.0.
|
||||
@item
|
||||
Krister Walfridsson for random bugfixes.
|
||||
|
||||
@item
|
||||
Stephen M. Webb for time and effort on making libstdc++ shadow files
|
||||
work with the tricky Solaris 8+ headers, and for pushing the build-time
|
||||
header tree.
|
||||
|
||||
@item
|
||||
John Wehle for various improvements for the x86 code generator,
|
||||
related infrastructure improvements to help x86 code generation,
|
||||
@ -598,6 +782,16 @@ value range propagation and other work, WE32k port.
|
||||
@item
|
||||
Zack Weinberg for major work on cpplib and various other bugfixes.
|
||||
|
||||
@item
|
||||
Matt Welsh for help with Linux Threads support in GCJ.
|
||||
|
||||
@item
|
||||
Urban Widmark for help fixing java.io.
|
||||
|
||||
@item
|
||||
Mark Wielaard for new Java library code and his work integrating with
|
||||
Classpath.
|
||||
|
||||
@item
|
||||
Dale Wiles helped port GCC to the Tahoe.
|
||||
|
||||
@ -622,6 +816,9 @@ description for the Tron architecture (specifically, the Gmicro).
|
||||
@item
|
||||
Kevin Zachmann helped ported GCC to the Tahoe.
|
||||
|
||||
@item
|
||||
Gilles Zunino for help porting Java to Irix.
|
||||
|
||||
@end itemize
|
||||
|
||||
|
||||
@ -629,12 +826,36 @@ We'd also like to thank the folks who have contributed time and energy in
|
||||
testing GCC:
|
||||
|
||||
@itemize @bullet
|
||||
@item
|
||||
Michael Abd-El-Malek
|
||||
|
||||
@item
|
||||
Thomas Arend
|
||||
|
||||
@item
|
||||
Bonzo Armstrong
|
||||
|
||||
@item
|
||||
Steven Ashe
|
||||
|
||||
@item
|
||||
Chris Baldwin
|
||||
|
||||
@item
|
||||
David Billinghurst
|
||||
|
||||
@item
|
||||
Jim Blandy
|
||||
|
||||
@item
|
||||
Stephane Bortzmeyer
|
||||
|
||||
@item
|
||||
Horst von Brand
|
||||
|
||||
@item
|
||||
Frank Braun
|
||||
|
||||
@item
|
||||
Rodney Brown
|
||||
|
||||
@ -644,39 +865,111 @@ Joe Buck
|
||||
@item
|
||||
Craig Burley
|
||||
|
||||
@item
|
||||
Sidney Cadot
|
||||
|
||||
@item
|
||||
Bradford Castalia
|
||||
|
||||
@item
|
||||
Ralph Doncaster
|
||||
|
||||
@item
|
||||
Ulrich Drepper
|
||||
|
||||
@item
|
||||
David Edelsohn
|
||||
|
||||
@item
|
||||
Richard Emberson
|
||||
|
||||
@item
|
||||
Levente Farkas
|
||||
|
||||
@item
|
||||
Graham Fawcett
|
||||
|
||||
@item
|
||||
Robert A. French
|
||||
|
||||
@item
|
||||
J@"orgen Freyh
|
||||
|
||||
@item
|
||||
Mark K. Gardner
|
||||
|
||||
@item
|
||||
Charles-Antoine Gauthier
|
||||
|
||||
@item
|
||||
Yung Shing Gene
|
||||
|
||||
@item
|
||||
Kaveh Ghazi
|
||||
|
||||
@item
|
||||
David Gilbert
|
||||
|
||||
@item
|
||||
Simon Gornall
|
||||
|
||||
@item
|
||||
Fred Gray
|
||||
|
||||
@item
|
||||
John Griffin
|
||||
|
||||
@item
|
||||
Patrik Hagglund
|
||||
|
||||
@item
|
||||
Phil Hargett
|
||||
|
||||
@item
|
||||
Amancio Hasty
|
||||
|
||||
@item
|
||||
Bryan W. Headley
|
||||
|
||||
@item
|
||||
Kate Hedstrom
|
||||
|
||||
@item
|
||||
Richard Henderson
|
||||
|
||||
@item
|
||||
Kevin B. Hendricks
|
||||
|
||||
@item
|
||||
Manfred Hollstein
|
||||
|
||||
@item
|
||||
Kamil Iskra
|
||||
|
||||
@item
|
||||
Joep Jansen
|
||||
|
||||
@item
|
||||
Christian Joensson
|
||||
|
||||
@item
|
||||
David Kidd
|
||||
|
||||
@item
|
||||
Tobias Kuipers
|
||||
|
||||
@item
|
||||
Anand Krishnaswamy
|
||||
|
||||
@item
|
||||
Jeff Law
|
||||
|
||||
@item
|
||||
Robert Lipe
|
||||
|
||||
@item
|
||||
llewelly
|
||||
|
||||
@item
|
||||
Damon Love
|
||||
|
||||
@ -698,27 +991,63 @@ Matthias Klose
|
||||
@item
|
||||
Martin Knoblauch
|
||||
|
||||
@item
|
||||
Jesse Macnish
|
||||
|
||||
@item
|
||||
David Miller
|
||||
|
||||
@item
|
||||
Toon Moene
|
||||
|
||||
@item
|
||||
Stefan Morrell
|
||||
|
||||
@item
|
||||
Anon A. Mous
|
||||
|
||||
@item
|
||||
Matthias Mueller
|
||||
|
||||
@item
|
||||
Pekka Nikander
|
||||
|
||||
@item
|
||||
Alexandre Oliva
|
||||
|
||||
@item
|
||||
Jon Olson
|
||||
|
||||
@item
|
||||
Magnus Persson
|
||||
|
||||
@item
|
||||
Chris Pollard
|
||||
|
||||
@item
|
||||
Richard Polton
|
||||
|
||||
@item
|
||||
David Rees
|
||||
|
||||
@item
|
||||
Paul Reilly
|
||||
|
||||
@item
|
||||
Tom Reilly
|
||||
|
||||
@item
|
||||
Loren J. Rittle
|
||||
|
||||
@item
|
||||
Torsten Rueger
|
||||
|
||||
@item
|
||||
Danny Sadinoff
|
||||
|
||||
@item
|
||||
Marc Schifer
|
||||
|
||||
@item
|
||||
Peter Schmid
|
||||
|
||||
@ -731,12 +1060,27 @@ Vin Shelton
|
||||
@item
|
||||
Franz Sirl
|
||||
|
||||
@item
|
||||
Tim Souder
|
||||
|
||||
@item
|
||||
Mike Stump
|
||||
|
||||
@item
|
||||
Adam Sulmicki
|
||||
|
||||
@item
|
||||
George Talbot
|
||||
|
||||
@item
|
||||
Gregory Warnes
|
||||
|
||||
@item
|
||||
Carlo Wood
|
||||
|
||||
@item
|
||||
David E. Young
|
||||
|
||||
@item
|
||||
And many others
|
||||
@end itemize
|
||||
|
817
contrib/gcc/doc/cpp.1
Normal file
817
contrib/gcc/doc/cpp.1
Normal file
@ -0,0 +1,817 @@
|
||||
.\" Automatically generated by Pod::Man version 1.15
|
||||
.\" Tue Nov 19 18:17:13 2002
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ======================================================================
|
||||
.de Sh \" Subsection heading
|
||||
.br
|
||||
.if t .Sp
|
||||
.ne 5
|
||||
.PP
|
||||
\fB\\$1\fR
|
||||
.PP
|
||||
..
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.de Ip \" List item
|
||||
.br
|
||||
.ie \\n(.$>=3 .ne \\$3
|
||||
.el .ne 3
|
||||
.IP "\\$1" \\$2
|
||||
..
|
||||
.de Vb \" Begin verbatim text
|
||||
.ft CW
|
||||
.nf
|
||||
.ne \\$1
|
||||
..
|
||||
.de Ve \" End verbatim text
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.\" Set up some character translations and predefined strings. \*(-- will
|
||||
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
||||
.\" double quote, and \*(R" will give a right double quote. | will give a
|
||||
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used
|
||||
.\" to do unbreakable dashes and therefore won't be available. \*(C` and
|
||||
.\" \*(C' expand to `' in nroff, nothing in troff, for use with C<>
|
||||
.tr \(*W-|\(bv\*(Tr
|
||||
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
||||
.ie n \{\
|
||||
. ds -- \(*W-
|
||||
. ds PI pi
|
||||
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
||||
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
||||
. ds L" ""
|
||||
. ds R" ""
|
||||
. ds C` ""
|
||||
. ds C' ""
|
||||
'br\}
|
||||
.el\{\
|
||||
. ds -- \|\(em\|
|
||||
. ds PI \(*p
|
||||
. ds L" ``
|
||||
. ds R" ''
|
||||
'br\}
|
||||
.\"
|
||||
.\" If the F register is turned on, we'll generate index entries on stderr
|
||||
.\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and
|
||||
.\" index entries marked with X<> in POD. Of course, you'll have to process
|
||||
.\" the output yourself in some meaningful fashion.
|
||||
.if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. nr % 0
|
||||
. rr F
|
||||
.\}
|
||||
.\"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it
|
||||
.\" makes way too many mistakes in technical documents.
|
||||
.hy 0
|
||||
.if n .na
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
.bd B 3
|
||||
. \" fudge factors for nroff and troff
|
||||
.if n \{\
|
||||
. ds #H 0
|
||||
. ds #V .8m
|
||||
. ds #F .3m
|
||||
. ds #[ \f1
|
||||
. ds #] \fP
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
||||
. ds #V .6m
|
||||
. ds #F 0
|
||||
. ds #[ \&
|
||||
. ds #] \&
|
||||
.\}
|
||||
. \" simple accents for nroff and troff
|
||||
.if n \{\
|
||||
. ds ' \&
|
||||
. ds ` \&
|
||||
. ds ^ \&
|
||||
. ds , \&
|
||||
. ds ~ ~
|
||||
. ds /
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
||||
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
||||
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
||||
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
||||
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
||||
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
||||
.\}
|
||||
. \" troff and (daisy-wheel) nroff accents
|
||||
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
||||
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
||||
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
||||
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
||||
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
||||
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
||||
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
||||
.ds ae a\h'-(\w'a'u*4/10)'e
|
||||
.ds Ae A\h'-(\w'A'u*4/10)'E
|
||||
. \" corrections for vroff
|
||||
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
||||
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
||||
. \" for low resolution devices (crt and lpr)
|
||||
.if \n(.H>23 .if \n(.V>19 \
|
||||
\{\
|
||||
. ds : e
|
||||
. ds 8 ss
|
||||
. ds o a
|
||||
. ds d- d\h'-1'\(ga
|
||||
. ds D- D\h'-1'\(hy
|
||||
. ds th \o'bp'
|
||||
. ds Th \o'LP'
|
||||
. ds ae ae
|
||||
. ds Ae AE
|
||||
.\}
|
||||
.rm #[ #] #H #V #F C
|
||||
.\" ======================================================================
|
||||
.\"
|
||||
.IX Title "CPP 1"
|
||||
.TH CPP 1 "gcc-3.2.1" "2002-11-19" "GNU"
|
||||
.UC
|
||||
.SH "NAME"
|
||||
cpp \- The C Preprocessor
|
||||
.SH "SYNOPSIS"
|
||||
.IX Header "SYNOPSIS"
|
||||
cpp [\fB\-D\fR\fImacro\fR[=\fIdefn\fR]...] [\fB\-U\fR\fImacro\fR]
|
||||
[\fB\-I\fR\fIdir\fR...] [\fB\-W\fR\fIwarn\fR...]
|
||||
[\fB\-M\fR|\fB\-MM\fR] [\fB\-MG\fR] [\fB\-MF\fR \fIfilename\fR]
|
||||
[\fB\-MP\fR] [\fB\-MQ\fR \fItarget\fR...] [\fB\-MT\fR \fItarget\fR...]
|
||||
[\fB\-x\fR \fIlanguage\fR] [\fB\-std=\fR\fIstandard\fR]
|
||||
\fIinfile\fR \fIoutfile\fR
|
||||
.PP
|
||||
Only the most useful options are listed here; see below for the remainder.
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
The C preprocessor, often known as \fIcpp\fR, is a \fImacro processor\fR
|
||||
that is used automatically by the C compiler to transform your program
|
||||
before compilation. It is called a macro processor because it allows
|
||||
you to define \fImacros\fR, which are brief abbreviations for longer
|
||||
constructs.
|
||||
.PP
|
||||
The C preprocessor is intended to be used only with C, \*(C+, and
|
||||
Objective-C source code. In the past, it has been abused as a general
|
||||
text processor. It will choke on input which does not obey C's lexical
|
||||
rules. For example, apostrophes will be interpreted as the beginning of
|
||||
character constants, and cause errors. Also, you cannot rely on it
|
||||
preserving characteristics of the input which are not significant to
|
||||
C-family languages. If a Makefile is preprocessed, all the hard tabs
|
||||
will be removed, and the Makefile will not work.
|
||||
.PP
|
||||
Having said that, you can often get away with using cpp on things which
|
||||
are not C. Other Algol-ish programming languages are often safe
|
||||
(Pascal, Ada, etc.) So is assembly, with caution. \fB\-traditional\fR
|
||||
mode preserves more white space, and is otherwise more permissive. Many
|
||||
of the problems can be avoided by writing C or \*(C+ style comments
|
||||
instead of native language comments, and keeping macros simple.
|
||||
.PP
|
||||
Wherever possible, you should use a preprocessor geared to the language
|
||||
you are writing in. Modern versions of the \s-1GNU\s0 assembler have macro
|
||||
facilities. Most high level programming languages have their own
|
||||
conditional compilation and inclusion mechanism. If all else fails,
|
||||
try a true general text processor, such as \s-1GNU\s0 M4.
|
||||
.PP
|
||||
C preprocessors vary in some details. This manual discusses the \s-1GNU\s0 C
|
||||
preprocessor, which provides a small superset of the features of \s-1ISO\s0
|
||||
Standard C. In its default mode, the \s-1GNU\s0 C preprocessor does not do a
|
||||
few things required by the standard. These are features which are
|
||||
rarely, if ever, used, and may cause surprising changes to the meaning
|
||||
of a program which does not expect them. To get strict \s-1ISO\s0 Standard C,
|
||||
you should use the \fB\-std=c89\fR or \fB\-std=c99\fR options, depending
|
||||
on which version of the standard you want. To get all the mandatory
|
||||
diagnostics, you must also use \fB\-pedantic\fR.
|
||||
.SH "OPTIONS"
|
||||
.IX Header "OPTIONS"
|
||||
The C preprocessor expects two file names as arguments, \fIinfile\fR and
|
||||
\&\fIoutfile\fR. The preprocessor reads \fIinfile\fR together with any
|
||||
other files it specifies with \fB#include\fR. All the output generated
|
||||
by the combined input files is written in \fIoutfile\fR.
|
||||
.PP
|
||||
Either \fIinfile\fR or \fIoutfile\fR may be \fB-\fR, which as
|
||||
\&\fIinfile\fR means to read from standard input and as \fIoutfile\fR
|
||||
means to write to standard output. Also, if either file is omitted, it
|
||||
means the same as if \fB-\fR had been specified for that file.
|
||||
.PP
|
||||
Unless otherwise noted, or the option ends in \fB=\fR, all options
|
||||
which take an argument may have that argument appear either immediately
|
||||
after the option, or with a space between option and argument:
|
||||
\&\fB\-Ifoo\fR and \fB\-I foo\fR have the same effect.
|
||||
.PP
|
||||
Many options have multi-letter names; therefore multiple single-letter
|
||||
options may \fInot\fR be grouped: \fB\-dM\fR is very different from
|
||||
\&\fB\-d\ \-M\fR.
|
||||
.Ip "\fB\-D\fR \fIname\fR" 4
|
||||
.IX Item "-D name"
|
||||
Predefine \fIname\fR as a macro, with definition \f(CW\*(C`1\*(C'\fR.
|
||||
.Ip "\fB\-D\fR \fIname\fR\fB=\fR\fIdefinition\fR" 4
|
||||
.IX Item "-D name=definition"
|
||||
Predefine \fIname\fR as a macro, with definition \fIdefinition\fR.
|
||||
There are no restrictions on the contents of \fIdefinition\fR, but if
|
||||
you are invoking the preprocessor from a shell or shell-like program you
|
||||
may need to use the shell's quoting syntax to protect characters such as
|
||||
spaces that have a meaning in the shell syntax.
|
||||
.Sp
|
||||
If you wish to define a function-like macro on the command line, write
|
||||
its argument list with surrounding parentheses before the equals sign
|
||||
(if any). Parentheses are meaningful to most shells, so you will need
|
||||
to quote the option. With \fBsh\fR and \fBcsh\fR,
|
||||
\&\fB\-D'\fR\fIname\fR\fB(\fR\fIargs...\fR\fB)=\fR\fIdefinition\fR\fB'\fR works.
|
||||
.Sp
|
||||
\&\fB\-D\fR and \fB\-U\fR options are processed in the order they
|
||||
are given on the command line. All \fB\-imacros\fR \fIfile\fR and
|
||||
\&\fB\-include\fR \fIfile\fR options are processed after all
|
||||
\&\fB\-D\fR and \fB\-U\fR options.
|
||||
.Ip "\fB\-U\fR \fIname\fR" 4
|
||||
.IX Item "-U name"
|
||||
Cancel any previous definition of \fIname\fR, either built in or
|
||||
provided with a \fB\-D\fR option.
|
||||
.Ip "\fB\-undef\fR" 4
|
||||
.IX Item "-undef"
|
||||
Do not predefine any system-specific macros. The common predefined
|
||||
macros remain defined.
|
||||
.Ip "\fB\-I\fR \fIdir\fR" 4
|
||||
.IX Item "-I dir"
|
||||
Add the directory \fIdir\fR to the list of directories to be searched
|
||||
for header files.
|
||||
.Sp
|
||||
Directories named by \fB\-I\fR are searched before the standard
|
||||
system include directories.
|
||||
.Sp
|
||||
It is dangerous to specify a standard system include directory in an
|
||||
\&\fB\-I\fR option. This defeats the special treatment of system
|
||||
headers
|
||||
\&. It can also defeat the repairs to buggy system headers which \s-1GCC\s0
|
||||
makes when it is installed.
|
||||
.Ip "\fB\-o\fR \fIfile\fR" 4
|
||||
.IX Item "-o file"
|
||||
Write output to \fIfile\fR. This is the same as specifying \fIfile\fR
|
||||
as the second non-option argument to \fBcpp\fR. \fBgcc\fR has a
|
||||
different interpretation of a second non-option argument, so you must
|
||||
use \fB\-o\fR to specify the output file.
|
||||
.Ip "\fB\-Wall\fR" 4
|
||||
.IX Item "-Wall"
|
||||
Turns on all optional warnings which are desirable for normal code. At
|
||||
present this is \fB\-Wcomment\fR and \fB\-Wtrigraphs\fR. Note that
|
||||
many of the preprocessor's warnings are on by default and have no
|
||||
options to control them.
|
||||
.Ip "\fB\-Wcomment\fR" 4
|
||||
.IX Item "-Wcomment"
|
||||
.PD 0
|
||||
.Ip "\fB\-Wcomments\fR" 4
|
||||
.IX Item "-Wcomments"
|
||||
.PD
|
||||
Warn whenever a comment-start sequence \fB/*\fR appears in a \fB/*\fR
|
||||
comment, or whenever a backslash-newline appears in a \fB//\fR comment.
|
||||
(Both forms have the same effect.)
|
||||
.Ip "\fB\-Wtrigraphs\fR" 4
|
||||
.IX Item "-Wtrigraphs"
|
||||
Warn if any trigraphs are encountered. This option used to take effect
|
||||
only if \fB\-trigraphs\fR was also specified, but now works
|
||||
independently. Warnings are not given for trigraphs within comments, as
|
||||
they do not affect the meaning of the program.
|
||||
.Ip "\fB\-Wtraditional\fR" 4
|
||||
.IX Item "-Wtraditional"
|
||||
Warn about certain constructs that behave differently in traditional and
|
||||
\&\s-1ISO\s0 C. Also warn about \s-1ISO\s0 C constructs that have no traditional C
|
||||
equivalent, and problematic constructs which should be avoided.
|
||||
.Ip "\fB\-Wimport\fR" 4
|
||||
.IX Item "-Wimport"
|
||||
Warn the first time \fB#import\fR is used.
|
||||
.Ip "\fB\-Wundef\fR" 4
|
||||
.IX Item "-Wundef"
|
||||
Warn whenever an identifier which is not a macro is encountered in an
|
||||
\&\fB#if\fR directive, outside of \fBdefined\fR. Such identifiers are
|
||||
replaced with zero.
|
||||
.Ip "\fB\-Werror\fR" 4
|
||||
.IX Item "-Werror"
|
||||
Make all warnings into hard errors. Source code which triggers warnings
|
||||
will be rejected.
|
||||
.Ip "\fB\-Wsystem-headers\fR" 4
|
||||
.IX Item "-Wsystem-headers"
|
||||
Issue warnings for code in system headers. These are normally unhelpful
|
||||
in finding bugs in your own code, therefore suppressed. If you are
|
||||
responsible for the system library, you may want to see them.
|
||||
.Ip "\fB\-w\fR" 4
|
||||
.IX Item "-w"
|
||||
Suppress all warnings, including those which \s-1GNU\s0 \s-1CPP\s0 issues by default.
|
||||
.Ip "\fB\-pedantic\fR" 4
|
||||
.IX Item "-pedantic"
|
||||
Issue all the mandatory diagnostics listed in the C standard. Some of
|
||||
them are left out by default, since they trigger frequently on harmless
|
||||
code.
|
||||
.Ip "\fB\-pedantic-errors\fR" 4
|
||||
.IX Item "-pedantic-errors"
|
||||
Issue all the mandatory diagnostics, and make all mandatory diagnostics
|
||||
into errors. This includes mandatory diagnostics that \s-1GCC\s0 issues
|
||||
without \fB\-pedantic\fR but treats as warnings.
|
||||
.Ip "\fB\-M\fR" 4
|
||||
.IX Item "-M"
|
||||
Instead of outputting the result of preprocessing, output a rule
|
||||
suitable for \fBmake\fR describing the dependencies of the main
|
||||
source file. The preprocessor outputs one \fBmake\fR rule containing
|
||||
the object file name for that source file, a colon, and the names of all
|
||||
the included files, including those coming from \fB\-include\fR or
|
||||
\&\fB\-imacros\fR command line options.
|
||||
.Sp
|
||||
Unless specified explicitly (with \fB\-MT\fR or \fB\-MQ\fR), the
|
||||
object file name consists of the basename of the source file with any
|
||||
suffix replaced with object file suffix. If there are many included
|
||||
files then the rule is split into several lines using \fB\e\fR\-newline.
|
||||
The rule has no commands.
|
||||
.Sp
|
||||
This option does not suppress the preprocessor's debug output, such as
|
||||
\&\fB\-dM\fR. To avoid mixing such debug output with the dependency
|
||||
rules you should explicitly specify the dependency output file with
|
||||
\&\fB\-MF\fR, or use an environment variable like
|
||||
\&\fB\s-1DEPENDENCIES_OUTPUT\s0\fR. Debug output
|
||||
will still be sent to the regular output stream as normal.
|
||||
.Sp
|
||||
Passing \fB\-M\fR to the driver implies \fB\-E\fR.
|
||||
.Ip "\fB\-MM\fR" 4
|
||||
.IX Item "-MM"
|
||||
Like \fB\-M\fR but do not mention header files that are found in
|
||||
system header directories, nor header files that are included,
|
||||
directly or indirectly, from such a header.
|
||||
.Sp
|
||||
This implies that the choice of angle brackets or double quotes in an
|
||||
\&\fB#include\fR directive does not in itself determine whether that
|
||||
header will appear in \fB\-MM\fR dependency output. This is a
|
||||
slight change in semantics from \s-1GCC\s0 versions 3.0 and earlier.
|
||||
.Ip "\fB\-MF\fR \fIfile\fR" 4
|
||||
.IX Item "-MF file"
|
||||
@anchor{\-MF}
|
||||
When used with \fB\-M\fR or \fB\-MM\fR, specifies a
|
||||
file to write the dependencies to. If no \fB\-MF\fR switch is given
|
||||
the preprocessor sends the rules to the same place it would have sent
|
||||
preprocessed output.
|
||||
.Sp
|
||||
When used with the driver options \fB\-MD\fR or \fB\-MMD\fR,
|
||||
\&\fB\-MF\fR overrides the default dependency output file.
|
||||
.Ip "\fB\-MG\fR" 4
|
||||
.IX Item "-MG"
|
||||
When used with \fB\-M\fR or \fB\-MM\fR, \fB\-MG\fR says to treat missing
|
||||
header files as generated files and assume they live in the same
|
||||
directory as the source file. It suppresses preprocessed output, as a
|
||||
missing header file is ordinarily an error.
|
||||
.Sp
|
||||
This feature is used in automatic updating of makefiles.
|
||||
.Ip "\fB\-MP\fR" 4
|
||||
.IX Item "-MP"
|
||||
This option instructs \s-1CPP\s0 to add a phony target for each dependency
|
||||
other than the main file, causing each to depend on nothing. These
|
||||
dummy rules work around errors \fBmake\fR gives if you remove header
|
||||
files without updating the \fIMakefile\fR to match.
|
||||
.Sp
|
||||
This is typical output:
|
||||
.Sp
|
||||
.Vb 1
|
||||
\& test.o: test.c test.h
|
||||
.Ve
|
||||
.Vb 1
|
||||
\& test.h:
|
||||
.Ve
|
||||
.Ip "\fB\-MT\fR \fItarget\fR" 4
|
||||
.IX Item "-MT target"
|
||||
Change the target of the rule emitted by dependency generation. By
|
||||
default \s-1CPP\s0 takes the name of the main input file, including any path,
|
||||
deletes any file suffix such as \fB.c\fR, and appends the platform's
|
||||
usual object suffix. The result is the target.
|
||||
.Sp
|
||||
An \fB\-MT\fR option will set the target to be exactly the string you
|
||||
specify. If you want multiple targets, you can specify them as a single
|
||||
argument to \fB\-MT\fR, or use multiple \fB\-MT\fR options.
|
||||
.Sp
|
||||
For example, \fB\-MT\ '$(objpfx)foo.o'\fR might give
|
||||
.Sp
|
||||
.Vb 1
|
||||
\& $(objpfx)foo.o: foo.c
|
||||
.Ve
|
||||
.Ip "\fB\-MQ\fR \fItarget\fR" 4
|
||||
.IX Item "-MQ target"
|
||||
Same as \fB\-MT\fR, but it quotes any characters which are special to
|
||||
Make. \fB\-MQ\ '$(objpfx)foo.o'\fR gives
|
||||
.Sp
|
||||
.Vb 1
|
||||
\& $$(objpfx)foo.o: foo.c
|
||||
.Ve
|
||||
The default target is automatically quoted, as if it were given with
|
||||
\&\fB\-MQ\fR.
|
||||
.Ip "\fB\-MD\fR" 4
|
||||
.IX Item "-MD"
|
||||
\&\fB\-MD\fR is equivalent to \fB\-M \-MF\fR \fIfile\fR, except that
|
||||
\&\fB\-E\fR is not implied. The driver determines \fIfile\fR based on
|
||||
whether an \fB\-o\fR option is given. If it is, the driver uses its
|
||||
argument but with a suffix of \fI.d\fR, otherwise it take the
|
||||
basename of the input file and applies a \fI.d\fR suffix.
|
||||
.Sp
|
||||
If \fB\-MD\fR is used in conjunction with \fB\-E\fR, any
|
||||
\&\fB\-o\fR switch is understood to specify the dependency output file
|
||||
(but \f(CW@pxref\fR{\-MF}), but if used without \fB\-E\fR, each \fB\-o\fR
|
||||
is understood to specify a target object file.
|
||||
.Sp
|
||||
Since \fB\-E\fR is not implied, \fB\-MD\fR can be used to generate
|
||||
a dependency output file as a side-effect of the compilation process.
|
||||
.Ip "\fB\-MMD\fR" 4
|
||||
.IX Item "-MMD"
|
||||
Like \fB\-MD\fR except mention only user header files, not system
|
||||
\&\-header files.
|
||||
.Ip "\fB\-x c\fR" 4
|
||||
.IX Item "-x c"
|
||||
.PD 0
|
||||
.Ip "\fB\-x c++\fR" 4
|
||||
.IX Item "-x c++"
|
||||
.Ip "\fB\-x objective-c\fR" 4
|
||||
.IX Item "-x objective-c"
|
||||
.Ip "\fB\-x assembler-with-cpp\fR" 4
|
||||
.IX Item "-x assembler-with-cpp"
|
||||
.PD
|
||||
Specify the source language: C, \*(C+, Objective-C, or assembly. This has
|
||||
nothing to do with standards conformance or extensions; it merely
|
||||
selects which base syntax to expect. If you give none of these options,
|
||||
cpp will deduce the language from the extension of the source file:
|
||||
\&\fB.c\fR, \fB.cc\fR, \fB.m\fR, or \fB.S\fR. Some other common
|
||||
extensions for \*(C+ and assembly are also recognized. If cpp does not
|
||||
recognize the extension, it will treat the file as C; this is the most
|
||||
generic mode.
|
||||
.Sp
|
||||
\&\fBNote:\fR Previous versions of cpp accepted a \fB\-lang\fR option
|
||||
which selected both the language and the standards conformance level.
|
||||
This option has been removed, because it conflicts with the \fB\-l\fR
|
||||
option.
|
||||
.Ip "\fB\-std=\fR\fIstandard\fR" 4
|
||||
.IX Item "-std=standard"
|
||||
.PD 0
|
||||
.Ip "\fB\-ansi\fR" 4
|
||||
.IX Item "-ansi"
|
||||
.PD
|
||||
Specify the standard to which the code should conform. Currently cpp
|
||||
only knows about the standards for C; other language standards will be
|
||||
added in the future.
|
||||
.Sp
|
||||
\&\fIstandard\fR
|
||||
may be one of:
|
||||
.RS 4
|
||||
.if n .Ip "\f(CW""""iso9899:1990""""\fR" 4
|
||||
.el .Ip "\f(CWiso9899:1990\fR" 4
|
||||
.IX Item "iso9899:1990"
|
||||
.PD 0
|
||||
.if n .Ip "\f(CW""""c89""""\fR" 4
|
||||
.el .Ip "\f(CWc89\fR" 4
|
||||
.IX Item "c89"
|
||||
.PD
|
||||
The \s-1ISO\s0 C standard from 1990. \fBc89\fR is the customary shorthand for
|
||||
this version of the standard.
|
||||
.Sp
|
||||
The \fB\-ansi\fR option is equivalent to \fB\-std=c89\fR.
|
||||
.if n .Ip "\f(CW""""iso9899:199409""""\fR" 4
|
||||
.el .Ip "\f(CWiso9899:199409\fR" 4
|
||||
.IX Item "iso9899:199409"
|
||||
The 1990 C standard, as amended in 1994.
|
||||
.if n .Ip "\f(CW""""iso9899:1999""""\fR" 4
|
||||
.el .Ip "\f(CWiso9899:1999\fR" 4
|
||||
.IX Item "iso9899:1999"
|
||||
.PD 0
|
||||
.if n .Ip "\f(CW""""c99""""\fR" 4
|
||||
.el .Ip "\f(CWc99\fR" 4
|
||||
.IX Item "c99"
|
||||
.if n .Ip "\f(CW""""iso9899:199x""""\fR" 4
|
||||
.el .Ip "\f(CWiso9899:199x\fR" 4
|
||||
.IX Item "iso9899:199x"
|
||||
.if n .Ip "\f(CW""""c9x""""\fR" 4
|
||||
.el .Ip "\f(CWc9x\fR" 4
|
||||
.IX Item "c9x"
|
||||
.PD
|
||||
The revised \s-1ISO\s0 C standard, published in December 1999. Before
|
||||
publication, this was known as C9X.
|
||||
.if n .Ip "\f(CW""""gnu89""""\fR" 4
|
||||
.el .Ip "\f(CWgnu89\fR" 4
|
||||
.IX Item "gnu89"
|
||||
The 1990 C standard plus \s-1GNU\s0 extensions. This is the default.
|
||||
.if n .Ip "\f(CW""""gnu99""""\fR" 4
|
||||
.el .Ip "\f(CWgnu99\fR" 4
|
||||
.IX Item "gnu99"
|
||||
.PD 0
|
||||
.if n .Ip "\f(CW""""gnu9x""""\fR" 4
|
||||
.el .Ip "\f(CWgnu9x\fR" 4
|
||||
.IX Item "gnu9x"
|
||||
.PD
|
||||
The 1999 C standard plus \s-1GNU\s0 extensions.
|
||||
.RE
|
||||
.RS 4
|
||||
.RE
|
||||
.Ip "\fB\-I-\fR" 4
|
||||
.IX Item "-I-"
|
||||
Split the include path. Any directories specified with \fB\-I\fR
|
||||
options before \fB\-I-\fR are searched only for headers requested with
|
||||
\&\f(CW\*(C`#include\ "\f(CIfile\f(CW"\*(C'\fR; they are not searched for
|
||||
\&\f(CW\*(C`#include\ <\f(CIfile\f(CW>\*(C'\fR. If additional directories are
|
||||
specified with \fB\-I\fR options after the \fB\-I-\fR, those
|
||||
directories are searched for all \fB#include\fR directives.
|
||||
.Sp
|
||||
In addition, \fB\-I-\fR inhibits the use of the directory of the current
|
||||
file directory as the first search directory for \f(CW\*(C`#include\ "\f(CIfile\f(CW"\*(C'\fR.
|
||||
.Ip "\fB\-nostdinc\fR" 4
|
||||
.IX Item "-nostdinc"
|
||||
Do not search the standard system directories for header files.
|
||||
Only the directories you have specified with \fB\-I\fR options
|
||||
(and the directory of the current file, if appropriate) are searched.
|
||||
.Ip "\fB\-nostdinc++\fR" 4
|
||||
.IX Item "-nostdinc++"
|
||||
Do not search for header files in the \*(C+\-specific standard directories,
|
||||
but do still search the other standard directories. (This option is
|
||||
used when building the \*(C+ library.)
|
||||
.Ip "\fB\-include\fR \fIfile\fR" 4
|
||||
.IX Item "-include file"
|
||||
Process \fIfile\fR as if \f(CW\*(C`#include "file"\*(C'\fR appeared as the first
|
||||
line of the primary source file. However, the first directory searched
|
||||
for \fIfile\fR is the preprocessor's working directory \fIinstead of\fR
|
||||
the directory containing the main source file. If not found there, it
|
||||
is searched for in the remainder of the \f(CW\*(C`#include "..."\*(C'\fR search
|
||||
chain as normal.
|
||||
.Sp
|
||||
If multiple \fB\-include\fR options are given, the files are included
|
||||
in the order they appear on the command line.
|
||||
.Ip "\fB\-imacros\fR \fIfile\fR" 4
|
||||
.IX Item "-imacros file"
|
||||
Exactly like \fB\-include\fR, except that any output produced by
|
||||
scanning \fIfile\fR is thrown away. Macros it defines remain defined.
|
||||
This allows you to acquire all the macros from a header without also
|
||||
processing its declarations.
|
||||
.Sp
|
||||
All files specified by \fB\-imacros\fR are processed before all files
|
||||
specified by \fB\-include\fR.
|
||||
.Ip "\fB\-idirafter\fR \fIdir\fR" 4
|
||||
.IX Item "-idirafter dir"
|
||||
Search \fIdir\fR for header files, but do it \fIafter\fR all
|
||||
directories specified with \fB\-I\fR and the standard system directories
|
||||
have been exhausted. \fIdir\fR is treated as a system include directory.
|
||||
.Ip "\fB\-iprefix\fR \fIprefix\fR" 4
|
||||
.IX Item "-iprefix prefix"
|
||||
Specify \fIprefix\fR as the prefix for subsequent \fB\-iwithprefix\fR
|
||||
options. If the prefix represents a directory, you should include the
|
||||
final \fB/\fR.
|
||||
.Ip "\fB\-iwithprefix\fR \fIdir\fR" 4
|
||||
.IX Item "-iwithprefix dir"
|
||||
.PD 0
|
||||
.Ip "\fB\-iwithprefixbefore\fR \fIdir\fR" 4
|
||||
.IX Item "-iwithprefixbefore dir"
|
||||
.PD
|
||||
Append \fIdir\fR to the prefix specified previously with
|
||||
\&\fB\-iprefix\fR, and add the resulting directory to the include search
|
||||
path. \fB\-iwithprefixbefore\fR puts it in the same place \fB\-I\fR
|
||||
would; \fB\-iwithprefix\fR puts it where \fB\-idirafter\fR would.
|
||||
.Sp
|
||||
Use of these options is discouraged.
|
||||
.Ip "\fB\-isystem\fR \fIdir\fR" 4
|
||||
.IX Item "-isystem dir"
|
||||
Search \fIdir\fR for header files, after all directories specified by
|
||||
\&\fB\-I\fR but before the standard system directories. Mark it
|
||||
as a system directory, so that it gets the same special treatment as
|
||||
is applied to the standard system directories.
|
||||
.Ip "\fB\-fpreprocessed\fR" 4
|
||||
.IX Item "-fpreprocessed"
|
||||
Indicate to the preprocessor that the input file has already been
|
||||
preprocessed. This suppresses things like macro expansion, trigraph
|
||||
conversion, escaped newline splicing, and processing of most directives.
|
||||
The preprocessor still recognizes and removes comments, so that you can
|
||||
pass a file preprocessed with \fB\-C\fR to the compiler without
|
||||
problems. In this mode the integrated preprocessor is little more than
|
||||
a tokenizer for the front ends.
|
||||
.Sp
|
||||
\&\fB\-fpreprocessed\fR is implicit if the input file has one of the
|
||||
extensions \fB.i\fR, \fB.ii\fR or \fB.mi\fR. These are the
|
||||
extensions that \s-1GCC\s0 uses for preprocessed files created by
|
||||
\&\fB\-save-temps\fR.
|
||||
.Ip "\fB\-ftabstop=\fR\fIwidth\fR" 4
|
||||
.IX Item "-ftabstop=width"
|
||||
Set the distance between tab stops. This helps the preprocessor report
|
||||
correct column numbers in warnings or errors, even if tabs appear on the
|
||||
line. If the value is less than 1 or greater than 100, the option is
|
||||
ignored. The default is 8.
|
||||
.Ip "\fB\-fno-show-column\fR" 4
|
||||
.IX Item "-fno-show-column"
|
||||
Do not print column numbers in diagnostics. This may be necessary if
|
||||
diagnostics are being scanned by a program that does not understand the
|
||||
column numbers, such as \fBdejagnu\fR.
|
||||
.Ip "\fB\-A\fR \fIpredicate\fR\fB=\fR\fIanswer\fR" 4
|
||||
.IX Item "-A predicate=answer"
|
||||
Make an assertion with the predicate \fIpredicate\fR and answer
|
||||
\&\fIanswer\fR. This form is preferred to the older form \fB\-A\fR
|
||||
\&\fIpredicate\fR\fB(\fR\fIanswer\fR\fB)\fR, which is still supported, because
|
||||
it does not use shell special characters.
|
||||
.Ip "\fB\-A -\fR\fIpredicate\fR\fB=\fR\fIanswer\fR" 4
|
||||
.IX Item "-A -predicate=answer"
|
||||
Cancel an assertion with the predicate \fIpredicate\fR and answer
|
||||
\&\fIanswer\fR.
|
||||
.Ip "\fB\-A-\fR" 4
|
||||
.IX Item "-A-"
|
||||
Cancel all predefined assertions and all assertions preceding it on
|
||||
the command line. Also, undefine all predefined macros and all
|
||||
macros preceding it on the command line. (This is a historical wart and
|
||||
may change in the future.)
|
||||
.Ip "\fB\-dCHARS\fR" 4
|
||||
.IX Item "-dCHARS"
|
||||
\&\fI\s-1CHARS\s0\fR is a sequence of one or more of the following characters,
|
||||
and must not be preceded by a space. Other characters are interpreted
|
||||
by the compiler proper, or reserved for future versions of \s-1GCC\s0, and so
|
||||
are silently ignored. If you specify characters whose behavior
|
||||
conflicts, the result is undefined.
|
||||
.RS 4
|
||||
.Ip "\fBM\fR" 4
|
||||
.IX Item "M"
|
||||
Instead of the normal output, generate a list of \fB#define\fR
|
||||
directives for all the macros defined during the execution of the
|
||||
preprocessor, including predefined macros. This gives you a way of
|
||||
finding out what is predefined in your version of the preprocessor.
|
||||
Assuming you have no file \fIfoo.h\fR, the command
|
||||
.Sp
|
||||
.Vb 1
|
||||
\& touch foo.h; cpp -dM foo.h
|
||||
.Ve
|
||||
will show all the predefined macros.
|
||||
.Ip "\fBD\fR" 4
|
||||
.IX Item "D"
|
||||
Like \fBM\fR except in two respects: it does \fInot\fR include the
|
||||
predefined macros, and it outputs \fIboth\fR the \fB#define\fR
|
||||
directives and the result of preprocessing. Both kinds of output go to
|
||||
the standard output file.
|
||||
.Ip "\fBN\fR" 4
|
||||
.IX Item "N"
|
||||
Like \fBD\fR, but emit only the macro names, not their expansions.
|
||||
.Ip "\fBI\fR" 4
|
||||
.IX Item "I"
|
||||
Output \fB#include\fR directives in addition to the result of
|
||||
preprocessing.
|
||||
.RE
|
||||
.RS 4
|
||||
.RE
|
||||
.Ip "\fB\-P\fR" 4
|
||||
.IX Item "-P"
|
||||
Inhibit generation of linemarkers in the output from the preprocessor.
|
||||
This might be useful when running the preprocessor on something that is
|
||||
not C code, and will be sent to a program which might be confused by the
|
||||
linemarkers.
|
||||
.Ip "\fB\-C\fR" 4
|
||||
.IX Item "-C"
|
||||
Do not discard comments. All comments are passed through to the output
|
||||
file, except for comments in processed directives, which are deleted
|
||||
along with the directive.
|
||||
.Sp
|
||||
You should be prepared for side effects when using \fB\-C\fR; it
|
||||
causes the preprocessor to treat comments as tokens in their own right.
|
||||
For example, comments appearing at the start of what would be a
|
||||
directive line have the effect of turning that line into an ordinary
|
||||
source line, since the first token on the line is no longer a \fB#\fR.
|
||||
.Ip "\fB\-gcc\fR" 4
|
||||
.IX Item "-gcc"
|
||||
Define the macros _\|_GNUC_\|_, _\|_GNUC_MINOR_\|_ and
|
||||
_\|_GNUC_PATCHLEVEL_\|_. These are defined automatically when you use
|
||||
\&\fBgcc \-E\fR; you can turn them off in that case with
|
||||
\&\fB\-no-gcc\fR.
|
||||
.Ip "\fB\-traditional\fR" 4
|
||||
.IX Item "-traditional"
|
||||
Try to imitate the behavior of old-fashioned C, as opposed to \s-1ISO\s0
|
||||
C.
|
||||
.Ip "\fB\-trigraphs\fR" 4
|
||||
.IX Item "-trigraphs"
|
||||
Process trigraph sequences.
|
||||
.Ip "\fB\-remap\fR" 4
|
||||
.IX Item "-remap"
|
||||
Enable special code to work around file systems which only permit very
|
||||
short file names, such as \s-1MS-DOS\s0.
|
||||
.Ip "\fB\-$\fR" 4
|
||||
.IX Item "-$"
|
||||
Forbid the use of \fB$\fR in identifiers. The C standard allows
|
||||
implementations to define extra characters that can appear in
|
||||
identifiers. By default \s-1GNU\s0 \s-1CPP\s0 permits \fB$\fR, a common extension.
|
||||
.Ip "\fB\-h\fR" 4
|
||||
.IX Item "-h"
|
||||
.PD 0
|
||||
.Ip "\fB\*(--help\fR" 4
|
||||
.IX Item "help"
|
||||
.Ip "\fB\*(--target-help\fR" 4
|
||||
.IX Item "target-help"
|
||||
.PD
|
||||
Print text describing all the command line options instead of
|
||||
preprocessing anything.
|
||||
.Ip "\fB\-v\fR" 4
|
||||
.IX Item "-v"
|
||||
Verbose mode. Print out \s-1GNU\s0 \s-1CPP\s0's version number at the beginning of
|
||||
execution, and report the final form of the include path.
|
||||
.Ip "\fB\-H\fR" 4
|
||||
.IX Item "-H"
|
||||
Print the name of each header file used, in addition to other normal
|
||||
activities. Each name is indented to show how deep in the
|
||||
\&\fB#include\fR stack it is.
|
||||
.Ip "\fB\-version\fR" 4
|
||||
.IX Item "-version"
|
||||
.PD 0
|
||||
.Ip "\fB\*(--version\fR" 4
|
||||
.IX Item "version"
|
||||
.PD
|
||||
Print out \s-1GNU\s0 \s-1CPP\s0's version number. With one dash, proceed to
|
||||
preprocess as normal. With two dashes, exit immediately.
|
||||
.SH "ENVIRONMENT"
|
||||
.IX Header "ENVIRONMENT"
|
||||
This section describes the environment variables that affect how \s-1CPP\s0
|
||||
operates. You can use them to specify directories or prefixes to use
|
||||
when searching for include files, or to control dependency output.
|
||||
.PP
|
||||
Note that you can also specify places to search using options such as
|
||||
\&\fB\-I\fR, and control dependency output with options like
|
||||
\&\fB\-M\fR. These take precedence over
|
||||
environment variables, which in turn take precedence over the
|
||||
configuration of \s-1GCC\s0.
|
||||
.Ip "\fB\s-1CPATH\s0\fR" 4
|
||||
.IX Item "CPATH"
|
||||
.PD 0
|
||||
.Ip "\fBC_INCLUDE_PATH\fR" 4
|
||||
.IX Item "C_INCLUDE_PATH"
|
||||
.Ip "\fB\s-1CPLUS_INCLUDE_PATH\s0\fR" 4
|
||||
.IX Item "CPLUS_INCLUDE_PATH"
|
||||
.Ip "\fB\s-1OBJC_INCLUDE_PATH\s0\fR" 4
|
||||
.IX Item "OBJC_INCLUDE_PATH"
|
||||
.PD
|
||||
Each variable's value is a list of directories separated by a special
|
||||
character, much like \fB\s-1PATH\s0\fR, in which to look for header files.
|
||||
The special character, \f(CW\*(C`PATH_SEPARATOR\*(C'\fR, is target-dependent and
|
||||
determined at \s-1GCC\s0 build time. For Windows-based targets it is a
|
||||
semicolon, and for almost all other targets it is a colon.
|
||||
.Sp
|
||||
\&\fB\s-1CPATH\s0\fR specifies a list of directories to be searched as if
|
||||
specified with \fB\-I\fR, but after any paths given with \fB\-I\fR
|
||||
options on the command line. The environment variable is used
|
||||
regardless of which language is being preprocessed.
|
||||
.Sp
|
||||
The remaining environment variables apply only when preprocessing the
|
||||
particular language indicated. Each specifies a list of directories
|
||||
to be searched as if specified with \fB\-isystem\fR, but after any
|
||||
paths given with \fB\-isystem\fR options on the command line.
|
||||
.Sp
|
||||
See also \f(CW@ref\fR{Search Path}.
|
||||
.Ip "\fB\s-1DEPENDENCIES_OUTPUT\s0\fR" 4
|
||||
.IX Item "DEPENDENCIES_OUTPUT"
|
||||
@anchor{\s-1DEPENDENCIES_OUTPUT\s0}
|
||||
If this variable is set, its value specifies how to output
|
||||
dependencies for Make based on the non-system header files processed
|
||||
by the compiler. System header files are ignored in the dependency
|
||||
output.
|
||||
.Sp
|
||||
The value of \fB\s-1DEPENDENCIES_OUTPUT\s0\fR can be just a file name, in
|
||||
which case the Make rules are written to that file, guessing the target
|
||||
name from the source file name. Or the value can have the form
|
||||
\&\fIfile\fR\fB \fR\fItarget\fR, in which case the rules are written to
|
||||
file \fIfile\fR using \fItarget\fR as the target name.
|
||||
.Sp
|
||||
In other words, this environment variable is equivalent to combining
|
||||
the options \fB\-MM\fR and \fB\-MF\fR,
|
||||
with an optional \fB\-MT\fR switch too.
|
||||
.Ip "\fB\s-1SUNPRO_DEPENDENCIES\s0\fR" 4
|
||||
.IX Item "SUNPRO_DEPENDENCIES"
|
||||
This variable is the same as the environment variable
|
||||
\&\fB\s-1DEPENDENCIES_OUTPUT\s0\fR, except that
|
||||
system header files are not ignored, so it implies \fB\-M\fR rather
|
||||
than \fB\-MM\fR. However, the dependence on the main input file is
|
||||
omitted.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIgpl\fR\|(7), \fIgfdl\fR\|(7), \fIfsf-funding\fR\|(7),
|
||||
\&\fIgcc\fR\|(1), \fIas\fR\|(1), \fIld\fR\|(1), and the Info entries for \fIcpp\fR, \fIgcc\fR, and
|
||||
\&\fIbinutils\fR.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright (c) 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996,
|
||||
1997, 1998, 1999, 2000, 2001
|
||||
Free Software Foundation, Inc.
|
||||
.PP
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 or
|
||||
any later version published by the Free Software Foundation. A copy of
|
||||
the license is included in the
|
||||
man page \fIgfdl\fR\|(7).
|
||||
This manual contains no Invariant Sections. The Front-Cover Texts are
|
||||
(a) (see below), and the Back-Cover Texts are (b) (see below).
|
||||
.PP
|
||||
(a) The \s-1FSF\s0's Front-Cover Text is:
|
||||
.PP
|
||||
.Vb 1
|
||||
\& A GNU Manual
|
||||
.Ve
|
||||
(b) The \s-1FSF\s0's Back-Cover Text is:
|
||||
.PP
|
||||
.Vb 3
|
||||
\& You have freedom to copy and modify this GNU Manual, like GNU
|
||||
\& software. Copies published by the Free Software Foundation raise
|
||||
\& funds for GNU development.
|
||||
.Ve
|
9474
contrib/gcc/doc/gcc.1
Normal file
9474
contrib/gcc/doc/gcc.1
Normal file
File diff suppressed because it is too large
Load Diff
453
contrib/gcc/doc/gcov.1
Normal file
453
contrib/gcc/doc/gcov.1
Normal file
@ -0,0 +1,453 @@
|
||||
.\" Automatically generated by Pod::Man version 1.15
|
||||
.\" Tue Nov 19 18:17:13 2002
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ======================================================================
|
||||
.de Sh \" Subsection heading
|
||||
.br
|
||||
.if t .Sp
|
||||
.ne 5
|
||||
.PP
|
||||
\fB\\$1\fR
|
||||
.PP
|
||||
..
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.de Ip \" List item
|
||||
.br
|
||||
.ie \\n(.$>=3 .ne \\$3
|
||||
.el .ne 3
|
||||
.IP "\\$1" \\$2
|
||||
..
|
||||
.de Vb \" Begin verbatim text
|
||||
.ft CW
|
||||
.nf
|
||||
.ne \\$1
|
||||
..
|
||||
.de Ve \" End verbatim text
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.\" Set up some character translations and predefined strings. \*(-- will
|
||||
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
||||
.\" double quote, and \*(R" will give a right double quote. | will give a
|
||||
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used
|
||||
.\" to do unbreakable dashes and therefore won't be available. \*(C` and
|
||||
.\" \*(C' expand to `' in nroff, nothing in troff, for use with C<>
|
||||
.tr \(*W-|\(bv\*(Tr
|
||||
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
||||
.ie n \{\
|
||||
. ds -- \(*W-
|
||||
. ds PI pi
|
||||
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
||||
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
||||
. ds L" ""
|
||||
. ds R" ""
|
||||
. ds C` ""
|
||||
. ds C' ""
|
||||
'br\}
|
||||
.el\{\
|
||||
. ds -- \|\(em\|
|
||||
. ds PI \(*p
|
||||
. ds L" ``
|
||||
. ds R" ''
|
||||
'br\}
|
||||
.\"
|
||||
.\" If the F register is turned on, we'll generate index entries on stderr
|
||||
.\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and
|
||||
.\" index entries marked with X<> in POD. Of course, you'll have to process
|
||||
.\" the output yourself in some meaningful fashion.
|
||||
.if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. nr % 0
|
||||
. rr F
|
||||
.\}
|
||||
.\"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it
|
||||
.\" makes way too many mistakes in technical documents.
|
||||
.hy 0
|
||||
.if n .na
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
.bd B 3
|
||||
. \" fudge factors for nroff and troff
|
||||
.if n \{\
|
||||
. ds #H 0
|
||||
. ds #V .8m
|
||||
. ds #F .3m
|
||||
. ds #[ \f1
|
||||
. ds #] \fP
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
||||
. ds #V .6m
|
||||
. ds #F 0
|
||||
. ds #[ \&
|
||||
. ds #] \&
|
||||
.\}
|
||||
. \" simple accents for nroff and troff
|
||||
.if n \{\
|
||||
. ds ' \&
|
||||
. ds ` \&
|
||||
. ds ^ \&
|
||||
. ds , \&
|
||||
. ds ~ ~
|
||||
. ds /
|
||||
.\}
|
||||
.if t \{\
|
||||
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
||||
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
||||
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
||||
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
||||
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
||||
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
||||
.\}
|
||||
. \" troff and (daisy-wheel) nroff accents
|
||||
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
||||
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
||||
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
||||
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
||||
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
||||
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
||||
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
||||
.ds ae a\h'-(\w'a'u*4/10)'e
|
||||
.ds Ae A\h'-(\w'A'u*4/10)'E
|
||||
. \" corrections for vroff
|
||||
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
||||
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
||||
. \" for low resolution devices (crt and lpr)
|
||||
.if \n(.H>23 .if \n(.V>19 \
|
||||
\{\
|
||||
. ds : e
|
||||
. ds 8 ss
|
||||
. ds o a
|
||||
. ds d- d\h'-1'\(ga
|
||||
. ds D- D\h'-1'\(hy
|
||||
. ds th \o'bp'
|
||||
. ds Th \o'LP'
|
||||
. ds ae ae
|
||||
. ds Ae AE
|
||||
.\}
|
||||
.rm #[ #] #H #V #F C
|
||||
.\" ======================================================================
|
||||
.\"
|
||||
.IX Title "GCOV 1"
|
||||
.TH GCOV 1 "gcc-3.2.1" "2002-11-19" "GNU"
|
||||
.UC
|
||||
.SH "NAME"
|
||||
gcov \- coverage testing tool
|
||||
.SH "SYNOPSIS"
|
||||
.IX Header "SYNOPSIS"
|
||||
gcov [\fB\-v\fR|\fB\*(--version\fR] [\fB\-h\fR|\fB\*(--help\fR]
|
||||
[\fB\-b\fR|\fB\*(--branch-probabilities\fR] [\fB\-c\fR|\fB\*(--branch-counts\fR]
|
||||
[\fB\-n\fR|\fB\*(--no-output\fR] [\fB\-l\fR|\fB\*(--long-file-names\fR]
|
||||
[\fB\-f\fR|\fB\*(--function-summaries\fR]
|
||||
[\fB\-o\fR|\fB\*(--object-directory\fR \fIdirectory\fR] \fIsourcefile\fR
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fBgcov\fR is a test coverage program. Use it in concert with \s-1GCC\s0
|
||||
to analyze your programs to help create more efficient, faster
|
||||
running code. You can use \fBgcov\fR as a profiling tool to help
|
||||
discover where your optimization efforts will best affect your code. You
|
||||
can also use \fBgcov\fR along with the other profiling tool,
|
||||
\&\fBgprof\fR, to assess which parts of your code use the greatest amount
|
||||
of computing time.
|
||||
.PP
|
||||
Profiling tools help you analyze your code's performance. Using a
|
||||
profiler such as \fBgcov\fR or \fBgprof\fR, you can find out some
|
||||
basic performance statistics, such as:
|
||||
.Ip "\(bu" 4
|
||||
how often each line of code executes
|
||||
.Ip "\(bu" 4
|
||||
what lines of code are actually executed
|
||||
.Ip "\(bu" 4
|
||||
how much computing time each section of code uses
|
||||
.PP
|
||||
Once you know these things about how your code works when compiled, you
|
||||
can look at each module to see which modules should be optimized.
|
||||
\&\fBgcov\fR helps you determine where to work on optimization.
|
||||
.PP
|
||||
Software developers also use coverage testing in concert with
|
||||
testsuites, to make sure software is actually good enough for a release.
|
||||
Testsuites can verify that a program works as expected; a coverage
|
||||
program tests to see how much of the program is exercised by the
|
||||
testsuite. Developers can then determine what kinds of test cases need
|
||||
to be added to the testsuites to create both better testing and a better
|
||||
final product.
|
||||
.PP
|
||||
You should compile your code without optimization if you plan to use
|
||||
\&\fBgcov\fR because the optimization, by combining some lines of code
|
||||
into one function, may not give you as much information as you need to
|
||||
look for `hot spots' where the code is using a great deal of computer
|
||||
time. Likewise, because \fBgcov\fR accumulates statistics by line (at
|
||||
the lowest resolution), it works best with a programming style that
|
||||
places only one statement on each line. If you use complicated macros
|
||||
that expand to loops or to other control structures, the statistics are
|
||||
less helpful\-\-\-they only report on the line where the macro call
|
||||
appears. If your complex macros behave like functions, you can replace
|
||||
them with inline functions to solve this problem.
|
||||
.PP
|
||||
\&\fBgcov\fR creates a logfile called \fI\fIsourcefile\fI.gcov\fR which
|
||||
indicates how many times each line of a source file \fI\fIsourcefile\fI.c\fR
|
||||
has executed. You can use these logfiles along with \fBgprof\fR to aid
|
||||
in fine-tuning the performance of your programs. \fBgprof\fR gives
|
||||
timing information you can use along with the information you get from
|
||||
\&\fBgcov\fR.
|
||||
.PP
|
||||
\&\fBgcov\fR works only on code compiled with \s-1GCC\s0. It is not
|
||||
compatible with any other profiling or test coverage mechanism.
|
||||
.SH "OPTIONS"
|
||||
.IX Header "OPTIONS"
|
||||
.Ip "\fB\-h\fR" 4
|
||||
.IX Item "-h"
|
||||
.PD 0
|
||||
.Ip "\fB\*(--help\fR" 4
|
||||
.IX Item "help"
|
||||
.PD
|
||||
Display help about using \fBgcov\fR (on the standard output), and
|
||||
exit without doing any further processing.
|
||||
.Ip "\fB\-v\fR" 4
|
||||
.IX Item "-v"
|
||||
.PD 0
|
||||
.Ip "\fB\*(--version\fR" 4
|
||||
.IX Item "version"
|
||||
.PD
|
||||
Display the \fBgcov\fR version number (on the standard output),
|
||||
and exit without doing any further processing.
|
||||
.Ip "\fB\-b\fR" 4
|
||||
.IX Item "-b"
|
||||
.PD 0
|
||||
.Ip "\fB\*(--branch-probabilities\fR" 4
|
||||
.IX Item "branch-probabilities"
|
||||
.PD
|
||||
Write branch frequencies to the output file, and write branch summary
|
||||
info to the standard output. This option allows you to see how often
|
||||
each branch in your program was taken.
|
||||
.Ip "\fB\-c\fR" 4
|
||||
.IX Item "-c"
|
||||
.PD 0
|
||||
.Ip "\fB\*(--branch-counts\fR" 4
|
||||
.IX Item "branch-counts"
|
||||
.PD
|
||||
Write branch frequencies as the number of branches taken, rather than
|
||||
the percentage of branches taken.
|
||||
.Ip "\fB\-n\fR" 4
|
||||
.IX Item "-n"
|
||||
.PD 0
|
||||
.Ip "\fB\*(--no-output\fR" 4
|
||||
.IX Item "no-output"
|
||||
.PD
|
||||
Do not create the \fBgcov\fR output file.
|
||||
.Ip "\fB\-l\fR" 4
|
||||
.IX Item "-l"
|
||||
.PD 0
|
||||
.Ip "\fB\*(--long-file-names\fR" 4
|
||||
.IX Item "long-file-names"
|
||||
.PD
|
||||
Create long file names for included source files. For example, if the
|
||||
header file \fIx.h\fR contains code, and was included in the file
|
||||
\&\fIa.c\fR, then running \fBgcov\fR on the file \fIa.c\fR will produce
|
||||
an output file called \fIa.c.x.h.gcov\fR instead of \fIx.h.gcov\fR.
|
||||
This can be useful if \fIx.h\fR is included in multiple source files.
|
||||
.Ip "\fB\-f\fR" 4
|
||||
.IX Item "-f"
|
||||
.PD 0
|
||||
.Ip "\fB\*(--function-summaries\fR" 4
|
||||
.IX Item "function-summaries"
|
||||
.PD
|
||||
Output summaries for each function in addition to the file level summary.
|
||||
.Ip "\fB\-o\fR \fIdirectory\fR" 4
|
||||
.IX Item "-o directory"
|
||||
.PD 0
|
||||
.Ip "\fB\*(--object-directory\fR \fIdirectory\fR" 4
|
||||
.IX Item "object-directory directory"
|
||||
.PD
|
||||
The directory where the object files live. Gcov will search for \fI.bb\fR,
|
||||
\&\fI.bbg\fR, and \fI.da\fR files in this directory.
|
||||
.PP
|
||||
When using \fBgcov\fR, you must first compile your program with two
|
||||
special \s-1GCC\s0 options: \fB\-fprofile-arcs \-ftest-coverage\fR.
|
||||
This tells the compiler to generate additional information needed by
|
||||
gcov (basically a flow graph of the program) and also includes
|
||||
additional code in the object files for generating the extra profiling
|
||||
information needed by gcov. These additional files are placed in the
|
||||
directory where the source code is located.
|
||||
.PP
|
||||
Running the program will cause profile output to be generated. For each
|
||||
source file compiled with \fB\-fprofile-arcs\fR, an accompanying \fI.da\fR
|
||||
file will be placed in the source directory.
|
||||
.PP
|
||||
Running \fBgcov\fR with your program's source file names as arguments
|
||||
will now produce a listing of the code along with frequency of execution
|
||||
for each line. For example, if your program is called \fItmp.c\fR, this
|
||||
is what you see when you use the basic \fBgcov\fR facility:
|
||||
.PP
|
||||
.Vb 5
|
||||
\& $ gcc -fprofile-arcs -ftest-coverage tmp.c
|
||||
\& $ a.out
|
||||
\& $ gcov tmp.c
|
||||
\& 87.50% of 8 source lines executed in file tmp.c
|
||||
\& Creating tmp.c.gcov.
|
||||
.Ve
|
||||
The file \fItmp.c.gcov\fR contains output from \fBgcov\fR.
|
||||
Here is a sample:
|
||||
.PP
|
||||
.Vb 3
|
||||
\& main()
|
||||
\& {
|
||||
\& 1 int i, total;
|
||||
.Ve
|
||||
.Vb 1
|
||||
\& 1 total = 0;
|
||||
.Ve
|
||||
.Vb 2
|
||||
\& 11 for (i = 0; i < 10; i++)
|
||||
\& 10 total += i;
|
||||
.Ve
|
||||
.Vb 5
|
||||
\& 1 if (total != 45)
|
||||
\& ###### printf ("Failure\en");
|
||||
\& else
|
||||
\& 1 printf ("Success\en");
|
||||
\& 1 }
|
||||
.Ve
|
||||
When you use the \fB\-b\fR option, your output looks like this:
|
||||
.PP
|
||||
.Vb 6
|
||||
\& $ gcov -b tmp.c
|
||||
\& 87.50% of 8 source lines executed in file tmp.c
|
||||
\& 80.00% of 5 branches executed in file tmp.c
|
||||
\& 80.00% of 5 branches taken at least once in file tmp.c
|
||||
\& 50.00% of 2 calls executed in file tmp.c
|
||||
\& Creating tmp.c.gcov.
|
||||
.Ve
|
||||
Here is a sample of a resulting \fItmp.c.gcov\fR file:
|
||||
.PP
|
||||
.Vb 3
|
||||
\& main()
|
||||
\& {
|
||||
\& 1 int i, total;
|
||||
.Ve
|
||||
.Vb 1
|
||||
\& 1 total = 0;
|
||||
.Ve
|
||||
.Vb 5
|
||||
\& 11 for (i = 0; i < 10; i++)
|
||||
\& branch 0 taken = 91%
|
||||
\& branch 1 taken = 100%
|
||||
\& branch 2 taken = 100%
|
||||
\& 10 total += i;
|
||||
.Ve
|
||||
.Vb 9
|
||||
\& 1 if (total != 45)
|
||||
\& branch 0 taken = 100%
|
||||
\& ###### printf ("Failure\en");
|
||||
\& call 0 never executed
|
||||
\& branch 1 never executed
|
||||
\& else
|
||||
\& 1 printf ("Success\en");
|
||||
\& call 0 returns = 100%
|
||||
\& 1 }
|
||||
.Ve
|
||||
For each basic block, a line is printed after the last line of the basic
|
||||
block describing the branch or call that ends the basic block. There can
|
||||
be multiple branches and calls listed for a single source line if there
|
||||
are multiple basic blocks that end on that line. In this case, the
|
||||
branches and calls are each given a number. There is no simple way to map
|
||||
these branches and calls back to source constructs. In general, though,
|
||||
the lowest numbered branch or call will correspond to the leftmost construct
|
||||
on the source line.
|
||||
.PP
|
||||
For a branch, if it was executed at least once, then a percentage
|
||||
indicating the number of times the branch was taken divided by the
|
||||
number of times the branch was executed will be printed. Otherwise, the
|
||||
message ``never executed'' is printed.
|
||||
.PP
|
||||
For a call, if it was executed at least once, then a percentage
|
||||
indicating the number of times the call returned divided by the number
|
||||
of times the call was executed will be printed. This will usually be
|
||||
100%, but may be less for functions call \f(CW\*(C`exit\*(C'\fR or \f(CW\*(C`longjmp\*(C'\fR,
|
||||
and thus may not return every time they are called.
|
||||
.PP
|
||||
The execution counts are cumulative. If the example program were
|
||||
executed again without removing the \fI.da\fR file, the count for the
|
||||
number of times each line in the source was executed would be added to
|
||||
the results of the previous \fIrun\fR\|(s). This is potentially useful in
|
||||
several ways. For example, it could be used to accumulate data over a
|
||||
number of program runs as part of a test verification suite, or to
|
||||
provide more accurate long-term information over a large number of
|
||||
program runs.
|
||||
.PP
|
||||
The data in the \fI.da\fR files is saved immediately before the program
|
||||
exits. For each source file compiled with \fB\-fprofile-arcs\fR, the profiling
|
||||
code first attempts to read in an existing \fI.da\fR file; if the file
|
||||
doesn't match the executable (differing number of basic block counts) it
|
||||
will ignore the contents of the file. It then adds in the new execution
|
||||
counts and finally writes the data to the file.
|
||||
.Sh "Using \fBgcov\fP with \s-1GCC\s0 Optimization"
|
||||
.IX Subsection "Using gcov with GCC Optimization"
|
||||
If you plan to use \fBgcov\fR to help optimize your code, you must
|
||||
first compile your program with two special \s-1GCC\s0 options:
|
||||
\&\fB\-fprofile-arcs \-ftest-coverage\fR. Aside from that, you can use any
|
||||
other \s-1GCC\s0 options; but if you want to prove that every single line
|
||||
in your program was executed, you should not compile with optimization
|
||||
at the same time. On some machines the optimizer can eliminate some
|
||||
simple code lines by combining them with other lines. For example, code
|
||||
like this:
|
||||
.PP
|
||||
.Vb 4
|
||||
\& if (a != b)
|
||||
\& c = 1;
|
||||
\& else
|
||||
\& c = 0;
|
||||
.Ve
|
||||
can be compiled into one instruction on some machines. In this case,
|
||||
there is no way for \fBgcov\fR to calculate separate execution counts
|
||||
for each line because there isn't separate code for each line. Hence
|
||||
the \fBgcov\fR output looks like this if you compiled the program with
|
||||
optimization:
|
||||
.PP
|
||||
.Vb 4
|
||||
\& 100 if (a != b)
|
||||
\& 100 c = 1;
|
||||
\& 100 else
|
||||
\& 100 c = 0;
|
||||
.Ve
|
||||
The output shows that this block of code, combined by optimization,
|
||||
executed 100 times. In one sense this result is correct, because there
|
||||
was only one instruction representing all four of these lines. However,
|
||||
the output does not indicate how many times the result was 0 and how
|
||||
many times the result was 1.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIgpl\fR\|(7), \fIgfdl\fR\|(7), \fIfsf-funding\fR\|(7), \fIgcc\fR\|(1) and the Info entry for \fIgcc\fR.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright (c) 1996, 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
.PP
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``\s-1GNU\s0 General Public License'' and ``Funding
|
||||
Free Software'', the Front-Cover texts being (a) (see below), and with
|
||||
the Back-Cover Texts being (b) (see below). A copy of the license is
|
||||
included in the \fIgfdl\fR\|(7) man page.
|
||||
.PP
|
||||
(a) The \s-1FSF\s0's Front-Cover Text is:
|
||||
.PP
|
||||
.Vb 1
|
||||
\& A GNU Manual
|
||||
.Ve
|
||||
(b) The \s-1FSF\s0's Back-Cover Text is:
|
||||
.PP
|
||||
.Vb 3
|
||||
\& You have freedom to copy and modify this GNU Manual, like GNU
|
||||
\& software. Copies published by the Free Software Foundation raise
|
||||
\& funds for GNU development.
|
||||
.Ve
|
File diff suppressed because it is too large
Load Diff
@ -157,7 +157,7 @@ in the following sections.
|
||||
@xref{Overall Options,,Options Controlling the Kind of Output}.
|
||||
@gccoptlist{
|
||||
-c -S -E -o @var{file} -pipe -pass-exit-codes -x @var{language} @gol
|
||||
-v -### --target-help --help}
|
||||
-v -### --help --target-help --version}
|
||||
|
||||
@item C Language Options
|
||||
@xref{C Dialect Options,,Options Controlling C Dialect}.
|
||||
@ -236,8 +236,9 @@ in the following sections.
|
||||
|
||||
@item C-only Warning Options
|
||||
@gccoptlist{
|
||||
-Wbad-function-cast -Wmissing-declarations -Wmissing-prototypes @gol
|
||||
-Wnested-externs -Wstrict-prototypes -Wtraditional}
|
||||
-Wbad-function-cast -Wmissing-declarations @gol
|
||||
-Wmissing-prototypes -Wnested-externs @gol
|
||||
-Wstrict-prototypes -Wtraditional}
|
||||
|
||||
@item Debugging Options
|
||||
@xref{Debugging Options,,Options for Debugging Your Program or GCC}.
|
||||
@ -248,7 +249,8 @@ in the following sections.
|
||||
-fdump-tree-original@r{[}-@var{n}@r{]} -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
|
||||
-fdump-tree-inlined@r{[}-@var{n}@r{]} @gol
|
||||
-fmem-report -fpretend-float @gol
|
||||
-fprofile-arcs -ftest-coverage -ftime-report @gol
|
||||
-fprofile-arcs -fsched-verbose=@var{n} @gol
|
||||
-ftest-coverage -ftime-report @gol
|
||||
-g -g@var{level} -gcoff -gdwarf -gdwarf-1 -gdwarf-1+ -gdwarf-2 @gol
|
||||
-ggdb -gstabs -gstabs+ -gvms -gxcoff -gxcoff+ @gol
|
||||
-p -pg -print-file-name=@var{library} -print-libgcc-file-name @gol
|
||||
@ -261,6 +263,7 @@ in the following sections.
|
||||
@gccoptlist{
|
||||
-falign-functions=@var{n} -falign-jumps=@var{n} @gol
|
||||
-falign-labels=@var{n} -falign-loops=@var{n} @gol
|
||||
-fbounds-check @gol
|
||||
-fbranch-probabilities -fcaller-saves -fcprop-registers @gol
|
||||
-fcse-follow-jumps -fcse-skip-blocks -fdata-sections @gol
|
||||
-fdelayed-branch -fdelete-null-pointer-checks @gol
|
||||
@ -269,7 +272,8 @@ in the following sections.
|
||||
-fgcse -fgcse-lm -fgcse-sm @gol
|
||||
-finline-functions -finline-limit=@var{n} -fkeep-inline-functions @gol
|
||||
-fkeep-static-consts -fmerge-constants -fmerge-all-constants @gol
|
||||
-fmove-all-movables -fno-default-inline -fno-defer-pop @gol
|
||||
-fmove-all-movables -fno-branch-count-reg @gol
|
||||
-fno-default-inline -fno-defer-pop @gol
|
||||
-fno-function-cse -fno-guess-branch-probability @gol
|
||||
-fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
|
||||
-funsafe-math-optimizations -fno-trapping-math @gol
|
||||
@ -278,6 +282,8 @@ in the following sections.
|
||||
-freduce-all-givs -fregmove -frename-registers @gol
|
||||
-frerun-cse-after-loop -frerun-loop-opt @gol
|
||||
-fschedule-insns -fschedule-insns2 @gol
|
||||
-fno-sched-interblock -fno-sched-spec @gol
|
||||
-fsched-spec-load -fsched-spec-load-dangerous @gol
|
||||
-fsingle-precision-constant -fssa -fssa-ccp -fssa-dce @gol
|
||||
-fstrength-reduce -fstrict-aliasing -fthread-jumps @gol
|
||||
-ftrapv -funroll-all-loops -funroll-loops @gol
|
||||
@ -481,7 +487,7 @@ in the following sections.
|
||||
-mno-fp-ret-in-387 -msoft-float -msvr3-shlib @gol
|
||||
-mno-wide-multiply -mrtd -malign-double @gol
|
||||
-mpreferred-stack-boundary=@var{num} @gol
|
||||
-mmmx -msse -msse2 -msse-math -m3dnow @gol
|
||||
-mmmx -msse -msse2 -m3dnow @gol
|
||||
-mthreads -mno-align-stringops -minline-all-stringops @gol
|
||||
-mpush-args -maccumulate-outgoing-args -m128bit-long-double @gol
|
||||
-m96bit-long-double -mregparm=@var{num} -momit-leaf-frame-pointer @gol
|
||||
@ -915,6 +921,10 @@ be displayed.
|
||||
@opindex target-help
|
||||
Print (on the standard output) a description of target specific command
|
||||
line options for each tool.
|
||||
|
||||
@item --version
|
||||
@opindex version
|
||||
Display the version number and copyrights of the invoked GCC.
|
||||
@end table
|
||||
|
||||
@node Invoking G++
|
||||
@ -2923,18 +2933,7 @@ optimization and code generation options plus
|
||||
Control Optimization}).
|
||||
|
||||
The other use of @option{-fprofile-arcs} is for use with @code{gcov},
|
||||
when it is used with the @option{-ftest-coverage} option. GCC
|
||||
supports two methods of determining code coverage: the options that
|
||||
support @code{gcov}, and options @option{-a} and @option{-ax}, which
|
||||
write information to text files. The options that support @code{gcov}
|
||||
do not need to instrument every arc in the program, so a program compiled
|
||||
with them runs faster than a program compiled with @option{-a}, which
|
||||
adds instrumentation code to every basic block in the program. The
|
||||
tradeoff: since @code{gcov} does not have execution counts for all
|
||||
branches, it must start with the execution counts for the instrumented
|
||||
branches, and then iterate over the program flow graph until the entire
|
||||
graph has been solved. Hence, @code{gcov} runs a little more slowly than
|
||||
a program which uses information from @option{-a} and @option{-ax}.
|
||||
when it is used with the @option{-ftest-coverage} option.
|
||||
|
||||
With @option{-fprofile-arcs}, for each function of your program GCC
|
||||
creates a program flow graph, then finds a spanning tree for the graph.
|
||||
@ -2944,11 +2943,6 @@ executed. When an arc is the only exit or only entrance to a block, the
|
||||
instrumentation code can be added to the block; otherwise, a new basic
|
||||
block must be created to hold the instrumentation code.
|
||||
|
||||
This option makes it possible to estimate branch probabilities and to
|
||||
calculate basic block execution counts. In general, basic block
|
||||
execution counts as provided by @option{-a} do not give enough
|
||||
information to estimate all branch probabilities.
|
||||
|
||||
@need 2000
|
||||
@item -ftest-coverage
|
||||
@opindex ftest-coverage
|
||||
@ -3180,6 +3174,23 @@ Dump after all tree based optimization, to @file{@var{file}.optimized}.
|
||||
Dump after function inlining, to @file{@var{file}.inlined}.
|
||||
@end table
|
||||
|
||||
@item -fsched-verbose=@var{n}
|
||||
@opindex fsched-verbose
|
||||
On targets that use instruction scheduling, this option controls the
|
||||
amount of debugging output the scheduler prints. This information is
|
||||
written to standard error, unless @option{-dS} or @option{-dR} is
|
||||
specified, in which case it is output to the usual dump
|
||||
listing file, @file{.sched} or @file{.sched2} respectively. However
|
||||
for @var{n} greater than nine, the output is always printed to standard
|
||||
error.
|
||||
|
||||
For @var{n} greater than zero, @option{-fsched-verbose} outputs the
|
||||
same information as @option{-dRS}. For @var{n} greater than one, it
|
||||
also output basic block probabilities, detailed ready list information
|
||||
and unit/insn info. For @var{n} greater than two, it includes RTL
|
||||
at abort point, control-flow and regions info. And for @var{n} over
|
||||
four, @option{-fsched-verbose} also includes dependence info.
|
||||
|
||||
@item -fpretend-float
|
||||
@opindex fpretend-float
|
||||
When running a cross-compiler, pretend that the target machine uses the
|
||||
@ -3484,6 +3495,14 @@ types. Languages like C or C++ require each non-automatic variable to
|
||||
have distinct location, so using this option will result in non-conforming
|
||||
behavior.
|
||||
|
||||
@item -fno-branch-count-reg
|
||||
@opindex fno-branch-count-reg
|
||||
Do not use ``decrement and branch'' instructions on a count register,
|
||||
but instead generate a sequence of instructions that decrement a
|
||||
register, compare it against zero, then branch based upon the result.
|
||||
This option is only meaningful on architectures that support such
|
||||
instructions, which include x86, PowerPC, IA-64 and S/390.
|
||||
|
||||
@item -fno-function-cse
|
||||
@opindex fno-function-cse
|
||||
Do not put function addresses in registers; make each instruction that
|
||||
@ -3546,6 +3565,14 @@ an exact implementation of IEEE or ISO rules/specifications for
|
||||
math functions.
|
||||
|
||||
The default is @option{-ftrapping-math}.
|
||||
|
||||
@item -fbounds-check
|
||||
@opindex fbounds-check
|
||||
For front-ends that support it, generate additional code to check that
|
||||
indices used to access arrays are within the declared range. This is
|
||||
currenly only supported by the Java and Fortran 77 front-ends, where
|
||||
this option defaults to true and false respectively.
|
||||
|
||||
@end table
|
||||
|
||||
The following options control specific optimizations. The @option{-O2}
|
||||
@ -3673,6 +3700,30 @@ instruction scheduling after register allocation has been done. This is
|
||||
especially useful on machines with a relatively small number of
|
||||
registers and where memory load instructions take more than one cycle.
|
||||
|
||||
@item -fno-sched-interblock
|
||||
@opindex fno-sched-interblock
|
||||
Don't schedule instructions across basic blocks. This is normally
|
||||
enabled by default when scheduling before register allocation, i.e.@:
|
||||
with @option{-fschedule-insns} or at @option{-O2} or higher.
|
||||
|
||||
@item -fno-sched-spec
|
||||
@opindex fno-sched-spec
|
||||
Don't allow speculative motion of non-load instructions. This is normally
|
||||
enabled by default when scheduling before register allocation, i.e.@:
|
||||
with @option{-fschedule-insns} or at @option{-O2} or higher.
|
||||
|
||||
@item -fsched-spec-load
|
||||
@opindex fsched-spec-load
|
||||
Allow speculative motion of some load instructions. This only makes
|
||||
sense when scheduling before register allocation, i.e.@: with
|
||||
@option{-fschedule-insns} or at @option{-O2} or higher.
|
||||
|
||||
@item -fsched-spec-load-dangerous
|
||||
@opindex fsched-spec-load-dangerous
|
||||
Allow speculative motion of more load instructions. This only makes
|
||||
sense when scheduling before register allocation, i.e.@: with
|
||||
@option{-fschedule-insns} or at @option{-O2} or higher.
|
||||
|
||||
@item -ffunction-sections
|
||||
@itemx -fdata-sections
|
||||
@opindex ffunction-sections
|
||||
@ -7575,6 +7626,9 @@ direct access to the MMX, SSE and 3Dnow extensions of the instruction set.
|
||||
@xref{X86 Built-in Functions}, for details of the functions enabled
|
||||
and disabled by these switches.
|
||||
|
||||
To have SSE/SSE2 instructions generated automatically from floating-point code,
|
||||
see @option{-mfpmath=sse}.
|
||||
|
||||
@item -mpush-args
|
||||
@itemx -mno-push-args
|
||||
@opindex mpush-args
|
||||
|
@ -738,6 +738,7 @@ here; FIXME: document the others.
|
||||
@menu
|
||||
* Test Idioms:: Idioms used in test suite code.
|
||||
* C Tests:: The C language test suites.
|
||||
* libgcj Tests:: The Java library test suites.
|
||||
@end menu
|
||||
|
||||
@node Test Idioms
|
||||
@ -870,3 +871,23 @@ shouldn't.
|
||||
|
||||
FIXME: merge in @file{testsuite/README.gcc} and discuss the format of
|
||||
test cases and magic comments more.
|
||||
|
||||
@node libgcj Tests
|
||||
@subsection The Java library test suites.
|
||||
|
||||
Runtime tests are executed via @samp{make check} from the @samp{testsuite}
|
||||
directory of the libjava hierarchy in the build tree. Additional runtime
|
||||
tests can be checked into this testsuite.
|
||||
|
||||
Regression testing of the core packages in libgcj is also covered by the
|
||||
Mauve test suite. The @uref{http://sources.redhat.com/mauve/,,Mauve Project}
|
||||
develops tests for the Java Class Libraries. These tests are run as part
|
||||
of libgcj testing by specifying the location of the Mauve tree when invoking
|
||||
@samp{make}, as in @samp{make MAUVEDIR=~/mauve check}.
|
||||
|
||||
The @uref{http://oss.software.ibm.com/developerworks/opensource/jacks/,,
|
||||
Jacks} project provides a test suite for Java compilers that can be used
|
||||
to test changes that affect the GCJ front end. There is no automated
|
||||
mechanism to run the Jacks suite as part of GCJ testing.
|
||||
|
||||
We encourage developers to contribute test cases to Mauve and Jacks.
|
||||
|
@ -1144,7 +1144,7 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp,
|
||||
/* Else we've got some float mode source being extracted into
|
||||
a different float mode destination -- this combination of
|
||||
subregs results in Severe Tire Damage. */
|
||||
abort ();
|
||||
goto no_subreg_mode_swap;
|
||||
}
|
||||
if (GET_CODE (op0) == REG)
|
||||
op0 = gen_rtx_SUBREG (mode1, op0, byte_offset);
|
||||
@ -1155,6 +1155,7 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp,
|
||||
return convert_to_mode (tmode, op0, unsignedp);
|
||||
return op0;
|
||||
}
|
||||
no_subreg_mode_swap:
|
||||
|
||||
/* Handle fields bigger than a word. */
|
||||
|
||||
|
@ -54,9 +54,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
|
||||
#ifdef PUSH_ROUNDING
|
||||
|
||||
#ifndef PUSH_ARGS_REVERSED
|
||||
#if defined (STACK_GROWS_DOWNWARD) != defined (ARGS_GROW_DOWNWARD)
|
||||
#define PUSH_ARGS_REVERSED /* If it's last to first. */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@ -6227,7 +6229,7 @@ expand_expr (exp, target, tmode, modifier)
|
||||
}
|
||||
|
||||
case PARM_DECL:
|
||||
if (DECL_RTL (exp) == 0)
|
||||
if (! DECL_RTL_SET_P (exp))
|
||||
{
|
||||
error_with_decl (exp, "prior parameter's size depends on `%s'");
|
||||
return CONST0_RTX (mode);
|
||||
@ -7600,9 +7602,10 @@ expand_expr (exp, target, tmode, modifier)
|
||||
{
|
||||
op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, 0);
|
||||
op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, 0);
|
||||
temp = simplify_binary_operation (PLUS, mode, op0, op1);
|
||||
if (temp)
|
||||
return temp;
|
||||
if (op0 == const0_rtx)
|
||||
return op1;
|
||||
if (op1 == const0_rtx)
|
||||
return op0;
|
||||
goto binop2;
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,22 @@
|
||||
2002-11-19 Release Manager
|
||||
|
||||
* GCC 3.2.1 Released.
|
||||
|
||||
2002-11-19 Release Manager
|
||||
|
||||
* GCC 3.2.1 Released.
|
||||
|
||||
2002-11-18 Release Manager
|
||||
|
||||
* GCC 3.2.1 Released.
|
||||
|
||||
2002-10-28 Andris Pavenis <pavenis@latnet.lv>
|
||||
Toon Moene <toon@moene.indiv.nluug.nl>
|
||||
|
||||
PR fortran/8308
|
||||
* lang-specs.h: Correct ratfor specs.
|
||||
* news.texi: Document this fix.
|
||||
|
||||
2002-09-14 Hans-Peter Nilsson <hp@bitrange.com>
|
||||
|
||||
* target.c (ffetarget_memcpy_): Don't test nonexistent
|
||||
|
2073
contrib/gcc/f/g77.1
2073
contrib/gcc/f/g77.1
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,6 @@
|
||||
/* lang-specs.h file for Fortran
|
||||
Copyright (C) 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995, 1996, 1997, 1999, 2000, 2002
|
||||
Free Software Foundation, Inc.
|
||||
Contributed by James Craig Burley.
|
||||
|
||||
This file is part of GNU Fortran.
|
||||
@ -33,7 +34,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
{".r", "@ratfor", 0},
|
||||
{"@ratfor",
|
||||
"%{C:%{!E:%eGNU C does not support -C without using -E}}\
|
||||
ratfor %{C} %{v} %i %{E:%W{o*}} %{!E: %{!pipe:-o %g.f} |\n\
|
||||
ratfor %{C} %{v} %{E:%W{o*}} %{!E: %{!pipe:-o %g.f} %i |\n\
|
||||
f771 %{!pipe:%g.f} %(cc1_options) %{I*} %{!fsyntax-only:%(invoke_as)}}", 0},
|
||||
{".f", "@f77", 0},
|
||||
{".for", "@f77", 0},
|
||||
|
@ -10,7 +10,7 @@
|
||||
@c in the standalone derivations of this file (e.g. NEWS).
|
||||
@set copyrights-news 1995,1996,1997,1998,1999,2000,2001,2002
|
||||
|
||||
@set last-update-news 2002-08-05
|
||||
@set last-update-news 2002-10-28
|
||||
|
||||
@include root.texi
|
||||
|
||||
@ -156,7 +156,11 @@ The following information was last updated on @value{last-update-news}:
|
||||
@heading In @code{GCC} 3.2 versus @code{GCC} 3.1:
|
||||
@itemize @bullet
|
||||
@item
|
||||
Nothing.
|
||||
Problem Reports fixed (in chronological order of submission):
|
||||
@table @code
|
||||
@item 8308
|
||||
gcc-3.x does not compile files with suffix .r (RATFOR) [Fixed in 3.2.1]
|
||||
@end table
|
||||
@end itemize
|
||||
|
||||
@heading In @code{GCC} 3.1 (formerly known as g77-0.5.27) versus @code{GCC} 3.0:
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "ansidecl.h"
|
||||
#include "f/version.h"
|
||||
|
||||
const char *const ffe_version_string = "3.2.1 20021009 (prerelease)";
|
||||
const char *const ffe_version_string = "3.2.1 20021119 (release)";
|
||||
|
@ -499,6 +499,9 @@ life_analysis (f, file, flags)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
rebuild_jump_labels (get_insns ());
|
||||
|
||||
/* Removing dead insns should've made jumptables really dead. */
|
||||
delete_dead_jumptables ();
|
||||
}
|
||||
|
@ -4869,6 +4869,7 @@ fold_binary_op_with_conditional_arg (code, type, cond, arg, cond_first_p)
|
||||
/* And these are the types of the expressions. */
|
||||
tree lhs_type = type;
|
||||
tree rhs_type = type;
|
||||
int save = 0;
|
||||
|
||||
if (cond_first_p)
|
||||
{
|
||||
@ -4927,11 +4928,12 @@ fold_binary_op_with_conditional_arg (code, type, cond, arg, cond_first_p)
|
||||
if an arm is a COND_EXPR since we get exponential behavior
|
||||
in that case. */
|
||||
|
||||
if (TREE_CODE (arg) != SAVE_EXPR && ! TREE_CONSTANT (arg)
|
||||
&& global_bindings_p () == 0
|
||||
&& ((TREE_CODE (arg) != VAR_DECL
|
||||
&& TREE_CODE (arg) != PARM_DECL)
|
||||
|| TREE_SIDE_EFFECTS (arg)))
|
||||
if (TREE_CODE (arg) == SAVE_EXPR)
|
||||
save = 1;
|
||||
else if (! TREE_CONSTANT (arg)
|
||||
&& global_bindings_p () == 0
|
||||
&& ((TREE_CODE (arg) != VAR_DECL && TREE_CODE (arg) != PARM_DECL)
|
||||
|| TREE_SIDE_EFFECTS (arg)))
|
||||
{
|
||||
if (TREE_CODE (true_value) != COND_EXPR)
|
||||
lhs = fold (build (lhs_code, lhs_type, *true_lhs, *true_rhs));
|
||||
@ -4941,7 +4943,11 @@ fold_binary_op_with_conditional_arg (code, type, cond, arg, cond_first_p)
|
||||
|
||||
if ((lhs == 0 || ! TREE_CONSTANT (lhs))
|
||||
&& (rhs == 0 || !TREE_CONSTANT (rhs)))
|
||||
arg = save_expr (arg), lhs = rhs = 0;
|
||||
{
|
||||
arg = save_expr (arg);
|
||||
lhs = rhs = 0;
|
||||
save = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (lhs == 0)
|
||||
@ -4951,7 +4957,7 @@ fold_binary_op_with_conditional_arg (code, type, cond, arg, cond_first_p)
|
||||
|
||||
test = fold (build (COND_EXPR, type, test, lhs, rhs));
|
||||
|
||||
if (TREE_CODE (arg) == SAVE_EXPR)
|
||||
if (save)
|
||||
return build (COMPOUND_EXPR, type,
|
||||
convert (void_type_node, arg),
|
||||
strip_compound_expr (test, arg));
|
||||
@ -6535,7 +6541,7 @@ fold (expr)
|
||||
|
||||
else if (TREE_INT_CST_HIGH (arg1) == -1
|
||||
&& (TREE_INT_CST_LOW (arg1)
|
||||
== ((unsigned HOST_WIDE_INT) 1 << (width - 1)))
|
||||
== ((unsigned HOST_WIDE_INT) -1 << (width - 1)))
|
||||
&& ! TREE_UNSIGNED (TREE_TYPE (arg1)))
|
||||
switch (TREE_CODE (t))
|
||||
{
|
||||
|
@ -111,7 +111,7 @@ struct option
|
||||
errors, only prototype getopt for the GNU C library. */
|
||||
extern int getopt (int argc, char *const *argv, const char *shortopts);
|
||||
#else /* not __GNU_LIBRARY__ */
|
||||
# if !defined (HAVE_DECL_GETOPT)
|
||||
# if !defined (HAVE_DECL_GETOPT) && !defined (__cplusplus)
|
||||
extern int getopt ();
|
||||
# endif
|
||||
#endif /* __GNU_LIBRARY__ */
|
||||
|
@ -38,3 +38,11 @@ hook_void_bool_false ()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Generic hook that takes (tree) and returns false. */
|
||||
bool
|
||||
hook_tree_bool_false (a)
|
||||
tree a ATTRIBUTE_UNUSED;
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -24,5 +24,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
bool hook_void_bool_false PARAMS ((void));
|
||||
void hook_void_void PARAMS ((void));
|
||||
bool hook_tree_bool_false PARAMS ((tree));
|
||||
|
||||
#endif
|
||||
|
@ -1076,6 +1076,21 @@ simplejump_p (insn)
|
||||
&& GET_CODE (SET_DEST (PATTERN (insn))) == PC
|
||||
&& GET_CODE (SET_SRC (PATTERN (insn))) == LABEL_REF);
|
||||
}
|
||||
/* Return 1 if INSN is an tablejump. */
|
||||
|
||||
int
|
||||
tablejump_p (insn)
|
||||
rtx insn;
|
||||
{
|
||||
rtx table;
|
||||
return (GET_CODE (insn) == JUMP_INSN
|
||||
&& JUMP_LABEL (insn)
|
||||
&& NEXT_INSN (JUMP_LABEL (insn))
|
||||
&& (table = next_active_insn (JUMP_LABEL (insn)))
|
||||
&& GET_CODE (table) == JUMP_INSN
|
||||
&& (GET_CODE (PATTERN (table)) == ADDR_VEC
|
||||
|| GET_CODE (PATTERN (table)) == ADDR_DIFF_VEC));
|
||||
}
|
||||
|
||||
/* Return nonzero if INSN is a (possibly) conditional jump
|
||||
and nothing more.
|
||||
|
@ -104,6 +104,8 @@ tree lhd_tree_inlining_convert_parm_for_inlining PARAMS ((tree, tree, tree));
|
||||
lhd_tree_inlining_copy_res_decl_for_inlining
|
||||
#define LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P \
|
||||
lhd_tree_inlining_anon_aggr_type_p
|
||||
#define LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P \
|
||||
hook_tree_bool_false
|
||||
#define LANG_HOOKS_TREE_INLINING_START_INLINING \
|
||||
lhd_tree_inlining_start_inlining
|
||||
#define LANG_HOOKS_TREE_INLINING_END_INLINING \
|
||||
@ -120,6 +122,7 @@ tree lhd_tree_inlining_convert_parm_for_inlining PARAMS ((tree, tree, tree));
|
||||
LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P, \
|
||||
LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING, \
|
||||
LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P, \
|
||||
LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P, \
|
||||
LANG_HOOKS_TREE_INLINING_START_INLINING, \
|
||||
LANG_HOOKS_TREE_INLINING_END_INLINING, \
|
||||
LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING \
|
||||
|
@ -46,6 +46,7 @@ struct lang_hooks_for_tree_inlining
|
||||
void *, int *,
|
||||
void *));
|
||||
int (*anon_aggr_type_p) PARAMS ((union tree_node *));
|
||||
bool (*var_mod_type_p) PARAMS ((union tree_node *));
|
||||
int (*start_inlining) PARAMS ((union tree_node *));
|
||||
void (*end_inlining) PARAMS ((union tree_node *));
|
||||
union tree_node *(*convert_parm_for_inlining) PARAMS ((union tree_node *,
|
||||
|
@ -9560,6 +9560,25 @@ loop_regs_scan (loop, extra_size)
|
||||
|
||||
if (GET_CODE (insn) == CODE_LABEL || GET_CODE (insn) == JUMP_INSN)
|
||||
memset (last_set, 0, regs->num * sizeof (rtx));
|
||||
|
||||
/* Invalidate all registers used for function argument passing.
|
||||
We check rtx_varies_p for the same reason as below, to allow
|
||||
optimizing PIC calculations. */
|
||||
if (GET_CODE (insn) == CALL_INSN)
|
||||
{
|
||||
rtx link;
|
||||
for (link = CALL_INSN_FUNCTION_USAGE (insn);
|
||||
link;
|
||||
link = XEXP (link, 1))
|
||||
{
|
||||
rtx op, reg;
|
||||
|
||||
if (GET_CODE (op = XEXP (link, 0)) == USE
|
||||
&& GET_CODE (reg = XEXP (op, 0)) == REG
|
||||
&& rtx_varies_p (reg, 1))
|
||||
regs->array[REGNO (reg)].may_not_optimize = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Invalidate all hard registers clobbered by calls. With one exception:
|
||||
|
@ -1,26 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Like mv $1 $2, but if the files are the same, just delete $1.
|
||||
# Status is 0 if $2 is changed, 1 otherwise.
|
||||
if
|
||||
test -r $2
|
||||
then
|
||||
if
|
||||
cmp $1 $2 > /dev/null
|
||||
cmp -s $1 $2
|
||||
then
|
||||
echo $2 is unchanged
|
||||
rm -f $1
|
||||
|
@ -440,7 +440,6 @@ static void delete_output_reload PARAMS ((rtx, int, int));
|
||||
static void delete_address_reloads PARAMS ((rtx, rtx));
|
||||
static void delete_address_reloads_1 PARAMS ((rtx, rtx, rtx));
|
||||
static rtx inc_for_reload PARAMS ((rtx, rtx, rtx, int));
|
||||
static int constraint_accepts_reg_p PARAMS ((const char *, rtx));
|
||||
static void reload_cse_regs_1 PARAMS ((rtx));
|
||||
static int reload_cse_noop_set_p PARAMS ((rtx));
|
||||
static int reload_cse_simplify_set PARAMS ((rtx, rtx));
|
||||
@ -6384,38 +6383,43 @@ emit_input_reload_insns (chain, rl, old, j)
|
||||
&& SET_DEST (PATTERN (temp)) == old
|
||||
/* Make sure we can access insn_operand_constraint. */
|
||||
&& asm_noperands (PATTERN (temp)) < 0
|
||||
/* This is unsafe if prev insn rejects our reload reg. */
|
||||
&& constraint_accepts_reg_p (insn_data[recog_memoized (temp)].operand[0].constraint,
|
||||
reloadreg)
|
||||
/* This is unsafe if operand occurs more than once in current
|
||||
insn. Perhaps some occurrences aren't reloaded. */
|
||||
&& count_occurrences (PATTERN (insn), old, 0) == 1
|
||||
/* Don't risk splitting a matching pair of operands. */
|
||||
&& ! reg_mentioned_p (old, SET_SRC (PATTERN (temp))))
|
||||
&& count_occurrences (PATTERN (insn), old, 0) == 1)
|
||||
{
|
||||
rtx old = SET_DEST (PATTERN (temp));
|
||||
/* Store into the reload register instead of the pseudo. */
|
||||
SET_DEST (PATTERN (temp)) = reloadreg;
|
||||
|
||||
/* If the previous insn is an output reload, the source is
|
||||
a reload register, and its spill_reg_store entry will
|
||||
contain the previous destination. This is now
|
||||
invalid. */
|
||||
if (GET_CODE (SET_SRC (PATTERN (temp))) == REG
|
||||
&& REGNO (SET_SRC (PATTERN (temp))) < FIRST_PSEUDO_REGISTER)
|
||||
/* Verify that resulting insn is valid. */
|
||||
extract_insn (temp);
|
||||
if (constrain_operands (1))
|
||||
{
|
||||
spill_reg_store[REGNO (SET_SRC (PATTERN (temp)))] = 0;
|
||||
spill_reg_stored_to[REGNO (SET_SRC (PATTERN (temp)))] = 0;
|
||||
}
|
||||
/* If the previous insn is an output reload, the source is
|
||||
a reload register, and its spill_reg_store entry will
|
||||
contain the previous destination. This is now
|
||||
invalid. */
|
||||
if (GET_CODE (SET_SRC (PATTERN (temp))) == REG
|
||||
&& REGNO (SET_SRC (PATTERN (temp))) < FIRST_PSEUDO_REGISTER)
|
||||
{
|
||||
spill_reg_store[REGNO (SET_SRC (PATTERN (temp)))] = 0;
|
||||
spill_reg_stored_to[REGNO (SET_SRC (PATTERN (temp)))] = 0;
|
||||
}
|
||||
|
||||
/* If these are the only uses of the pseudo reg,
|
||||
pretend for GDB it lives in the reload reg we used. */
|
||||
if (REG_N_DEATHS (REGNO (old)) == 1
|
||||
&& REG_N_SETS (REGNO (old)) == 1)
|
||||
{
|
||||
reg_renumber[REGNO (old)] = REGNO (rl->reg_rtx);
|
||||
alter_reg (REGNO (old), -1);
|
||||
/* If these are the only uses of the pseudo reg,
|
||||
pretend for GDB it lives in the reload reg we used. */
|
||||
if (REG_N_DEATHS (REGNO (old)) == 1
|
||||
&& REG_N_SETS (REGNO (old)) == 1)
|
||||
{
|
||||
reg_renumber[REGNO (old)] = REGNO (rl->reg_rtx);
|
||||
alter_reg (REGNO (old), -1);
|
||||
}
|
||||
special = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
SET_DEST (PATTERN (temp)) = old;
|
||||
}
|
||||
special = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -7991,51 +7995,6 @@ inc_for_reload (reloadreg, in, value, inc_amount)
|
||||
return store;
|
||||
}
|
||||
|
||||
/* Return 1 if we are certain that the constraint-string STRING allows
|
||||
the hard register REG. Return 0 if we can't be sure of this. */
|
||||
|
||||
static int
|
||||
constraint_accepts_reg_p (string, reg)
|
||||
const char *string;
|
||||
rtx reg;
|
||||
{
|
||||
int value = 0;
|
||||
int regno = true_regnum (reg);
|
||||
int c;
|
||||
|
||||
/* Initialize for first alternative. */
|
||||
value = 0;
|
||||
/* Check that each alternative contains `g' or `r'. */
|
||||
while (1)
|
||||
switch (c = *string++)
|
||||
{
|
||||
case 0:
|
||||
/* If an alternative lacks `g' or `r', we lose. */
|
||||
return value;
|
||||
case ',':
|
||||
/* If an alternative lacks `g' or `r', we lose. */
|
||||
if (value == 0)
|
||||
return 0;
|
||||
/* Initialize for next alternative. */
|
||||
value = 0;
|
||||
break;
|
||||
case 'g':
|
||||
case 'r':
|
||||
/* Any general reg wins for this alternative. */
|
||||
if (TEST_HARD_REG_BIT (reg_class_contents[(int) GENERAL_REGS], regno))
|
||||
value = 1;
|
||||
break;
|
||||
default:
|
||||
/* Any reg in specified class wins for this alternative. */
|
||||
{
|
||||
enum reg_class class = REG_CLASS_FROM_LETTER (c);
|
||||
|
||||
if (TEST_HARD_REG_BIT (reg_class_contents[(int) class], regno))
|
||||
value = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* INSN is a no-op; delete it.
|
||||
If this sets the return value of the function, we must keep a USE around,
|
||||
in case this is in a different basic block than the final USE. Otherwise,
|
||||
|
@ -1804,6 +1804,7 @@ extern rtx pc_set PARAMS ((rtx));
|
||||
extern rtx condjump_label PARAMS ((rtx));
|
||||
extern int simplejump_p PARAMS ((rtx));
|
||||
extern int returnjump_p PARAMS ((rtx));
|
||||
extern int tablejump_p PARAMS ((rtx));
|
||||
extern int onlyjump_p PARAMS ((rtx));
|
||||
extern int only_sets_cc0_p PARAMS ((rtx));
|
||||
extern int sets_cc0_p PARAMS ((rtx));
|
||||
|
@ -3351,8 +3351,18 @@ tail_recursion_args (actuals, formals)
|
||||
if (GET_MODE (DECL_RTL (f)) == GET_MODE (argvec[i]))
|
||||
emit_move_insn (DECL_RTL (f), argvec[i]);
|
||||
else
|
||||
convert_move (DECL_RTL (f), argvec[i],
|
||||
TREE_UNSIGNED (TREE_TYPE (TREE_VALUE (a))));
|
||||
{
|
||||
rtx tmp = argvec[i];
|
||||
|
||||
if (DECL_MODE (f) != GET_MODE (DECL_RTL (f)))
|
||||
{
|
||||
tmp = gen_reg_rtx (DECL_MODE (f));
|
||||
convert_move (tmp, argvec[i],
|
||||
TREE_UNSIGNED (TREE_TYPE (TREE_VALUE (a))));
|
||||
}
|
||||
convert_move (DECL_RTL (f), tmp,
|
||||
TREE_UNSIGNED (TREE_TYPE (TREE_VALUE (a))));
|
||||
}
|
||||
}
|
||||
|
||||
free_temp_slots ();
|
||||
|
@ -4104,7 +4104,7 @@ output_line_command (ip, op, conditional, file_change)
|
||||
sprintf (line_cmd_buf, "# %d \"%s\"", ip->lineno, ip->fname);
|
||||
if (file_change != same_file)
|
||||
strcat (line_cmd_buf, file_change == enter_file ? " 1" : " 2");
|
||||
if (system_include_depth > 0)
|
||||
if (system_include_depth > (file_change == leave_file))
|
||||
strcat (line_cmd_buf, " 3");
|
||||
len = strlen (line_cmd_buf);
|
||||
line_cmd_buf[len++] = '\n';
|
||||
|
@ -1224,6 +1224,12 @@ walk_tree (tp, func, data, htab_)
|
||||
{
|
||||
WALK_SUBTREE_TAIL (TREE_TYPE (*tp));
|
||||
}
|
||||
else if (TREE_CODE_CLASS (code) == 't')
|
||||
{
|
||||
WALK_SUBTREE (TYPE_SIZE (*tp));
|
||||
WALK_SUBTREE (TYPE_SIZE_UNIT (*tp));
|
||||
/* Also examine various special fields, below. */
|
||||
}
|
||||
|
||||
result = (*lang_hooks.tree_inlining.walk_subtrees) (tp, &walk_subtrees, func,
|
||||
data, htab);
|
||||
@ -1320,6 +1326,7 @@ walk_tree (tp, func, data, htab_)
|
||||
return NULL_TREE;
|
||||
|
||||
#undef WALK_SUBTREE
|
||||
#undef WALK_SUBTREE_TAIL
|
||||
}
|
||||
|
||||
/* Like walk_tree, but does not walk duplicate nodes more than
|
||||
@ -1378,8 +1385,8 @@ copy_tree_r (tp, walk_subtrees, data)
|
||||
if (TREE_CODE (*tp) == SCOPE_STMT)
|
||||
SCOPE_STMT_BLOCK (*tp) = NULL_TREE;
|
||||
}
|
||||
else if (TREE_CODE_CLASS (code) == 't')
|
||||
/* There's no need to copy types, or anything beneath them. */
|
||||
else if (TREE_CODE_CLASS (code) == 't' && !variably_modified_type_p (*tp))
|
||||
/* Types only need to be copied if they are variably modified. */
|
||||
*walk_subtrees = 0;
|
||||
|
||||
return NULL_TREE;
|
||||
|
@ -286,7 +286,7 @@ tree_size (node)
|
||||
case '1': /* a unary arithmetic expression */
|
||||
case '2': /* a binary arithmetic expression */
|
||||
return (sizeof (struct tree_exp)
|
||||
+ (TREE_CODE_LENGTH (code) - 1) * sizeof (char *));
|
||||
+ TREE_CODE_LENGTH (code) * sizeof (char *) - sizeof (char *));
|
||||
|
||||
case 'c': /* a constant */
|
||||
/* We can't use TREE_CODE_LENGTH for INTEGER_CST, since the number of
|
||||
@ -304,12 +304,12 @@ tree_size (node)
|
||||
|
||||
case 'x': /* something random, like an identifier. */
|
||||
{
|
||||
size_t length;
|
||||
length = (sizeof (struct tree_common)
|
||||
+ TREE_CODE_LENGTH (code) * sizeof (char *));
|
||||
if (code == TREE_VEC)
|
||||
length += (TREE_VEC_LENGTH (node) - 1) * sizeof (char *);
|
||||
return length;
|
||||
size_t length;
|
||||
length = (sizeof (struct tree_common)
|
||||
+ TREE_CODE_LENGTH (code) * sizeof (char *));
|
||||
if (code == TREE_VEC)
|
||||
length += TREE_VEC_LENGTH (node) * sizeof (char *) - sizeof (char *);
|
||||
return length;
|
||||
}
|
||||
|
||||
default:
|
||||
@ -4335,6 +4335,65 @@ int_fits_type_p (c, type)
|
||||
}
|
||||
}
|
||||
|
||||
/* Returns true if T is, contains, or refers to a type with variable
|
||||
size. This concept is more general than that of C99 'variably
|
||||
modified types': in C99, a struct type is never variably modified
|
||||
because a VLA may not appear as a structure member. However, in
|
||||
GNU C code like:
|
||||
|
||||
struct S { int i[f()]; };
|
||||
|
||||
is valid, and other languages may define similar constructs. */
|
||||
|
||||
bool
|
||||
variably_modified_type_p (type)
|
||||
tree type;
|
||||
{
|
||||
/* If TYPE itself has variable size, it is variably modified.
|
||||
|
||||
We do not yet have a representation of the C99 '[*]' syntax.
|
||||
When a representation is chosen, this function should be modified
|
||||
to test for that case as well. */
|
||||
if (TYPE_SIZE (type)
|
||||
&& TYPE_SIZE (type) != error_mark_node
|
||||
&& TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST)
|
||||
return true;
|
||||
|
||||
/* If TYPE is a pointer or reference, it is variably modified if
|
||||
the type pointed to is variably modified. */
|
||||
if ((TREE_CODE (type) == POINTER_TYPE
|
||||
|| TREE_CODE (type) == REFERENCE_TYPE)
|
||||
&& variably_modified_type_p (TREE_TYPE (type)))
|
||||
return true;
|
||||
|
||||
/* If TYPE is an array, it is variably modified if the array
|
||||
elements are. (Note that the VLA case has already been checked
|
||||
above.) */
|
||||
if (TREE_CODE (type) == ARRAY_TYPE
|
||||
&& variably_modified_type_p (TREE_TYPE (type)))
|
||||
return true;
|
||||
|
||||
/* If TYPE is a function type, it is variably modified if any of the
|
||||
parameters or the return type are variably modified. */
|
||||
if (TREE_CODE (type) == FUNCTION_TYPE
|
||||
|| TREE_CODE (type) == METHOD_TYPE)
|
||||
{
|
||||
tree parm;
|
||||
|
||||
if (variably_modified_type_p (TREE_TYPE (type)))
|
||||
return true;
|
||||
for (parm = TYPE_ARG_TYPES (type);
|
||||
parm && parm != void_list_node;
|
||||
parm = TREE_CHAIN (parm))
|
||||
if (variably_modified_type_p (TREE_VALUE (parm)))
|
||||
return true;
|
||||
}
|
||||
|
||||
/* The current language may have other cases to check, but in general,
|
||||
all other types are not variably modified. */
|
||||
return (*lang_hooks.tree_inlining.var_mod_type_p) (type);
|
||||
}
|
||||
|
||||
/* Given a DECL or TYPE, return the scope in which it was declared, or
|
||||
NULL_TREE if there is no containing scope. */
|
||||
|
||||
|
@ -2938,6 +2938,7 @@ struct obstack;
|
||||
/* In tree.c */
|
||||
extern int really_constant_p PARAMS ((tree));
|
||||
extern int int_fits_type_p PARAMS ((tree, tree));
|
||||
extern bool variably_modified_type_p PARAMS ((tree));
|
||||
extern int tree_log2 PARAMS ((tree));
|
||||
extern int tree_floor_log2 PARAMS ((tree));
|
||||
extern void preserve_data PARAMS ((void));
|
||||
|
@ -535,7 +535,6 @@ asm_output_aligned_bss (file, decl, name, size, align)
|
||||
const char *name;
|
||||
int size, align;
|
||||
{
|
||||
ASM_GLOBALIZE_LABEL (file, name);
|
||||
bss_section ();
|
||||
ASM_OUTPUT_ALIGN (file, floor_log2 (align / BITS_PER_UNIT));
|
||||
#ifdef ASM_DECLARE_OBJECT_NAME
|
||||
|
Loading…
Reference in New Issue
Block a user