Gcc 3.3.1-release.

This commit is contained in:
Alexander Kabaev 2003-08-22 02:56:07 +00:00
parent 6bdbd039fd
commit 50ebf00d84
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/vendor/gcc/dist/; revision=119256
60 changed files with 2434 additions and 1286 deletions

View File

@ -1,3 +1,340 @@
2003-08-04 Release Manager
* GCC 3.3.1 Released.
2003-08-04 Release Manager
* GCC 3.3.1 Released.
2003-08-03 Neil Booth <neil@daikokuya.co.uk>
PR preprocessor/11534
* cppexp.c (parse_defined): Warn only if -pedantic.
2003-08-03 Mark Mitchell <mark@codesourcery.com>
* Makefile.in (ORDINARY_FLAGS_TO_PASS): Pass AR.
* Makefile.in (STAGE2_FLAGS_TO_PASS): Pass AR_FOR_TARGET and
RANLIB_FOR_TARGET.
(stage1_build): Likewise.
2003-08-03 Jan Hubicka <jh@suse.cz>
PR 10510
* config/pa/pa.h (MAYBE_FP_REG_CLASS_P): New.
(SECONDARY_MEMORY_NEEDED): Use it.
2003-08-01 Geoffrey Keating <geoffk@apple.com>
PR 11709 (partial fix)
* config/rs6000/rs6000.c (rs6000_output_function_epilogue): Don't
insert a label at the end of an function under Mach-O.
PR 11313
* c-pragma.c (maybe_apply_pragma_weak): Don't get DECL_ASSEMBLER_NAME
when it's not needed.
2003-07-29 Richard Henderson <rth@redhat.com>
PR target/10681
2003-06-27 J"orn Rennecke <joern.rennecke@superh.com>
* flow.c (propagate_one_insn): Use proper test for a register
being part of the return value.
2003-06-26 Richard Henderson <rth@redhat.com>
* flow.c (propagate_one_insn): Preserve live-at-end registers
across tail calls.
2003-06-26 Richard Henderson <rth@redhat.com>
* config/ia64/ia64.c (ia64_expand_call): Don't add ar.pfs for sibcalls.
(ia64_split_call): Only load descriptor for GP register inputs.
(ia64_expand_epilogue): Check current_frame_info.mask not
current_function_is_leaf to restore ar.pfs.
2003-07-26 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
* doc/install.texi (Testing): Adjust required versions of DejaGnu.
2003-07-24 Aldy Hernandez <aldyh@redhat.com>
Backport the folling patch.
2003-04-01 Aldy Hernandez <aldyh@redhat.com>
PR/8878
* expr.c (expand_expr): Handle VECTOR_CST.
(const_vector_from_tree): New.
* varasm.c (output_constant): Handle VECTOR_CST.
* c-typeck.c (digest_init): Build a vector constant from a
VECTOR_TYPE.
2003-07-23 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
PR target/11607 and PR target/11516
* pa.md (extzv, extv, insv): Revert latter half of last patch.
2003-07-23 Mark Mitchell <mark@codesourcery.com>
PR optimization/10679
* tree-inline.c (inlinable_function_p): Honor MIN_INLINE_INSNS.
2003-07-22 Bob Wilson <bob.wilson@acm.org>
* unwind-c.c (PERSONALITY_FUNCTION): Delete duplicate define.
2003-07-23 Dave Fluri <dave.fluri@onlink.net>
* doc/extend.texi: Fixes to spelling, grammar, and diction.
2003-07-21 H.J. Lu <hongjiu.lu@intel.com>
PR optimization/11599
* config/ia64/ia64.md (prefetch): Support predicate.
2003-07-17 Eric Botcazou <ebotcazou@libertysurf.fr>
PR optimization/11536
* unroll.c (loop_iterations): Do not replace a register holding
the final value by its equivalent before the loop if it is not
invariant.
2003-07-17 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.c-torture/execute/loop-16.c: New test.
2003-07-21 Ben Elliston <bje@wasabisystems.com>
* doc/invoke.texi (V850 Options): Spelling fixes.
2003-07-21 Lisa M. Goldstein <opus@gnu.org>
* doc/invoke.texi: Fixes to style, grammar and diction.
2003-07-20 Mark Mitchell <mark@codesourcery.com>
PR debug/11279
* dwarf2out.c (gen_enumeration_type_die): Remember that
enumerators can be unsigned.
2003-07-19 Kelley Cook <kelleycook@wideopenwest.com>
* c-tree.texi: Backport changes from mainline.
* c-tree.texi: Ditto.
* collect2.texi: Ditto.
* cpp.texi: Ditto.
* cppopts.texi: Ditto.
* extend.texi: Ditto.
* fragments.texi: Ditto.
* headerdirs.texi: Ditto.
* install.texi: Ditto.
* invoke.texi: Ditto.
* md.texi: Ditto.
* portability.texi: Ditto.
* rtl.texi: Ditto.
* sourcebuild.texi: Ditto.
* trouble.texi: Ditto.
2003-07-19 Kelley Cook <kelleycook@wideopenwest.com>
PR optimization/4490
* doc/invoke.texi (m96bit-long-double, m128bit-long-double): Reword
documentation to accurately reflect what these options do.
2003-07-18 Richard Henderson <rth@redhat.com>
David S. Miller <davem@redhat.com>
PR target/11556
* optabs.c (prepare_operand): Fail gracefully instead of abort
if the predicate doesn't satisfy.
(gen_cond_trap): Allow prepare_operand to fail.
Pass correct opnum argument to prepare_operand.
2003-07-18 Eric Botcazou <ebotcazou@libertysurf.fr>
PR optimization/11083
* toplev.c (rest_of_compilation): Delete unreachable blocks
if dead edges were purged after the addressof pass.
2003-07-17 Mark Mitchell <mark@codesourcery.com>
PR optimization/11557
* calls.c (flags_from_decl_or_type): Do not set ECF_LIBCALL_BLOCK
unless we know which function is being called.
2003-07-17 Nathanael Nerode <neroden@gcc.gnu.org>
PR bootstrap/11043
* config/arc/t-arc: Replace bogus references to "x-crtinit.o",
"x-crtfini.o" with "crtinit.o", "crtfini.o".
2003-07-17 Eric Botcazou <ebotcazou@libertysurf.fr>
PR other/11466
* doc/invoke.texi (SPARC Options): Document "-mlittle-endian"
and its restrictions for the SPARC64 port.
Backport from mainline:
2003-06-13 Florian Weimer <fw@deneb.enyo.de>
* doc/invoke.texi (SPARC Options): Document "-mimpure-text".
2003-07-17 Eric Botcazou <ebotcazou@libertysurf.fr>
Phil Edwards <phil@jaj.com>
* doc/install.texi (*-*-solaris2*): Document the step-by-step
procedure to bootstrap and install.
Document the preference for the legacy Sun tools in /usr/bin
over the POSIX tools in /usr/xpg4/bin for the build process.
2003-07-16 Richard Henderson <rth@redhat.com>
PR target/10907
* config/ia64/ia64.c (ia64_epilogue_uses): GP is live at end
even with !TARGET_CONST_GP.
(ia64_function_ok_for_sibcall): Reject non-local functions.
2003-07-15 Geoffrey Keating <geoffk@apple.com>
* config/darwin.c (machopic_select_section): Use decl_readonly_section
to do most of the work.
2003-07-15 David S. Miller <davem@redhat.com>
* config/sparc/sparc.c (sparc_nonflat_function_epilogue): Only
emit nop if the last real insn is CALL_INSN.
2003-07-15 Loren James Rittle <ljrittle@acm.org>
* config/i386/freebsd.h (SET_ASM_OP): Remove.
(SUBTARGET_OVERRIDE_OPTIONS): Handle TARGET_64BIT case.
(ASM_COMMENT_START, ASM_APP_ON, ASM_APP_OFF, DBX_REGISTER_NUMBER
MCOUNT_NAME, SIZE_TYPE, PTRDIFF_TYPE, WCHAR_TYPE_SIZE): Whitespace.
2003-07-15 Mark Mitchell <mark@codesourcery.com>
PR debug/11473
* dbxout.c (dbxout_type): Use TYPE_SIZE to determine the sizes of
base classes.
2003-07-15 James A. Morrison <ja2morri@student.math.uwaterloo.ca>
* doc/include/texinfo.tex: Upgrade to texinfo 4.6.
2003-07-15 Eric Botcazou <ebotcazou@libertysurf.fr>
PR optimization/11320
* sched-int.h (struct deps) [reg_conditional_sets]: New field.
(struct sched_info) [compute_jump_reg_dependencies]: New prototype.
* sched-deps.c (sched_analyze_insn) [JUMP_INSN]: Update call to
current_sched_info->compute_jump_reg_dependencies. Record which
registers are used and which registers are set by the jump.
Clear deps->reg_conditional_sets after a barrier.
Set deps->reg_conditional_sets if the insn is a COND_EXEC.
Clear deps->reg_conditional_sets if the insn is not a COND_EXEC.
(init_deps): Initialize reg_conditional_sets.
(free_deps): Clear reg_conditional_sets.
* sched-ebb.c (compute_jump_reg_dependencies): New prototype.
Mark registers live on entry of the fallthrough block and conditionally
set as set by the jump. Mark registers live on entry of non-fallthrough
blocks as used by the jump.
* sched-rgn.c (compute_jump_reg_dependencies): New prototype.
Mark new parameters as unused.
2003-07-14 Mark Mitchell <mark@codesourcery.com>
PR debug/11098
* integrate.c (copy_decl_for_inlining): Do not mark copied decls
as DECL_ABSTRACT.
2003-07-14 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
PR optimization/11440
* gcse.c (try_replace_reg): Don't attach notes to ZERO_EXTRACT or
SIGN_EXTRACT SETs.
2003-07-13 Aaron W. LaFramboise <awlaframboise@aol.com>
* config/i386/gthr-win32.c (__GTHREAD_HIDE_WIN32API): Define to 1.
2003-07-13 Roger Sayle <roger@eyesopen.com>
PR optimization/11059
* expr.c (can_store_by_pieces): Return true if length is zero.
(store_by_pieces): Do nothing if length is zero.
(clear_by_pieces): Do nothing if length is zero.
(clear_storage): Do nothing if length is zero.
(store_constructor): Simplify code when size is zero, or the
target has already been cleared. This avoids emitting a
blockage instruction when initializing empty structures.
2003-07-13 Richard Henderson <rth@redhat.com>
* libgcc-std.ver (GCC_3.3.1): Export __gcc_personality_sj0,
__gcc_personality_v0.
2003-07-11 Dara Hazeghi <dhazeghi@yahoo.com>
PR optimization/10877
* doc/install.tex: Update required binutils for i?86-*-linux*
2003-07-11 Ben Elliston <bje@redhat.com>
PR c++/1607
* doc/extend.texi (Function Attributes): Document the effect of
the C++ "this" parameter on the counting of arguments for the
"format" and "format_arg" attributes.
2003-07-11 Danny Smith <dannysmith@users.sourceforge.net>
Backport from mainline.
2003-05-13 Richard Henderson <rth@redhat.com>
* c-decl.c (duplicate_decls): Re-invoke make_decl_rtl if
the old decl had instantiated DECL_RTL.
2003-05-21 Danny Smith <dannysmith@users.sourceforge.net>
PR c++/9738
* config/i386/winnt.c (i386_pe_encode_section_info): Enable
even if not first.
2003-07-04 Danny Smith <dannysmith@users.sourceforge.net>
PR c++/5287, PR c++/7910, PR c++/11021
* config/i386/winnt.c (ix86_handle_dll_attribute): Don't add
dllimport attribute if function is defined at declaration, but
report error instead. Likewise for dllimport'd variable
definitions. Set implicit TREE_PUBLIC for dllimport'd variables
declared within functions, Report error if dllimport or dllexport
symbol is not global.
(i386_pe_dllimport_p): Ignore dllimport attribute of functions
if defined after declaration or if inlined. Don't allow definition
of static data members of C++ classes. Don't dllimport virtual
methods.
(i386_pe_mark_dllexport): Warn about inconsistent dll attributes.
(i386_pe_mark_dllimport): Remove unnecessary checks.
(i386_pe_encode_section_info): Warn if the dllimport attribute
and symbol prefix have been instantiated and then overridden.
* doc/extend.texi: Document dllimport and dllexport attributes.
2003-07-10 James E Wilson <wilson@tuliptree.org>
PR optimization/9745
* loop.c (loop_iv_add_mult_emit_before): Call loop_regs_update before
loop_insn_emit_before.
(loop_iv_add_mult_sink, loop_iv_add_mult_hoist): Likewise.
2003-07-10 Dara Hazeghi <dhazeghi@yahoo.com>
PR bootstrap/10758
* doc/install.texi: Document requirements for ia64-*-hpux* target.
2003-07-09 Mark Mitchell <mark@codesourcery.com>
PR c++/10032
@ -135,10 +472,6 @@
* doc/contrib.texi: Fix typos.
* doc/sourcebuild.texi: Likewise.
2003-06-29 Aaron W. LaFramboise <awlaframboise@aol.com>
* config/i386/gthr-win32.h (__GTHREAD_HIDE_WIN32API): Define to 1.
2003-06-27 Gunther Nikl <gni@gecko.de>
PR target/11014
@ -3839,7 +4172,8 @@ Mon Apr 7 15:56:30 CEST 2003 Jan Hubicka <jh@suse.cz>
* df.c (df_uses_record): Handle CC0.
2003-01-25 Jan Hubicka <jh@suse.cz>
Eric Botcazou <ebotcazou@libertysurf.fr>
Eric Botcazou <ebotcazou@libertysurf.fr>
PR opt/8492
* gcse.c (one_cprop_pass): Delete unreachable blocks.

View File

@ -682,6 +682,7 @@ LANG_STAGESTUFF = @all_stagestuff@
# subdirectories.
# ??? The choices here will need some experimenting with.
ORDINARY_FLAGS_TO_PASS = \
"AR=$(AR)" \
"AR_FLAGS_FOR_TARGET=$(AR_FLAGS_FOR_TARGET)" \
"AR_CREATE_FOR_TARGET=$(AR_CREATE_FOR_TARGET)" \
"AR_EXTRACT_FOR_TARGET=$(AR_EXTRACT_FOR_TARGET)" \
@ -3317,6 +3318,8 @@ VOL_FILES=`echo $(BACKEND) $(OBJS) $(C_OBJS) $(LIBCPP_OBJS) *.c *.h gen*`
# the context of the stage_x rule.
STAGE2_FLAGS_TO_PASS = \
ADAC="\$$(CC)" \
AR_FOR_TARGET="$(AR_FOR_TARGET)" \
RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)" \
CFLAGS="$(BOOT_CFLAGS)" \
LDFLAGS="$(BOOT_LDFLAGS)" \
WARN_CFLAGS="\$$(GCC_WARN_CFLAGS)" \
@ -3332,7 +3335,9 @@ STAGE2_FLAGS_TO_PASS = \
# MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them
# overrideable (for a bootstrap build stage1 also builds gcc.info).
stage1_build:
$(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)" \
$(MAKE) AR_FOR_TARGET="$(AR_FOR_TARGET)" \
RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)" \
CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)" \
CFLAGS="$(STAGE1_CFLAGS)" MAKEINFO="$(MAKEINFO)" \
MAKEINFOFLAGS="$(MAKEINFOFLAGS)" COVERAGE_FLAGS=
$(STAMP) stage1_build

View File

@ -1578,6 +1578,15 @@ duplicate_decls (newdecl, olddecl, different_binding_level)
Update OLDDECL to be the same. */
DECL_ATTRIBUTES (olddecl) = DECL_ATTRIBUTES (newdecl);
/* If OLDDECL had its DECL_RTL instantiated, re-invoke make_decl_rtl
so that encode_section_info has a chance to look at the new decl
flags and attributes. */
if (DECL_RTL_SET_P (olddecl)
&& (TREE_CODE (olddecl) == FUNCTION_DECL
|| (TREE_CODE (olddecl) == VAR_DECL
&& TREE_STATIC (olddecl))))
make_decl_rtl (olddecl, NULL);
return 1;
}

View File

@ -297,7 +297,7 @@ cb_file_change (pfile, new_map)
}
update_header_times (new_map->to_file);
in_system_header = new_map->sysp != 0;
in_system_header = (warn_system_headers && new_map->sysp != 0);
input_filename = new_map->to_file;
lineno = to_line;
map = new_map;

View File

@ -288,15 +288,22 @@ maybe_apply_pragma_weak (decl)
{
tree *p, t, id;
/* Copied from the check in set_decl_assembler_name. */
if (TREE_CODE (decl) == FUNCTION_DECL
|| (TREE_CODE (decl) == VAR_DECL
&& (TREE_STATIC (decl)
|| DECL_EXTERNAL (decl)
|| TREE_PUBLIC (decl))))
id = DECL_ASSEMBLER_NAME (decl);
else
/* Avoid asking for DECL_ASSEMBLER_NAME when it's not needed. */
/* No weak symbols pending, take the short-cut. */
if (!pending_weaks)
return;
/* If it's not visible outside this file, it doesn't matter whether
it's weak. */
if (!DECL_EXTERNAL (decl) && !TREE_PUBLIC (decl))
return;
/* If it's not a function or a variable, it can't be weak.
FIXME: what kinds of things are visible outside this file but
aren't functions or variables? Should this be an abort() instead? */
if (TREE_CODE (decl) != FUNCTION_DECL && TREE_CODE (decl) != VAR_DECL)
return;
id = DECL_ASSEMBLER_NAME (decl);
for (p = &pending_weaks; (t = *p) ; p = &TREE_CHAIN (t))
if (id == TREE_PURPOSE (t))

View File

@ -4759,6 +4759,14 @@ digest_init (type, init, require_constant)
return inside_init;
}
}
/* Build a VECTOR_CST from a *constant* vector constructor. If the
vector constructor is not constant (e.g. {1,2,3,foo()}) then punt
below and handle as a constructor. */
if (code == VECTOR_TYPE
&& comptypes (TREE_TYPE (inside_init), type)
&& TREE_CONSTANT (inside_init))
return build_vector (type, TREE_OPERAND (inside_init, 1));
/* Any type can be initialized
from an expression of the same type, optionally with braces. */

View File

@ -843,10 +843,13 @@ flags_from_decl_or_type (exp)
if (TREE_NOTHROW (exp))
flags |= ECF_NOTHROW;
if (TREE_READONLY (exp) && ! TREE_THIS_VOLATILE (exp))
flags |= ECF_LIBCALL_BLOCK;
}
if (TREE_READONLY (exp) && ! TREE_THIS_VOLATILE (exp))
flags |= ECF_CONST | ECF_LIBCALL_BLOCK;
flags |= ECF_CONST;
if (TREE_THIS_VOLATILE (exp))
flags |= ECF_NORETURN;

View File

@ -1091,18 +1091,21 @@ machopic_select_section (exp, reloc, align)
int reloc;
unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED;
{
if (TREE_CODE (exp) == STRING_CST)
{
if (flag_writable_strings)
data_section ();
else if (TREE_STRING_LENGTH (exp) !=
strlen (TREE_STRING_POINTER (exp)) + 1)
readonly_data_section ();
else
cstring_section ();
}
else if (TREE_CODE (exp) == INTEGER_CST
|| TREE_CODE (exp) == REAL_CST)
void (*base_function)(void);
if (decl_readonly_section (exp, reloc))
base_function = readonly_data_section;
else if (TREE_READONLY (exp) || TREE_CONSTANT (exp))
base_function = const_data_section;
else
base_function = data_section;
if (TREE_CODE (exp) == STRING_CST
&& TREE_STRING_LENGTH (exp) == strlen (TREE_STRING_POINTER (exp)) + 1
&& ! flag_writable_strings)
cstring_section ();
else if ((TREE_CODE (exp) == INTEGER_CST || TREE_CODE (exp) == REAL_CST)
&& flag_merge_constants)
{
tree size = TYPE_SIZE (TREE_TYPE (exp));
@ -1115,7 +1118,7 @@ machopic_select_section (exp, reloc, align)
TREE_INT_CST_HIGH (size) == 0)
literal8_section ();
else
readonly_data_section ();
base_function ();
}
else if (TREE_CODE (exp) == CONSTRUCTOR
&& TREE_TYPE (exp)
@ -1129,15 +1132,8 @@ machopic_select_section (exp, reloc, align)
objc_constant_string_object_section ();
else if (!strcmp (IDENTIFIER_POINTER (name), "NXConstantString"))
objc_string_object_section ();
else if (TREE_READONLY (exp) || TREE_CONSTANT (exp))
{
if (TREE_SIDE_EFFECTS (exp) || (flag_pic && reloc))
const_data_section ();
else
readonly_data_section ();
}
else
data_section ();
else
base_function ();
}
else if (TREE_CODE (exp) == VAR_DECL &&
DECL_NAME (exp) &&
@ -1191,26 +1187,11 @@ machopic_select_section (exp, reloc, align)
objc_cat_cls_meth_section ();
else if (!strncmp (name, "_OBJC_PROTOCOL_", 15))
objc_protocol_section ();
else if ((TREE_READONLY (exp) || TREE_CONSTANT (exp))
&& !TREE_SIDE_EFFECTS (exp))
{
if (flag_pic && reloc)
const_data_section ();
else
readonly_data_section ();
}
else
data_section ();
else
base_function ();
}
else if (TREE_READONLY (exp) || TREE_CONSTANT (exp))
{
if (TREE_SIDE_EFFECTS (exp) || (flag_pic && reloc))
const_data_section ();
else
readonly_data_section ();
}
else
data_section ();
else
base_function ();
}
/* This can be called with address expressions as "rtx".

View File

@ -26,19 +26,16 @@ Boston, MA 02111-1307, USA. */
#define TARGET_VERSION fprintf (stderr, " (i386 FreeBSD/ELF)");
/* Override the default comment-starter of "/". */
#undef ASM_COMMENT_START
#undef ASM_COMMENT_START
#define ASM_COMMENT_START "#"
#undef ASM_APP_ON
#undef ASM_APP_ON
#define ASM_APP_ON "#APP\n"
#undef ASM_APP_OFF
#undef ASM_APP_OFF
#define ASM_APP_OFF "#NO_APP\n"
#undef SET_ASM_OP
#define SET_ASM_OP "\t.set\t"
#undef DBX_REGISTER_NUMBER
#undef DBX_REGISTER_NUMBER
#define DBX_REGISTER_NUMBER(n) \
(TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
@ -47,18 +44,18 @@ Boston, MA 02111-1307, USA. */
/* Tell final.c that we don't need a label passed to mcount. */
#undef MCOUNT_NAME
#undef MCOUNT_NAME
#define MCOUNT_NAME ".mcount"
/* Make gcc agree with <machine/ansi.h>. */
#undef SIZE_TYPE
#undef SIZE_TYPE
#define SIZE_TYPE "unsigned int"
#undef PTRDIFF_TYPE
#undef PTRDIFF_TYPE
#define PTRDIFF_TYPE "int"
#undef WCHAR_TYPE_SIZE
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE BITS_PER_WORD
/* Provide a STARTFILE_SPEC appropriate for FreeBSD. Here we add
@ -137,8 +134,10 @@ Boston, MA 02111-1307, USA. */
compiler get the contents of <float.h> and std::numeric_limits correct. */
#define SUBTARGET_OVERRIDE_OPTIONS \
do { \
real_format_for_mode[XFmode - QFmode] \
= &ieee_extended_intel_96_round_53_format; \
real_format_for_mode[TFmode - QFmode] \
= &ieee_extended_intel_96_round_53_format; \
if (!TARGET_64BIT) { \
real_format_for_mode[XFmode - QFmode] \
= &ieee_extended_intel_96_round_53_format; \
real_format_for_mode[TFmode - QFmode] \
= &ieee_extended_intel_96_round_53_format; \
} \
} while (0)

View File

@ -32,7 +32,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifndef __GTHREAD_HIDE_WIN32API
# define __GTHREAD_HIDE_WIN32API
# define __GTHREAD_HIDE_WIN32API 1
#endif
#include <gthr-win32.h>
#include <windows.h>

View File

@ -1,24 +1,24 @@
/* Subroutines for insn-output.c for Windows NT.
Contributed by Douglas Rupp (drupp@cs.washington.edu)
Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002
Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
This file is part of GNU CC.
This file is part of GCC.
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.
GCC 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.
GCC 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. */
along with GCC; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
#include "config.h"
#include "system.h"
@ -54,16 +54,18 @@ void i386_pe_mark_dllimport PARAMS ((tree));
/* Handle a "dllimport" or "dllexport" attribute;
arguments as in struct attribute_spec.handler. */
tree
ix86_handle_dll_attribute (node, name, args, flags, no_add_attrs)
tree *node;
ix86_handle_dll_attribute (pnode, name, args, flags, no_add_attrs)
tree * pnode;
tree name;
tree args;
int flags;
bool *no_add_attrs;
{
tree node = *pnode;
/* These attributes may apply to structure and union types being created,
but otherwise should pass to the declaration involved. */
if (!DECL_P (*node))
if (!DECL_P (node))
{
if (flags & ((int) ATTR_FLAG_DECL_NEXT | (int) ATTR_FLAG_FUNCTION_NEXT
| (int) ATTR_FLAG_ARRAY_NEXT))
@ -71,20 +73,56 @@ ix86_handle_dll_attribute (node, name, args, flags, no_add_attrs)
*no_add_attrs = true;
return tree_cons (name, args, NULL_TREE);
}
if (TREE_CODE (*node) != RECORD_TYPE && TREE_CODE (*node) != UNION_TYPE)
if (TREE_CODE (node) != RECORD_TYPE && TREE_CODE (node) != UNION_TYPE)
{
warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
return NULL_TREE;
}
/* `extern' needn't be specified with dllimport.
Specify `extern' now and hope for the best. Sigh. */
else if (TREE_CODE (*node) == VAR_DECL
&& is_attribute_p ("dllimport", name))
/* Report error on dllimport ambiguities seen now before they cause
any damage. */
else if (is_attribute_p ("dllimport", name))
{
DECL_EXTERNAL (*node) = 1;
TREE_PUBLIC (*node) = 1;
/* Like MS, treat definition of dllimported variables and
non-inlined functions on declaration as syntax errors.
We allow the attribute for function definitions if declared
inline, but just ignore it in i386_pe_dllimport_p. */
if (TREE_CODE (node) == FUNCTION_DECL && DECL_INITIAL (node)
&& !DECL_INLINE (node))
{
error_with_decl (node, "function `%s' definition is marked dllimport.");
*no_add_attrs = true;
}
else if (TREE_CODE (node) == VAR_DECL)
{
if (DECL_INITIAL (node))
{
error_with_decl (node,"variable `%s' definition is marked dllimport.");
*no_add_attrs = true;
}
/* `extern' needn't be specified with dllimport.
Specify `extern' now and hope for the best. Sigh. */
DECL_EXTERNAL (node) = 1;
/* Also, implicitly give dllimport'd variables declared within
a function global scope, unless declared static. */
if (current_function_decl != NULL_TREE && !TREE_STATIC (node))
TREE_PUBLIC (node) = 1;
}
}
/* Report error if symbol is not accessible at global scope. */
if (!TREE_PUBLIC (node)
&& (TREE_CODE (node) == VAR_DECL
|| TREE_CODE (node) == FUNCTION_DECL))
{
error_with_decl (node, "external linkage required for symbol '%s' because of '%s' attribute.",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
return NULL_TREE;
@ -169,6 +207,7 @@ i386_pe_dllimport_p (decl)
tree decl;
{
tree imp;
int context_imp = 0;
if (TREE_CODE (decl) == FUNCTION_DECL
&& TARGET_NOP_FUN_DLLIMPORT)
@ -177,17 +216,62 @@ i386_pe_dllimport_p (decl)
if (TREE_CODE (decl) != VAR_DECL
&& TREE_CODE (decl) != FUNCTION_DECL)
return 0;
imp = lookup_attribute ("dllimport", DECL_ATTRIBUTES (decl));
if (imp)
return 1;
/* Class members get the dllimport status of their class. */
if (associated_type (decl))
if (!imp && associated_type (decl))
{
imp = lookup_attribute ("dllimport",
TYPE_ATTRIBUTES (associated_type (decl)));
if (imp)
return 1;
context_imp = 1;
}
if (imp)
{
/* Don't mark defined functions as dllimport. If the definition
itself was marked with dllimport, than ix86_handle_dll_attribute
reports an error. This handles the case when the definition
overrides an earlier declaration. */
if (TREE_CODE (decl) == FUNCTION_DECL && DECL_INITIAL (decl)
&& !DECL_INLINE (decl))
{
/* Don't warn about artificial methods. */
if (!DECL_ARTIFICIAL (decl))
warning_with_decl (decl,"function '%s' is defined after prior declaration as dllimport: attribute ignored.");
return 0;
}
/* We ignore the dllimport attribute for inline member functions.
This differs from MSVC behaviour which treats it like GNUC
'extern inline' extension. */
else if (TREE_CODE (decl) == FUNCTION_DECL && DECL_INLINE (decl))
{
if (extra_warnings)
warning_with_decl (decl, "inline function '%s' is declared as dllimport: attribute ignored.");
return 0;
}
/* Don't allow definitions of static data members in dllimport class,
Just ignore attribute for vtable data. */
else if (TREE_CODE (decl) == VAR_DECL
&& TREE_STATIC (decl) && TREE_PUBLIC (decl)
&& !DECL_EXTERNAL (decl) && context_imp)
{
if (!DECL_VIRTUAL_P (decl))
error_with_decl (decl, "definition of static data member '%s' of dllimport'd class.");
return 0;
}
/* Since we can't treat a pointer to a dllimport'd symbol as a
constant address, we turn off the attribute on C++ virtual
methods to allow creation of vtables using thunks. */
else if (TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE
&& (DECL_VIRTUAL_P (decl)))
return 0;
return 1;
}
return 0;
@ -234,7 +318,12 @@ i386_pe_mark_dllexport (decl)
else
abort ();
if (i386_pe_dllimport_name_p (oldname))
oldname += 9;
{
warning_with_decl (decl,"inconsistent dll linkage for '%s': dllexport assumed.");
/* Remove DLL_IMPORT_PREFIX. */
oldname += 9;
DECL_NON_ADDR_CONST_P (decl) = 0;
}
else if (i386_pe_dllexport_name_p (oldname))
return; /* already done */
@ -278,39 +367,13 @@ i386_pe_mark_dllimport (decl)
}
else if (i386_pe_dllimport_name_p (oldname))
{
/* Already done, but force correct linkage since the redeclaration
might have omitted explicit extern. Sigh. */
if (TREE_CODE (decl) == VAR_DECL
/* ??? Is this test for vtables needed? */
&& !DECL_VIRTUAL_P (decl))
/* Already done, but do a sanity check to prevent assembler errors. */
if (!DECL_EXTERNAL (decl) || !TREE_PUBLIC (decl))
{
DECL_EXTERNAL (decl) = 1;
TREE_PUBLIC (decl) = 1;
error_with_decl (decl, "failure in redeclaration of '%s': dllimport'd symbol lacks external linkage.");
abort();
}
return;
}
/* ??? One can well ask why we're making these checks here,
and that would be a good question. */
/* Imported variables can't be initialized. Note that C++ classes
are marked initial, so we need to check. */
if (TREE_CODE (decl) == VAR_DECL
&& !DECL_VIRTUAL_P (decl)
&& (DECL_INITIAL (decl)
&& ! TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (decl))))
{
error_with_decl (decl, "initialized variable `%s' is marked dllimport");
return;
}
/* Nor can they be static. */
if (TREE_CODE (decl) == VAR_DECL
/* ??? Is this test for vtables needed? */
&& !DECL_VIRTUAL_P (decl)
&& 0 /*???*/)
{
error_with_decl (decl, "static variable `%s' is marked dllimport");
return;
return;
}
newname = alloca (strlen (oldname) + 11);
@ -372,11 +435,8 @@ gen_stdcall_suffix (decl)
void
i386_pe_encode_section_info (decl, first)
tree decl;
int first;
int first ATTRIBUTE_UNUSED;
{
if (!first)
return;
/* This bit is copied from i386.h. */
if (optimize > 0 && TREE_CONSTANT (decl)
&& (!flag_writable_strings || TREE_CODE (decl) != STRING_CST))
@ -393,7 +453,8 @@ i386_pe_encode_section_info (decl, first)
gen_rtx (SYMBOL_REF, Pmode, gen_stdcall_suffix (decl));
/* Mark the decl so we can tell from the rtl whether the object is
dllexport'd or dllimport'd. */
dllexport'd or dllimport'd. This also handles dllexport/dllimport
override semantics. */
if (i386_pe_dllexport_p (decl))
i386_pe_mark_dllexport (decl);
@ -415,6 +476,10 @@ i386_pe_encode_section_info (decl, first)
tree idp = get_identifier (oldname + 9);
rtx newrtl = gen_rtx (SYMBOL_REF, Pmode, IDENTIFIER_POINTER (idp));
warning_with_decl (decl, "'%s' %s after being referenced with dllimport linkage.",
(DECL_INITIAL (decl) || !DECL_EXTERNAL (decl))
? "defined locally" : "redeclared without dllimport attribute");
XEXP (DECL_RTL (decl), 0) = newrtl;
DECL_NON_ADDR_CONST_P (decl) = 0;
@ -698,4 +763,3 @@ i386_pe_asm_file_end (file)
}
}
}

View File

@ -1467,11 +1467,7 @@ ia64_expand_call (retval, addr, nextarg, sibcall_p)
}
if (sibcall_p)
{
use_reg (&CALL_INSN_FUNCTION_USAGE (insn), b0);
use_reg (&CALL_INSN_FUNCTION_USAGE (insn),
gen_rtx_REG (DImode, AR_PFS_REGNUM));
}
use_reg (&CALL_INSN_FUNCTION_USAGE (insn), b0);
}
void
ia64_reload_gp ()
@ -1524,7 +1520,7 @@ ia64_split_call (retval, addr, retaddr, scratch_r, scratch_b,
/* If we find we're calling through a register, then we're actually
calling through a descriptor, so load up the values. */
if (REG_P (addr))
if (REG_P (addr) && GR_REGNO_P (REGNO (addr)))
{
rtx tmp;
bool addr_dead_p;
@ -2746,7 +2742,7 @@ ia64_expand_epilogue (sibcall_p)
reg = gen_rtx_REG (DImode, AR_PFS_REGNUM);
emit_move_insn (reg, alt_reg);
}
else if (! current_function_is_leaf)
else if (TEST_HARD_REG_BIT (current_frame_info.mask, AR_PFS_REGNUM))
{
alt_regno = next_scratch_gr_reg ();
alt_reg = gen_rtx_REG (DImode, alt_regno);
@ -7162,12 +7158,11 @@ ia64_epilogue_uses (regno)
switch (regno)
{
case R_GR (1):
/* When a function makes a call through a function descriptor, we
will write a (potentially) new value to "gp". After returning
from such a call, we need to make sure the function restores the
original gp-value, even if the function itself does not use the
gp anymore. */
return (TARGET_CONST_GP && !(TARGET_AUTO_PIC || TARGET_NO_PIC));
/* With a call to a function in another module, we will write a new
value to "gp". After returning from such a call, we need to make
sure the function restores the original gp-value, even if the
function itself does not use the gp anymore. */
return !(TARGET_AUTO_PIC || TARGET_NO_PIC);
case IN_REG (0): case IN_REG (1): case IN_REG (2): case IN_REG (3):
case IN_REG (4): case IN_REG (5): case IN_REG (6): case IN_REG (7):
@ -7349,14 +7344,9 @@ bool
ia64_function_ok_for_sibcall (decl)
tree decl;
{
/* Direct calls are always ok. */
if (decl)
return true;
/* If TARGET_CONST_GP is in effect, then our caller expects us to
return with our current GP. This means that we'll always have
a GP reload after an indirect call. */
return !ia64_epilogue_uses (R_GR (1));
/* We must always return with our current GP. This means we can
only sibcall to functions defined in the current module. */
return decl && (*targetm.binds_local_p) (decl);
}
/* Output assembly directives for prologue regions. */

View File

@ -5280,16 +5280,16 @@
{
static const char * const alt[2][4] = {
{
"lfetch.nta [%0]",
"lfetch.nt1 [%0]",
"lfetch.nt2 [%0]",
"lfetch [%0]"
"%,lfetch.nta [%0]",
"%,lfetch.nt1 [%0]",
"%,lfetch.nt2 [%0]",
"%,lfetch [%0]"
},
{
"lfetch.excl.nta [%0]",
"lfetch.excl.nt1 [%0]",
"lfetch.excl.nt2 [%0]",
"lfetch.excl [%0]"
"%,lfetch.excl.nta [%0]",
"%,lfetch.excl.nt1 [%0]",
"%,lfetch.excl.nt2 [%0]",
"%,lfetch.excl [%0]"
}
};
int i = (INTVAL (operands[1]));

View File

@ -11110,6 +11110,23 @@ rs6000_output_function_epilogue (file, size)
}
}
#if TARGET_OBJECT_FORMAT == OBJECT_MACHO
/* Mach-O doesn't support labels at the end of objects, so if
it looks like we might want one, insert a NOP. */
{
rtx insn = get_last_insn ();
while (insn
&& NOTE_P (insn)
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED_LABEL)
insn = PREV_INSN (insn);
if (insn
&& (LABEL_P (insn)
|| (NOTE_P (insn)
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED_LABEL)))
fputs ("\tnop\n", file);
}
#endif
/* Output a traceback table here. See /usr/include/sys/debug.h for info
on its format.

View File

@ -4037,11 +4037,19 @@ sparc_nonflat_function_epilogue (file, size, leaf_function)
of a function were call foo; dslot; this can make the return
PC of foo (ie. address of call instruction plus 8) point to
the first instruction in the next function. */
rtx insn;
fputs("\tnop\n", file);
rtx insn, last_real_insn;
insn = get_last_insn ();
last_real_insn = prev_real_insn (insn);
if (last_real_insn
&& GET_CODE (last_real_insn) == INSN
&& GET_CODE (PATTERN (last_real_insn)) == SEQUENCE)
last_real_insn = XVECEXP (PATTERN (last_real_insn), 0, 0);
if (last_real_insn && GET_CODE (last_real_insn) == CALL_INSN)
fputs("\tnop\n", file);
if (GET_CODE (insn) == NOTE)
insn = prev_nonnote_insn (insn);
if (insn && GET_CODE (insn) == BARRIER)

View File

@ -1,3 +1,105 @@
2003-08-04 Release Manager
* GCC 3.3.1 Released.
2003-08-04 Release Manager
* GCC 3.3.1 Released.
2003-08-04 Mark Mitchell <mark@codesourcery.com>
PR c++/11713
* search.c (setup_class_bindings): Handle conversion operators
specially.
2003-07-24 Alexandre Oliva <aoliva@redhat.com>
PR c++/10796
* decl.c (finish_enum): Make sure the underlying integer type has
the same precision as some full integer type. Reverts part
2003-06-27's patch that didn't play any role in fixing the PR.
2003-07-24 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (convert_to_base_statically): Declare.
* call.c (build_special_member_call): Convert INSTANCE to the base
type.
* class.c (convert_to_base_statically): New method.
* init.c (construct_virtual_base): Use it.
* method.c (do_build_assign_ref): Fix typo in comment.
2003-07-24 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/11513
* cp-tree.h (PROCESSING_REAL_TEMPLATE_DECL_P): Use current_scope.
2003-07-23 Mark Mitchell <mark@codesourcery.com>
PR c++/11645
* cp-tree.h (accessible_base_p): Declare.
* call.c (build_over_call): Use it.
* search.c (accessible_base_p): New function, split out from ...
(lookup_base): ... here.
2003-07-23 Nathan Sidwell <nathan@codesourcery.com>
PR c++/11282
* decl.c: (reshape_init): Always advance *INITP.
2003-07-19 Mark Mitchell <mark@codesourcery.com>
PR c++/11546
* pt.c (lookup_template_class): Treat TYPE_DECLs as TEMPLATE_DECLs
where appropriate.
2003-07-14 Mark Mitchell <mark@codesourcery.com>
PR c++/7053
* pt.c (unregister_specialization): Rename to ...
(reregister_specialization): ... this.
(tsubst_friend_function): Use it.
(regenerate_decl_from_template): Likewise.
2003-07-14 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/11154
* pt.c (more_specialized_class): Add full_args parameter.
(most_specialized_class): Adjust calls to more_specialized_class.
* cp-tree.h (more_specialized_class): Adjust declaration.
2003-07-13 Mark Mitchell <mark@codesourcery.com>
PR c++/11503
* cp-tree.h (DECL_SELF_REFERENCE_P): New macro.
(SET_DECL_SELF_REFERENCE_P): Likewise.
* class.c (build_self_reference): Use SET_DECL_SELF_REFERENCE_P.
* pt.c (tsubst_decl): Copy it.
* search.c (lookup_base): Use DECL_SELF_REFERENCE_P.
2003-07-11 Danny Smith <dannysmith@users.sourceforge.net>
Backport from mainline.
2003-05-21 Danny Smith <dannysmith@users.sourceforge.net>
PR c++/9738
* decl.c (duplicate_decls): Re-invoke make_decl_rtl
if the old decl had instantiated DECL_RTL.
(Based on Richard Henderson 2003-05-13 patch to c-decl.c).
2003-07-11 Mark Mitchell <mark@codesourcery.com>
PR c++/8164
* decl.c (duplicate_decls): Avoid mangling names unnecessarily.
2003-07-10 Mark Mitchell <mark@codesourcery.com>
PR c++/10558
* parse.y (class_template_ok_as_expr): New variable.
(template_arg_1): New non-terminal.
(primary): Issue errors about uses of class templates as
expressions.
2003-07-09 Mark Mitchell <mark@codesourcery.com>
PR c++/10032

View File

@ -4527,12 +4527,17 @@ build_over_call (cand, args, flags)
TREE_VALUE (arg),
cand->conversion_path,
1);
/* Check that the base class is accessible. */
if (!accessible_base_p (TREE_TYPE (argtype),
BINFO_TYPE (cand->conversion_path)))
error ("`%T' is not an accessible base of `%T'",
BINFO_TYPE (cand->conversion_path),
TREE_TYPE (argtype));
/* If fn was found by a using declaration, the conversion path
will be to the derived class, not the base declaring fn. We
must convert from derived to base. */
base_binfo = lookup_base (TREE_TYPE (TREE_TYPE (converted_arg)),
TREE_TYPE (parmtype), ba_ignore, NULL);
converted_arg = build_base_path (PLUS_EXPR, converted_arg,
base_binfo, 1);
@ -4857,11 +4862,23 @@ build_special_member_call (tree instance, tree name, tree args,
TREE_TYPE (instance) = build_pointer_type (class_type);
instance = build1 (INDIRECT_REF, class_type, instance);
}
else if (name == complete_dtor_identifier
|| name == base_dtor_identifier
|| name == deleting_dtor_identifier)
my_friendly_assert (args == NULL_TREE, 20020712);
else
{
if (name == complete_dtor_identifier
|| name == base_dtor_identifier
|| name == deleting_dtor_identifier)
my_friendly_assert (args == NULL_TREE, 20020712);
/* We must perform the conversion here so that we do not
subsequently check to see whether BINFO is an accessible
base. (It is OK for a constructor to call a constructor in
an inaccessible base as long as the constructor being called
is accessible.) */
if (!same_type_ignoring_top_level_qualifiers_p
(TREE_TYPE (instance), BINFO_TYPE (binfo)))
instance = convert_to_base_statically (instance, binfo);
}
my_friendly_assert (instance != NULL_TREE, 20020712);
/* Resolve the name. */
@ -4899,7 +4916,9 @@ build_special_member_call (tree instance, tree name, tree args,
args = tree_cons (NULL_TREE, sub_vtt, args);
}
return build_new_method_call (instance, fns, args, binfo, flags);
return build_new_method_call (instance, fns, args,
TYPE_BINFO (BINFO_TYPE (binfo)),
flags);
}
/* Build a call to "INSTANCE.FN (ARGS)". */

View File

@ -401,6 +401,33 @@ convert_to_base (tree object, tree type, bool check_access)
return build_base_path (PLUS_EXPR, object, binfo, /*nonnull=*/1);
}
/* EXPR is an expression with class type. BASE is a base class (a
BINFO) of that class type. Returns EXPR, converted to the BASE
type. This function assumes that EXPR is the most derived class;
therefore virtual bases can be found at their static offsets. */
tree
convert_to_base_statically (tree expr, tree base)
{
tree expr_type;
expr_type = TREE_TYPE (expr);
if (!same_type_p (expr_type, BINFO_TYPE (base)))
{
tree pointer_type;
pointer_type = build_pointer_type (expr_type);
expr = build_unary_op (ADDR_EXPR, expr, /*noconvert=*/1);
if (!integer_zerop (BINFO_OFFSET (base)))
expr = build (PLUS_EXPR, pointer_type, expr,
build_nop (pointer_type, BINFO_OFFSET (base)));
expr = build_nop (build_pointer_type (BINFO_TYPE (base)), expr);
expr = build1 (INDIRECT_REF, BINFO_TYPE (base), expr);
}
return expr;
}
/* Virtual function things. */
@ -6537,6 +6564,7 @@ build_self_reference ()
DECL_NONLOCAL (value) = 1;
DECL_CONTEXT (value) = current_class_type;
DECL_ARTIFICIAL (value) = 1;
SET_DECL_SELF_REFERENCE_P (value);
if (processing_template_decl)
value = push_template_decl (value);

View File

@ -98,6 +98,7 @@ struct diagnostic_context;
3: DECL_IN_AGGR_P.
4: DECL_C_BIT_FIELD (in a FIELD_DECL)
DECL_VAR_MARKED_P (in a VAR_DECL)
DECL_SELF_REFERENCE_P (in a TYPE_DECL)
5: DECL_INTERFACE_KNOWN.
6: DECL_THIS_STATIC (in VAR_DECL or FUNCTION_DECL).
7: DECL_DEAD_FOR_LOCAL (in VAR_DECL).
@ -2878,16 +2879,20 @@ struct lang_decl GTY(())
(TREE_CODE (NODE) == TYPE_DECL || DECL_CLASS_TEMPLATE_P (NODE))
/* Nonzero if NODE is the typedef implicitly generated for a type when
the type is declared. (In C++, `struct S {};' is roughly equivalent
to `struct S {}; typedef struct S S;' in C. This macro will hold
for the typedef indicated in this example. Note that in C++, there
is a second implicit typedef for each class, in the scope of `S'
itself, so that you can say `S::S'. This macro does *not* hold for
those typedefs. */
the type is declared. In C++, `struct S {};' is roughly
equivalent to `struct S {}; typedef struct S S;' in C.
DECL_IMPLICIT_TYPEDEF_P will hold for the typedef indicated in this
example. In C++, there is a second implicit typedef for each
class, in the scope of `S' itself, so that you can say `S::S'.
DECL_SELF_REFERENCE_P will hold for that second typedef. */
#define DECL_IMPLICIT_TYPEDEF_P(NODE) \
(TREE_CODE (NODE) == TYPE_DECL && DECL_LANG_FLAG_2 (NODE))
#define SET_DECL_IMPLICIT_TYPEDEF_P(NODE) \
(DECL_LANG_FLAG_2 (NODE) = 1)
#define DECL_SELF_REFERENCE_P(NODE) \
(TREE_CODE (NODE) == TYPE_DECL && DECL_LANG_FLAG_4 (NODE))
#define SET_DECL_SELF_REFERENCE_P(NODE) \
(DECL_LANG_FLAG_4 (NODE) = 1)
/* A `primary' template is one that has its own template header. A
member function of a class template is a template, but not primary.
@ -2956,7 +2961,7 @@ struct lang_decl GTY(())
entity with its own template parameter list, and which is not a
full specialization. */
#define PROCESSING_REAL_TEMPLATE_DECL_P() \
(processing_template_decl > template_class_depth (current_class_type))
(processing_template_decl > template_class_depth (current_scope ()))
/* Nonzero if this VAR_DECL or FUNCTION_DECL has already been
instantiated, i.e. its definition has been generated from the
@ -3627,6 +3632,7 @@ extern tree perform_direct_initialization_if_possible (tree, tree);
/* in class.c */
extern tree build_base_path PARAMS ((enum tree_code, tree, tree, int));
extern tree convert_to_base (tree, tree, bool);
extern tree convert_to_base_statically (tree, tree);
extern tree build_vtbl_ref PARAMS ((tree, tree));
extern tree build_vfn_ref PARAMS ((tree, tree));
extern tree get_vtable_decl PARAMS ((tree, int));
@ -4081,7 +4087,7 @@ extern tree instantiate_decl PARAMS ((tree, int));
extern tree get_bindings PARAMS ((tree, tree, tree));
extern int push_tinst_level PARAMS ((tree));
extern void pop_tinst_level PARAMS ((void));
extern int more_specialized_class PARAMS ((tree, tree));
extern int more_specialized_class PARAMS ((tree, tree, tree));
extern int is_member_template PARAMS ((tree));
extern int comp_template_parms PARAMS ((tree, tree));
extern int template_class_depth PARAMS ((tree));
@ -4117,6 +4123,7 @@ extern int unemitted_tinfo_decl_p PARAMS((tree, void *));
extern int emit_tinfo_decl PARAMS((tree *, void *));
/* in search.c */
extern bool accessible_base_p (tree, tree);
extern tree lookup_base PARAMS ((tree, tree, base_access, base_kind *));
extern int types_overlap_p PARAMS ((tree, tree));
extern tree get_vbase PARAMS ((tree, tree));

View File

@ -3514,7 +3514,9 @@ duplicate_decls (newdecl, olddecl)
/* Already complained about this, so don't do so again. */
else if (current_class_type == NULL_TREE
|| IDENTIFIER_ERROR_LOCUS (DECL_ASSEMBLER_NAME (newdecl)) != current_class_type)
|| !DECL_ASSEMBLER_NAME_SET_P (newdecl)
|| (IDENTIFIER_ERROR_LOCUS (DECL_ASSEMBLER_NAME (newdecl))
!= current_class_type))
{
error ("conflicting types for `%#D'", newdecl);
cp_error_at ("previous declaration as `%#D'", olddecl);
@ -4039,6 +4041,15 @@ duplicate_decls (newdecl, olddecl)
Update OLDDECL to be the same. */
DECL_ATTRIBUTES (olddecl) = DECL_ATTRIBUTES (newdecl);
/* If OLDDECL had its DECL_RTL instantiated, re-invoke make_decl_rtl
so that encode_section_info has a chance to look at the new decl
flags and attributes. */
if (DECL_RTL_SET_P (olddecl)
&& (TREE_CODE (olddecl) == FUNCTION_DECL
|| (TREE_CODE (olddecl) == VAR_DECL
&& TREE_STATIC (olddecl))))
make_decl_rtl (olddecl, NULL);
return 1;
}
@ -8191,6 +8202,7 @@ reshape_init (tree type, tree *initp)
{
my_friendly_assert (TREE_CODE (old_init) == TREE_LIST, 20021202);
TREE_VALUE (old_init) = error_mark_node;
*initp = TREE_CHAIN (old_init);
return old_init;
}
@ -14004,16 +14016,16 @@ finish_enum (enumtype)
else
fixup_signed_type (enumtype);
/* We use "int" or "unsigned int" as the underlying type, unless all
the values will not fit or the user has requested that we try to
use shorter types where possible. */
if (precision < TYPE_PRECISION (integer_type_node)
&& !flag_short_enums)
{
TYPE_PRECISION (enumtype) = TYPE_PRECISION (integer_type_node);
TYPE_SIZE (enumtype) = NULL_TREE;
layout_type (enumtype);
}
if (flag_short_enums || (precision > TYPE_PRECISION (integer_type_node)))
/* Use the width of the narrowest normal C type which is wide
enough. */
TYPE_PRECISION (enumtype) = TYPE_PRECISION (c_common_type_for_size
(precision, 1));
else
TYPE_PRECISION (enumtype) = TYPE_PRECISION (integer_type_node);
TYPE_SIZE (enumtype) = NULL_TREE;
layout_type (enumtype);
/* Fix up all variant types of this enum type. */
for (t = TYPE_MAIN_VARIANT (enumtype); t; t = TYPE_NEXT_VARIANT (t))

View File

@ -880,18 +880,10 @@ construct_virtual_base (tree vbase, tree arguments)
constructing virtual bases, then we must be the most derived
class. Therefore, we don't have to look up the virtual base;
we already know where it is. */
exp = build (PLUS_EXPR,
TREE_TYPE (current_class_ptr),
current_class_ptr,
fold (build1 (NOP_EXPR, TREE_TYPE (current_class_ptr),
BINFO_OFFSET (vbase))));
exp = build1 (NOP_EXPR,
build_pointer_type (BINFO_TYPE (vbase)),
exp);
exp = build1 (INDIRECT_REF, BINFO_TYPE (vbase), exp);
exp = convert_to_base_statically (current_class_ref, vbase);
expand_aggr_init_1 (vbase, current_class_ref, exp,
arguments, LOOKUP_COMPLAIN);
expand_aggr_init_1 (vbase, current_class_ref, exp, arguments,
LOOKUP_COMPLAIN);
finish_compound_stmt (/*has_no_scope=*/1, compound_stmt);
finish_then_clause (inner_if_stmt);
finish_if_stmt ();

View File

@ -661,7 +661,7 @@ do_build_assign_ref (fndecl)
int cvquals = cp_type_quals (TREE_TYPE (parm));
int i;
/* Assign to each of thedirect base classes. */
/* Assign to each of the direct base classes. */
for (i = 0; i < CLASSTYPE_N_BASECLASSES (current_class_type); ++i)
{
tree binfo;

View File

@ -56,6 +56,7 @@ Boston, MA 02111-1307, USA. */
static short *malloced_yyss;
static void *malloced_yyvs;
static int class_template_ok_as_expr;
#define yyoverflow(MSG, SS, SSSIZE, VS, VSSIZE, YYSSZ) \
do { \
@ -449,7 +450,7 @@ check_class_key (key, aggr)
%type <code> template_close_bracket
%type <ttype> apparent_template_type
%type <ttype> template_type template_arg_list template_arg_list_opt
%type <ttype> template_arg
%type <ttype> template_arg template_arg_1
%type <ttype> condition xcond paren_cond_or_null
%type <ttype> type_name nested_name_specifier nested_type ptr_to_mem
%type <ttype> complete_type_name notype_identifier nonnested_type
@ -1121,7 +1122,7 @@ template_close_bracket:
template_arg_list_opt:
/* empty */
{ $$ = NULL_TREE; }
| template_arg_list
| template_arg_list
;
template_arg_list:
@ -1132,6 +1133,15 @@ template_arg_list:
;
template_arg:
{ ++class_template_ok_as_expr; }
template_arg_1
{
--class_template_ok_as_expr;
$$ = $2;
}
;
template_arg_1:
type_id
{ $$ = groktypename ($1.t); }
| PTYPENAME
@ -1704,7 +1714,14 @@ primary:
$$ = $2;
}
| overqualified_id %prec HYPERUNARY
{ $$ = build_offset_ref (OP0 ($$), OP1 ($$)); }
{ $$ = build_offset_ref (OP0 ($$), OP1 ($$));
if (!class_template_ok_as_expr
&& DECL_CLASS_TEMPLATE_P ($$))
{
error ("invalid use of template `%D'", $$);
$$ = error_mark_node;
}
}
| overqualified_id '(' nonnull_exprlist ')'
{ $$ = parse_finish_call_expr ($1, $3, 0); }
| overqualified_id LEFT_RIGHT

View File

@ -128,7 +128,7 @@ static tree retrieve_specialization PARAMS ((tree, tree));
static tree retrieve_local_specialization PARAMS ((tree));
static tree register_specialization PARAMS ((tree, tree, tree));
static void register_local_specialization PARAMS ((tree, tree));
static int unregister_specialization PARAMS ((tree, tree));
static int reregister_specialization PARAMS ((tree, tree, tree));
static tree reduce_template_parm_level PARAMS ((tree, tree, int));
static tree build_template_decl PARAMS ((tree, tree));
static int mark_template_parm PARAMS ((tree, void *));
@ -1041,13 +1041,11 @@ register_specialization (spec, tmpl, args)
}
/* Unregister the specialization SPEC as a specialization of TMPL.
Returns nonzero if the SPEC was listed as a specialization of
TMPL. */
Replace it with NEW_SPEC, if NEW_SPEC is non-NULL. Returns true
if the SPEC was listed as a specialization of TMPL. */
static int
unregister_specialization (spec, tmpl)
tree spec;
tree tmpl;
reregister_specialization (tree spec, tree tmpl, tree new_spec)
{
tree* s;
@ -1056,7 +1054,10 @@ unregister_specialization (spec, tmpl)
s = &TREE_CHAIN (*s))
if (TREE_VALUE (*s) == spec)
{
*s = TREE_CHAIN (*s);
if (!new_spec)
*s = TREE_CHAIN (*s);
else
TREE_VALUE (*s) = new_spec;
return 1;
}
@ -4086,10 +4087,20 @@ lookup_template_class (d1, arglist, in_decl, context, entering_scope, complain)
}
if (template)
context = DECL_CONTEXT (template);
if (template
&& TREE_CODE (template) == TYPE_DECL
&& IS_AGGR_TYPE (TREE_TYPE (template))
&& TREE_CODE (TREE_TYPE (template)) != TEMPLATE_TYPE_PARM)
{
d1 = template;
goto type_decl;
}
}
else if (TREE_CODE (d1) == TYPE_DECL && IS_AGGR_TYPE (TREE_TYPE (d1)))
{
tree type = TREE_TYPE (d1);
tree type;
type_decl:
type = TREE_TYPE (d1);
/* If we are declaring a constructor, say A<T>::A<T>, we will get
an implicit typename for the second A. Deal with it. */
@ -4997,8 +5008,9 @@ tsubst_friend_function (decl, args)
DECL_TEMPLATE_INFO (old_decl) = new_friend_template_info;
if (TREE_CODE (old_decl) != TEMPLATE_DECL)
/* duplicate_decls will take care of this case. */
;
reregister_specialization (new_friend,
most_general_template (old_decl),
old_decl);
else
{
tree t;
@ -6340,6 +6352,8 @@ tsubst_decl (t, args, type, complain)
r = copy_decl (t);
if (TREE_CODE (r) == VAR_DECL)
type = complete_type (type);
else if (DECL_SELF_REFERENCE_P (t))
SET_DECL_SELF_REFERENCE_P (r);
TREE_TYPE (r) = type;
c_apply_type_quals_to_decl (cp_type_quals (type), r);
DECL_CONTEXT (r) = ctx;
@ -9450,22 +9464,25 @@ more_specialized (pat1, pat2, deduce, len)
1 if PAT1 is more specialized than PAT2 as described in [temp.class.order].
-1 if PAT2 is more specialized than PAT1.
0 if neither is more specialized. */
0 if neither is more specialized.
FULL_ARGS is the full set of template arguments that triggers this
partial ordering. */
int
more_specialized_class (pat1, pat2)
tree pat1, pat2;
more_specialized_class (pat1, pat2, full_args)
tree pat1, pat2, full_args;
{
tree targs;
int winner = 0;
targs = get_class_bindings (TREE_VALUE (pat1), TREE_PURPOSE (pat1),
TREE_PURPOSE (pat2));
add_outermost_template_args (full_args, TREE_PURPOSE (pat2)));
if (targs)
--winner;
targs = get_class_bindings (TREE_VALUE (pat2), TREE_PURPOSE (pat2),
TREE_PURPOSE (pat1));
add_outermost_template_args (full_args, TREE_PURPOSE (pat1)));
if (targs)
++winner;
@ -9751,7 +9768,7 @@ most_specialized_class (tmpl, args)
t = TREE_CHAIN (t);
for (; t; t = TREE_CHAIN (t))
{
fate = more_specialized_class (champ, t);
fate = more_specialized_class (champ, t, args);
if (fate == 1)
;
else
@ -9768,7 +9785,7 @@ most_specialized_class (tmpl, args)
for (t = list; t && t != champ; t = TREE_CHAIN (t))
{
fate = more_specialized_class (champ, t);
fate = more_specialized_class (champ, t, args);
if (fate != 1)
return error_mark_node;
}
@ -10106,7 +10123,7 @@ regenerate_decl_from_template (decl, tmpl)
instantiation. */
gen_tmpl = most_general_template (tmpl);
push_access_scope_real (gen_tmpl, args, DECL_CONTEXT (decl));
unregistered = unregister_specialization (decl, gen_tmpl);
unregistered = reregister_specialization (decl, gen_tmpl, NULL_TREE);
/* If the DECL was not unregistered then something peculiar is
happening: we created a specialization but did not call

View File

@ -254,6 +254,28 @@ lookup_base_r (binfo, base, access, is_virtual, binfo_ptr)
return found;
}
/* Returns true if type BASE is accessible in T. (BASE is known to be
a base class of T.) */
bool
accessible_base_p (tree t, tree base)
{
tree decl;
/* [class.access.base]
A base class is said to be accessible if an invented public
member of the base class is accessible. */
/* Rather than inventing a public member, we use the implicit
public typedef created in the scope of every class. */
decl = TYPE_FIELDS (base);
while (!DECL_SELF_REFERENCE_P (decl))
decl = TREE_CHAIN (decl);
while (ANON_AGGR_TYPE_P (t))
t = TYPE_CONTEXT (t);
return accessible_p (t, decl);
}
/* Lookup BASE in the hierarchy dominated by T. Do access checking as
ACCESS specifies. Return the binfo we discover (which might not be
canonical). If KIND_PTR is non-NULL, fill with information about
@ -313,41 +335,24 @@ lookup_base (t, base, access, kind_ptr)
break;
default:
if (access != ba_ignore
if ((access & ~ba_quiet) != ba_ignore
/* If BASE is incomplete, then BASE and TYPE are probably
the same, in which case BASE is accessible. If they
are not the same, then TYPE is invalid. In that case,
there's no need to issue another error here, and
there's no implicit typedef to use in the code that
follows, so we skip the check. */
&& COMPLETE_TYPE_P (base))
&& COMPLETE_TYPE_P (base)
&& !accessible_base_p (t, base))
{
tree decl;
/* [class.access.base]
A base class is said to be accessible if an invented public
member of the base class is accessible. */
/* Rather than inventing a public member, we use the implicit
public typedef created in the scope of every class. */
decl = TYPE_FIELDS (base);
while (TREE_CODE (decl) != TYPE_DECL
|| !DECL_ARTIFICIAL (decl)
|| DECL_NAME (decl) != constructor_name (base))
decl = TREE_CHAIN (decl);
while (ANON_AGGR_TYPE_P (t))
t = TYPE_CONTEXT (t);
if (!accessible_p (t, decl))
if (!(access & ba_quiet))
{
if (!(access & ba_quiet))
{
error ("`%T' is an inaccessible base of `%T'", base, t);
binfo = error_mark_node;
}
else
binfo = NULL_TREE;
bk = bk_inaccessible;
error ("`%T' is an inaccessible base of `%T'", base, t);
binfo = error_mark_node;
}
else
binfo = NULL_TREE;
bk = bk_inaccessible;
}
break;
}
@ -2635,6 +2640,20 @@ setup_class_bindings (name, type_binding_p)
if (BASELINK_P (value_binding))
/* NAME is some overloaded functions. */
value_binding = BASELINK_FUNCTIONS (value_binding);
/* Two conversion operators that convert to the same type
may have different names. (See
mangle_conv_op_name_for_type.) To avoid recording the
same conversion operator declaration more than once we
must check to see that the same operator was not already
found under another name. */
if (IDENTIFIER_TYPENAME_P (name)
&& is_overloaded_fn (value_binding))
{
tree fns;
for (fns = value_binding; fns; fns = OVL_NEXT (fns))
if (IDENTIFIER_CLASS_VALUE (DECL_NAME (OVL_CURRENT (fns))))
return;
}
pushdecl_class_level (value_binding);
}
}

View File

@ -502,7 +502,7 @@ parse_defined (pfile)
if (node)
{
if (pfile->context != initial_context)
if (pfile->context != initial_context && CPP_PEDANTIC (pfile))
cpp_error (pfile, DL_WARNING,
"this use of \"defined\" may not be portable");

View File

@ -1621,9 +1621,7 @@ dbxout_type (type, full)
* BITS_PER_UNIT);
putc (',', asmfile);
CHARS (1);
print_wide_int (tree_low_cst (DECL_SIZE
(TYPE_NAME
(BINFO_TYPE (child))),
print_wide_int (tree_low_cst (TYPE_SIZE (BINFO_TYPE (child)),
0)
* BITS_PER_UNIT);
putc (';', asmfile);

View File

@ -1,4 +1,4 @@
@c Copyright (c) 1999, 2000, 2001 Free Software Foundation, Inc.
@c Copyright (c) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
@c Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@ -645,7 +645,7 @@ the unqualified name of the name of the namespace (@pxref{Identifiers}).
The name of the global namespace is @samp{::}, even though in C++ the
global namespace is unnamed. However, you should use comparison with
@code{global_namespace}, rather than @code{DECL_NAME} to determine
whether or not a namespaces is the global one. An unnamed namespace
whether or not a namespace is the global one. An unnamed namespace
will have a @code{DECL_NAME} equal to @code{anonymous_namespace_name}.
Within a single translation unit, all unnamed namespaces will have the
same name.

View File

@ -5,7 +5,7 @@
@node Collect2
@chapter @code{collect2}
GNU CC uses a utility called @code{collect2} on nearly all systems to arrange
GCC uses a utility called @code{collect2} on nearly all systems to arrange
to call various initialization functions at start time.
The program @code{collect2} works by linking the program once and

View File

@ -377,8 +377,9 @@ comment.
@end group
@end example
Comments are not recognized within string literals. @t{@w{"/* blah
*/"}} is the string constant @samp{@w{/* blah */}}, not an empty string.
Comments are not recognized within string literals.
@t{@w{"/* blah */"}} is the string constant @samp{@w{/* blah */}}, not
an empty string.
Line comments are not in the 1989 edition of the C standard, but they
are recognized by GCC as an extension. In C++ and in the 1999 edition
@ -1731,7 +1732,7 @@ predefined macros, but you cannot undefine them.
@subsection Standard Predefined Macros
@cindex standard predefined macros.
The standard predefined macros are specified by the C and/or C++
The standard predefined macros are specified by the relevant
language standards, so they are available with all compilers that
implement those standards. Older compilers may not provide all of
them. Their names all start with double underscores.
@ -1850,6 +1851,15 @@ of the 1998 C++ standard will define this macro to @code{199711L}. The
GNU C++ compiler is not yet fully conforming, so it uses @code{1}
instead. We hope to complete our implementation in the near future.
@item __OBJC__
This macro is defined, with value 1, when the Objective-C compiler is in
use. You can use @code{__OBJC__} to test whether a header is compiled
by a C compiler or a Objective-C compiler.
@item __ASSEMBLER__
This macro is defined with value 1 when preprocessing assembly
language.
@end table
@node Common Predefined Macros
@ -1911,11 +1921,6 @@ calculate a single number, then compare that against a threshold:
@noindent
Many people find this form easier to understand.
@item __OBJC__
This macro is defined, with value 1, when the Objective-C compiler is in
use. You can use @code{__OBJC__} to test whether a header is compiled
by a C compiler or a Objective-C compiler.
@item __GNUG__
The GNU C++ compiler defines this. Testing it is equivalent to
testing @code{@w{(__GNUC__ && __cplusplus)}}.
@ -1940,6 +1945,9 @@ incremented on every @samp{#include} directive and decremented at the
end of every included file. It starts out at 0, it's value within the
base file specified on the command line.
@item __ELF__
This macro is defined if the target uses the ELF object format.
@item __VERSION__
This macro expands to a string constant which describes the version of
the compiler in use. You should not rely on its contents having any
@ -2031,6 +2039,12 @@ This macro is defined, with value 1, if (and only if) the NeXT runtime
(as in @option{-fnext-runtime}) is in use for Objective-C. If the GNU
runtime is used, this macro is not defined, so that you can use this
macro to determine which runtime (NeXT or GNU) is being used.
@item __LP64__
@item _LP64
These macros are defined, with value 1, if (and only if) the compilation
is for a target where @code{long int} and pointer both use 64-bits and
@code{int} uses 32-bit.
@end table
@node System-specific Predefined Macros

View File

@ -40,8 +40,11 @@ provided with a @option{-D} option.
@item -undef
@opindex undef
Do not predefine any system-specific macros. The common predefined
macros remain defined.
Do not predefine any system-specific or GCC-specific macros. The
standard predefined macros remain defined.
@ifset cppmanual
@xref{Standard Predefined Macros}.
@end ifset
@item -I @var{dir}
@opindex I
@ -562,13 +565,6 @@ the source line.
The @option{-CC} option is generally used to support lint comments.
@item -gcc
@opindex gcc
Define the macros @sc{__gnuc__}, @sc{__gnuc_minor__} and
@sc{__gnuc_patchlevel__}. These are defined automatically when you use
@command{gcc -E}; you can turn them off in that case with
@option{-no-gcc}.
@item -traditional-cpp
@opindex traditional-cpp
Try to imitate the behavior of old-fashioned C preprocessors, as

View File

@ -1,5 +1,5 @@
@c Copyright (C) 1988,1989,1992,1993,1994,1996,1998,1999,2000,2001,2002,
@c 2003 Free Software Foundation, Inc.
@c Copyright (C) 1988,1989,1992,1993,1994,1996,1998,1999,2000,2001,2002, 2003
@c Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@ -1371,7 +1371,8 @@ struct empty @{
@end example
The structure will have size zero. In C++, empty structures are part
of the language, and the language standard says they have size 1.
of the language. G++ treats empty structures as if they had a single
member of type @code{char}.
@node Variable Length
@section Arrays of Variable Length
@ -1527,8 +1528,8 @@ argument, these arguments are not macro expanded.
Recently, the preprocessor has relaxed its treatment of escaped
newlines. Previously, the newline had to immediately follow a
backslash. The current implementation allows whitespace in the form of
spaces, horizontal and vertical tabs, and form feeds between the
backslash. The current implementation allows whitespace in the form
of spaces, horizontal and vertical tabs, and form feeds between the
backslash and the subsequent newline. The preprocessor issues a
warning, but treats it as a valid escaped newline and combines the two
lines to form a single logical line. This works within comments and
@ -2104,6 +2105,9 @@ functions where the arguments are not available to be checked (such as
@code{vprintf}), specify the third parameter as zero. In this case the
compiler only checks the format string for consistency. For
@code{strftime} formats, the third parameter is required to be zero.
Since non-static C++ methods have an implicit @code{this} argument, the
arguments of such methods should be counted from two, not one, when
giving values for @var{string-index} and @var{first-to-check}.
In the example above, the format string (@code{my_format}) is the second
argument of the function @code{my_print}, and the arguments to check
@ -2156,7 +2160,9 @@ string argument is not constant; this would generate a warning when
without the attribute.
The parameter @var{string-index} specifies which argument is the format
string argument (starting from 1).
string argument (starting from one). Since non-static C++ methods have
an implicit @code{this} argument, the arguments of such methods should
be counted from two.
The @code{format-arg} attribute allows you to identify your own
functions which modify format strings, so that GCC can check the
@ -2286,7 +2292,7 @@ and linker.
@cindex @code{malloc} attribute
The @code{malloc} attribute is used to tell the compiler that a function
may be treated as if it were the malloc function. The compiler assumes
that calls to malloc result in a pointers that cannot alias anything.
that calls to malloc result in pointers that cannot alias anything.
This will often improve optimization.
@item alias ("@var{target}")
@ -2338,7 +2344,7 @@ by another module.
Internal visibility is like hidden visibility, but with additional
processor specific semantics. Unless otherwise specified by the psABI,
gcc defines internal visibility to mean that the function is @emph{never}
called from another module. Note that hidden symbols, while then cannot
called from another module. Note that hidden symbols, while they cannot
be referenced directly by other modules, can be referenced indirectly via
function pointers. By indicating that a symbol cannot be called from
outside the module, gcc may for instance omit the load of a PIC register
@ -2347,15 +2353,6 @@ since it is known that the calling function loaded the correct value.
Not all ELF targets support this attribute.
@item tls_model ("@var{tls_model}")
@cindex @code{tls_model} attribute
The @code{tls_model} attribute sets thread-local storage model
(@pxref{Thread-Local}) of a particular @code{__thread} variable,
overriding @code{-ftls-model=} command line switch on a per-variable
basis.
The @var{tls_model} argument should be one of @code{global-dynamic},
@code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
@item regparm (@var{number})
@cindex @code{regparm} attribute
@cindex functions that are passed arguments in registers on the 386
@ -2381,8 +2378,6 @@ On the Intel 386, the @code{stdcall} attribute causes the compiler to
assume that the called function will pop off the stack space used to
pass arguments, unless it takes a variable number of arguments.
The PowerPC compiler for Windows NT currently ignores the @code{stdcall}
attribute.
@item cdecl
@cindex functions that do pop the argument stack on the 386
@ -2392,9 +2387,6 @@ assume that the calling function will pop off the stack space used to
pass arguments. This is
useful to override the effects of the @option{-mrtd} switch.
The PowerPC compiler for Windows NT currently ignores the @code{cdecl}
attribute.
@item longcall/shortcall
@cindex functions called via pointer on the RS/6000 and PowerPC
On the RS/6000 and PowerPC, the @code{longcall} attribute causes the
@ -2404,12 +2396,12 @@ attribute causes the compiler not to do this. These attributes override
both the @option{-mlongcall} switch and the @code{#pragma longcall}
setting.
@xref{RS/6000 and PowerPC Options}, for more information on when long
calls are and are not necessary.
@xref{RS/6000 and PowerPC Options}, for more information on whether long
calls are necessary.
@item long_call/short_call
@cindex indirect calls on ARM
This attribute allows to specify how to call a particular function on
This attribute specifies how a particular function is called on
ARM@. Both attributes override the @option{-mlong-calls} (@pxref{ARM Options})
command line switch and @code{#pragma long_calls} settings. The
@code{long_call} attribute causes the compiler to always call the
@ -2418,31 +2410,6 @@ contents of that register. The @code{short_call} attribute always places
the offset to the function from the call site into the @samp{BL}
instruction directly.
@item dllimport
@cindex functions which are imported from a dll on PowerPC Windows NT
On the PowerPC running Windows NT, the @code{dllimport} attribute causes
the compiler to call the function via a global pointer to the function
pointer that is set up by the Windows NT dll library. The pointer name
is formed by combining @code{__imp_} and the function name.
@item dllexport
@cindex functions which are exported from a dll on PowerPC Windows NT
On the PowerPC running Windows NT, the @code{dllexport} attribute causes
the compiler to provide a global pointer to the function pointer, so
that it can be called with the @code{dllimport} attribute. The pointer
name is formed by combining @code{__imp_} and the function name.
@item exception (@var{except-func} [, @var{except-arg}])
@cindex functions which specify exception handling on PowerPC Windows NT
On the PowerPC running Windows NT, the @code{exception} attribute causes
the compiler to modify the structured exception table entry it emits for
the declared function. The string or identifier @var{except-func} is
placed in the third entry of the structured exception table. It
represents a function, which is called by the exception handling
mechanism if an exception occurs. If it was specified, the string or
identifier @var{except-arg} is placed in the fourth entry of the
structured exception table.
@item function_vector
@cindex calling functions through the function vector on the H8/300 processors
Use this attribute on the H8/300 and H8/300H to indicate that the specified
@ -2464,9 +2431,9 @@ interrupt handler when this attribute is present.
Note, interrupt handlers for the H8/300, H8/300H and SH processors can
be specified via the @code{interrupt_handler} attribute.
Note, on the AVR interrupts will be enabled inside the function.
Note, on the AVR, interrupts will be enabled inside the function.
Note, for the ARM you can specify the kind of interrupt to be handled by
Note, for the ARM, you can specify the kind of interrupt to be handled by
adding an optional parameter to the interrupt attribute like this:
@smallexample
@ -2521,20 +2488,20 @@ slightly under 32kbytes of data.
@item signal
@cindex signal handler functions on the AVR processors
Use this attribute on the AVR to indicate that the specified
function is an signal handler. The compiler will generate function
entry and exit sequences suitable for use in an signal handler when this
attribute is present. Interrupts will be disabled inside function.
function is a signal handler. The compiler will generate function
entry and exit sequences suitable for use in a signal handler when this
attribute is present. Interrupts will be disabled inside the function.
@item naked
@cindex function without a prologue/epilogue code
Use this attribute on the ARM, AVR and IP2K ports to indicate that the
specified function do not need prologue/epilogue sequences generated by
specified function does not need prologue/epilogue sequences generated by
the compiler. It is up to the programmer to provide these sequences.
@item model (@var{model-name})
@cindex function addressability on the M32R/D
Use this attribute on the M32R/D to set the addressability of an object,
and the code generated for a function.
and of the code generated for a function.
The identifier @var{model-name} is one of @code{small}, @code{medium},
or @code{large}, representing each of the code models.
@ -2575,6 +2542,67 @@ use the normal calling convention based on @code{jsr} and @code{rts}.
This attribute can be used to cancel the effect of the @option{-mlong-calls}
option.
@item dllimport
@cindex @code{__declspec(dllimport)}
On Windows targets, the @code{dllimport} attribute causes the compiler
to reference a function or variable via a global pointer to a pointer
that is set up by the Windows dll library. The pointer name is formed by
combining @code{_imp__} and the function or variable name. The attribute
implies @code{extern} storage.
Currently, the attribute is ignored for inlined functions. If the
attribute is applied to a symbol @emph{definition}, an error is reported.
If a symbol previously declared @code{dllimport} is later defined, the
attribute is ignored in subsequent references, and a warning is emitted.
The attribute is also overriden by a subsequent declaration as
@code{dllexport}.
When applied to C++ classes, the attribute marks non-inlined
member functions and static data members as imports. However, the
attribute is ignored for virtual methods to allow creation of vtables
using thunks.
On cygwin, mingw and arm-pe targets, @code{__declspec(dllimport)} is
recognized as a synonym for @code{__attribute__ ((dllimport))} for
compatibility with other Windows compilers.
The use of the @code{dllimport} attribute on functions is not necessary,
but provides a small performance benefit by eliminating a thunk in the
dll. The use of the @code{dllimport} attribute on imported variables was
required on older versions of GNU ld, but can now be avoided by passing
the @option{--enable-auto-import} switch to ld. As with functions, using
the attribute for a variable eliminates a thunk in the dll.
One drawback to using this attribute is that a pointer to a function or
variable marked as dllimport cannot be used as a constant address. The
attribute can be disabled for functions by setting the
@option{-mnop-fun-dllimport} flag.
@item dllexport
@cindex @code{__declspec(dllexport)}
On Windows targets the @code{dllexport} attribute causes the compiler to
provide a global pointer to a pointer in a dll, so that it can be
referenced with the @code{dllimport} attribute. The pointer name is
formed by combining @code{_imp__} and the function or variable name.
Currently, the @code{dllexport}attribute is ignored for inlined
functions, but export can be forced by using the
@option{-fkeep-inline-functions} flag. The attribute is also ignored for
undefined symbols.
When applied to C++ classes. the attribute marks defined non-inlined
member functions and static data members as exports. Static consts
initialized in-class are not marked unless they are also defined
out-of-class.
On cygwin, mingw and arm-pe targets, @code{__declspec(dllexport)} is
recognized as a synonym for @code{__attribute__ ((dllexport))} for
compatibility with other Windows compilers.
Alternative methods for including the symbol in the dll's export table
are to use a .def file with an @code{EXPORTS} section or, with GNU ld,
using the @option{--export-all} linker flag.
@end table
You can specify multiple attributes in a declaration by separating them
@ -2946,7 +2974,7 @@ This is true on many RISC machines. On more traditional machine
designs, @code{__alignof__ (double)} is 4 or even 2.
Some machines never actually require alignment; they allow reference to any
data type even at an odd addresses. For these machines, @code{__alignof__}
data type even at an odd address. For these machines, @code{__alignof__}
reports the @emph{recommended} alignment of a type.
If the operand of @code{__alignof__} is an lvalue rather than a type,
@ -2972,15 +3000,13 @@ It is an error to ask for the alignment of an incomplete type.
The keyword @code{__attribute__} allows you to specify special
attributes of variables or structure fields. This keyword is followed
by an attribute specification inside double parentheses. Ten
attributes are currently defined for variables: @code{aligned},
@code{mode}, @code{nocommon}, @code{packed}, @code{section},
@code{transparent_union}, @code{unused}, @code{deprecated},
@code{vector_size}, and @code{weak}. Some other attributes are defined
for variables on particular target systems. Other attributes are
available for functions (@pxref{Function Attributes}) and for types
(@pxref{Type Attributes}). Other front ends might define more
attributes (@pxref{C++ Extensions,,Extensions to the C++ Language}).
by an attribute specification inside double parentheses. Some
attributes are currently defined generically for variables.
Other attributes are defined for variables on particular target
systems. Other attributes are available for functions
(@pxref{Function Attributes}) and for types (@pxref{Type Attributes}).
Other front ends might define more attributes
(@pxref{C++ Extensions,,Extensions to the C++ Language}).
You may also specify attributes with @samp{__} preceding and following
each keyword. This allows you to use them in header files without
@ -3064,6 +3090,40 @@ does not allow the exception to be caught, only to perform an action.
It is undefined what happens if @var{cleanup_function} does not
return normally.
@item common
@itemx nocommon
@cindex @code{common} attribute
@cindex @code{nocommon} attribute
@opindex fcommon
@opindex fno-common
The @code{common} attribute requests GCC to place a variable in
``common'' storage. The @code{nocommon} attribute requests the
opposite -- to allocate space for it directly.
These attributes override the default chosen by the
@option{-fno-common} and @option{-fcommon} flags respectively.
@item deprecated
@cindex @code{deprecated} attribute
The @code{deprecated} attribute results in a warning if the variable
is used anywhere in the source file. This is useful when identifying
variables that are expected to be removed in a future version of a
program. The warning also includes the location of the declaration
of the deprecated variable, to enable users to easily find further
information about why the variable is deprecated, or what they should
do instead. Note that the warning only occurs for uses:
@smallexample
extern int old_var __attribute__ ((deprecated));
extern int old_var;
int new_fn () @{ return old_var; @}
@end smallexample
results in a warning on line 3 but not line 2.
The @code{deprecated} attribute can also be used for functions and
types (@pxref{Function Attributes}, @pxref{Type Attributes}.)
@item mode (@var{mode})
@cindex @code{mode} attribute
This attribute specifies the data type for the declaration---whichever
@ -3075,18 +3135,6 @@ indicate the mode corresponding to a one-byte integer, @samp{word} or
@samp{__word__} for the mode of a one-word integer, and @samp{pointer}
or @samp{__pointer__} for the mode used to represent pointers.
@item nocommon
@cindex @code{nocommon} attribute
@opindex fno-common
This attribute specifies requests GCC not to place a variable
``common'' but instead to allocate space for it directly. If you
specify the @option{-fno-common} flag, GCC will do this for all
variables.
Specifying the @code{nocommon} attribute for a variable provides an
initialization of zeros. A variable may only be initialized in one
source file.
@item packed
@cindex @code{packed} attribute
The @code{packed} attribute specifies that a variable or structure field
@ -3155,7 +3203,7 @@ section, consider using the facilities of the linker instead.
@item shared
@cindex @code{shared} variable attribute
On Windows NT, in addition to putting variable definitions in a named
On Windows, in addition to putting variable definitions in a named
section, the section can also be shared among all running copies of an
executable or DLL@. For example, this small program defines shared data
by putting it in a named section @code{shared} and marking the section
@ -3178,7 +3226,18 @@ You may only use the @code{shared} attribute along with @code{section}
attribute with a fully initialized global definition because of the way
linkers work. See @code{section} attribute for more information.
The @code{shared} attribute is only available on Windows NT@.
The @code{shared} attribute is only available on Windows@.
@item tls_model ("@var{tls_model}")
@cindex @code{tls_model} attribute
The @code{tls_model} attribute sets thread-local storage model
(@pxref{Thread-Local}) of a particular @code{__thread} variable,
overriding @code{-ftls-model=} command line switch on a per-variable
basis.
The @var{tls_model} argument should be one of @code{global-dynamic},
@code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
Not all targets support this attribute.
@item transparent_union
This attribute, attached to a function parameter which is a union, means
@ -3193,26 +3252,6 @@ This attribute, attached to a variable, means that the variable is meant
to be possibly unused. GCC will not produce a warning for this
variable.
@item deprecated
The @code{deprecated} attribute results in a warning if the variable
is used anywhere in the source file. This is useful when identifying
variables that are expected to be removed in a future version of a
program. The warning also includes the location of the declaration
of the deprecated variable, to enable users to easily find further
information about why the variable is deprecated, or what they should
do instead. Note that the warnings only occurs for uses:
@smallexample
extern int old_var __attribute__ ((deprecated));
extern int old_var;
int new_fn () @{ return old_var; @}
@end smallexample
results in a warning on line 3 but not line 2.
The @code{deprecated} attribute can also be used for functions and
types (@pxref{Function Attributes}, @pxref{Type Attributes}.)
@item vector_size (@var{bytes})
This attribute specifies the vector size for the variable, measured in
bytes. For example, the declaration:
@ -3258,6 +3297,12 @@ Medium and large model objects may live anywhere in the 32-bit address space
(the compiler will generate @code{seth/add3} instructions to load their
addresses).
@item dllimport
The @code{dllimport} attribute is described in @xref{Function Attributes}.
@item dlexport
The @code{dllexport} attribute is described in @xref{Function Attributes}.
@end table
To specify multiple attributes, separate them by commas within the
@ -3378,7 +3423,7 @@ alignment. See your linker documentation for further information.
@item packed
This attribute, attached to an @code{enum}, @code{struct}, or
@code{union} type definition, specified that the minimum required memory
@code{union} type definition, specifies that the minimum required memory
be used to represent the type.
@opindex fshort-enums
@ -3407,7 +3452,7 @@ the referenced type must be respected, just as with normal pointer
conversions.
Second, the argument is passed to the function using the calling
conventions of first member of the transparent union, not the calling
conventions of the first member of the transparent union, not the calling
conventions of the union itself. All members of the union must have the
same machine representation; this is necessary for this argument passing
to work properly.
@ -3619,8 +3664,9 @@ The definition in the header file will cause most calls to the function
to be inlined. If any uses of the function remain, they will refer to
the single copy in the library.
For future compatibility with when GCC implements ISO C99 semantics for
inline functions, it is best to use @code{static inline} only. (The
Since GCC eventually will implement ISO C99 semantics for
inline functions, it is best to use @code{static inline} only
to guarentee compatibility. (The
existing semantics will remain available when @option{-std=gnu89} is
specified, but eventually the default will be @option{-std=gnu99} and
that will implement the C99 semantics, though it does not do so yet.)
@ -3692,7 +3738,7 @@ asm ("fsinx %[angle],%[output]"
@noindent
Note that the symbolic operand names have no relation whatsoever to
other C identifiers. You may use any name you like, even those of
existing C symbols, but must ensure that no two operands within the same
existing C symbols, but you must ensure that no two operands within the same
assembler construct use the same symbolic name.
Output operand expressions must be lvalues; the compiler can check this.
@ -5689,9 +5735,7 @@ vector unsigned int vec_mulo (vector unsigned short,
vector signed int vec_mulo (vector signed short, vector signed short);
vector float vec_nmsub (vector float, vector float, vector float);
@end smallexample
@smallexample
vector float vec_nor (vector float, vector float);
vector signed int vec_nor (vector signed int, vector signed int);
vector unsigned int vec_nor (vector unsigned int, vector unsigned int);
@ -6257,9 +6301,7 @@ vector signed int vec_any_eq (vector signed char, vector unsigned char);
vector signed int vec_any_eq (vector signed char, vector signed char);
vector signed int vec_any_eq (vector unsigned char, vector signed char);
@end smallexample
@smallexample
vector signed int vec_any_eq (vector unsigned char,
vector unsigned char);
vector signed int vec_any_eq (vector signed short,
@ -6712,6 +6754,7 @@ The following are a set of changes to ISO/IEC 14882:1998 (aka C++98)
that document the exact semantics of the language extension.
@itemize @bullet
@item
@b{[intro.execution]}
New text after paragraph 4

View File

@ -1,5 +1,5 @@
@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
@c 1999, 2000, 2001 Free Software Foundation, Inc.
@c 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@ -134,12 +134,12 @@ specified, there are combinations that should not be built. In that
case, set @code{MULTILIB_EXCEPTIONS} to be all of the switch exceptions
in shell case syntax that should not be built.
For example, in the PowerPC embedded ABI support, it is not desirable
to build libraries compiled with the @option{-mcall-aix} option
and either of the @option{-fleading-underscore} or @option{-mlittle} options
at the same time. Therefore @code{MULTILIB_EXCEPTIONS} is set to
For example the ARM processor cannot execute both hardware floating
point instructions and the reduced size THUMB instructions at the same
time, so there is no need to build libraries with both of these
options enabled. Therefore @code{MULTILIB_EXCEPTIONS} is set to:
@smallexample
*mcall-aix/*fleading-underscore* *mlittle/*mcall-aix*
*mthumb/*mhard-float*
@end smallexample
@findex MULTILIB_EXTRA_OPTS
@ -147,7 +147,24 @@ at the same time. Therefore @code{MULTILIB_EXCEPTIONS} is set to
Sometimes it is desirable that when building multiple versions of
@file{libgcc.a} certain options should always be passed on to the
compiler. In that case, set @code{MULTILIB_EXTRA_OPTS} to be the list
of options to be used for all builds.
of options to be used for all builds. If you set this, you should
probably set @code{CRTSTUFF_T_CFLAGS} to a dash followed by it.
@findex SPECS
@item SPECS
Unfortunately, setting @code{MULTILIB_EXTRA_OPTS} is not enough, since
it does not affect the build of target libraries, at least not the
build of the default multilib. One possible work-around is to use
@code{DRIVER_SELF_SPECS} to bring options from the @file{specs} file
as if they had been passed in the compiler driver command line.
However, you don't want to be adding these options after the toolchain
is installed, so you can instead tweak the @file{specs} file that will
be used during the toolchain build, while you still install the
original, built-in @file{specs}. The trick is to set @code{SPECS} to
some other filename (say @file{specs.install}), that will then be
created out of the built-in specs, and introduce a @file{Makefile}
rule to generate the @file{specs} file that's going to be used at
build time out of your @file{specs.install}.
@end table
@node Host Fragment

View File

@ -6,28 +6,27 @@
@chapter Standard Header File Directories
@code{GCC_INCLUDE_DIR} means the same thing for native and cross. It is
where GNU CC stores its private include files, and also where GNU CC
stores the fixed include files. A cross compiled GNU CC runs
where GCC stores its private include files, and also where GCC
stores the fixed include files. A cross compiled GCC runs
@code{fixincludes} on the header files in @file{$(tooldir)/include}.
(If the cross compilation header files need to be fixed, they must be
installed before GNU CC is built. If the cross compilation header files
are already suitable for ISO C and GNU CC, nothing special need be
done).
installed before GCC is built. If the cross compilation header files
are already suitable for GCC, nothing special need be done).
@code{GPLUSPLUS_INCLUDE_DIR} means the same thing for native and cross. It
is where @command{g++} looks first for header files. The C++ library
installs only target independent header files in that directory.
@code{LOCAL_INCLUDE_DIR} is used only by native compilers. GNU CC
@code{LOCAL_INCLUDE_DIR} is used only by native compilers. GCC
doesn't install anything there. It is normally
@file{/usr/local/include}. This is where local additions to a packaged
system should place header files.
@code{CROSS_INCLUDE_DIR} is used only by cross compilers. GNU CC
@code{CROSS_INCLUDE_DIR} is used only by cross compilers. GCC
doesn't install anything there.
@code{TOOL_INCLUDE_DIR} is used for both native and cross compilers. It
is the place for other packages to install header files that GNU CC will
is the place for other packages to install header files that GCC will
use. For a cross-compiler, this is the equivalent of
@file{/usr/include}. When you build a cross-compiler,
@code{fixincludes} processes any header files in this directory.

File diff suppressed because it is too large Load Diff

View File

@ -343,7 +343,7 @@ in the following sections.
-mapp-regs -mbroken-saverestore -mcypress @gol
-mfaster-structs -mflat @gol
-mfpu -mhard-float -mhard-quad-float @gol
-mimpure-text -mlive-g0 -mno-app-regs @gol
-mimpure-text -mlittle-endian -mlive-g0 -mno-app-regs @gol
-mno-faster-structs -mno-flat -mno-fpu @gol
-mno-impure-text -mno-stack-bias -mno-unaligned-doubles @gol
-msoft-float -msoft-quad-float -msparclite -mstack-bias @gol
@ -1575,14 +1575,14 @@ Instantiations of these templates may be mangled incorrectly.
@item -Wctor-dtor-privacy @r{(C++ only)}
@opindex Wctor-dtor-privacy
Warn when a class seems unusable, because all the constructors or
destructors in a class are private and the class has no friends or
Warn when a class seems unusable because all the constructors or
destructors in that class are private, and it has neither friends nor
public static member functions. This warning is enabled by default.
@item -Wnon-virtual-dtor @r{(C++ only)}
@opindex Wnon-virtual-dtor
Warn when a class declares a non-virtual destructor that should probably
be virtual, because it looks like the class will be used polymorphically.
Warn when a class appears to be polymorphic, thereby requiring a virtual
destructor, yet it declares a non-virtual one.
This warning is enabled by @option{-Wall}.
@item -Wreorder @r{(C++ only)}
@ -1600,9 +1600,9 @@ struct A @{
@};
@end smallexample
Here the compiler will warn that the member initializers for @samp{i}
and @samp{j} will be rearranged to match the declaration order of the
members. This warning is enabled by @option{-Wall}.
The compiler will rearrange the member initializers for @samp{i}
and @samp{j} to match the declaration order of the members, emitting
a warning to that effect. This warning is enabled by @option{-Wall}.
@end table
The following @option{-W@dots{}} options are not affected by @option{-Wall}.
@ -1632,8 +1632,8 @@ Item 23: Don't try to return a reference when you must return an object.
@end itemize
and about violations of the following style guidelines from Scott Meyers'
@cite{More Effective C++} book:
Also warn about violations of the following style guidelines from
Scott Meyers' @cite{More Effective C++} book:
@itemize @bullet
@item
@ -1645,8 +1645,8 @@ Item 7: Never overload @code{&&}, @code{||}, or @code{,}.
@end itemize
If you use this option, you should be aware that the standard library
headers do not obey all of these guidelines; you can use @samp{grep -v}
When selecting this option, be aware that the standard library
headers do not obey all of these guidelines; use @samp{grep -v}
to filter out those warnings.
@item -Wno-deprecated @r{(C++ only)}
@ -1656,7 +1656,7 @@ Do not warn about usage of deprecated features. @xref{Deprecated Features}.
@item -Wno-non-template-friend @r{(C++ only)}
@opindex Wno-non-template-friend
Disable warnings when non-templatized friend functions are declared
within a template. With the advent of explicit template specification
within a template. Since the advent of explicit template specification
support in G++, if the name of the friend is an unqualified-id (i.e.,
@samp{friend foo(int)}), the C++ language specification demands that the
friend declare or define an ordinary, nontemplate function. (Section
@ -1664,7 +1664,7 @@ friend declare or define an ordinary, nontemplate function. (Section
could be interpreted as a particular specialization of a templatized
function. Because this non-conforming behavior is no longer the default
behavior for G++, @option{-Wnon-template-friend} allows the compiler to
check existing code for potential trouble spots, and is on by default.
check existing code for potential trouble spots and is on by default.
This new compiler behavior can be turned off with
@option{-Wno-non-template-friend} which keeps the conformant compiler code
but disables the helpful warning.
@ -1674,7 +1674,7 @@ but disables the helpful warning.
Warn if an old-style (C-style) cast to a non-void type is used within
a C++ program. The new-style casts (@samp{static_cast},
@samp{reinterpret_cast}, and @samp{const_cast}) are less vulnerable to
unintended effects, and much easier to grep for.
unintended effects and much easier to search for.
@item -Woverloaded-virtual @r{(C++ only)}
@opindex Woverloaded-virtual
@ -1694,7 +1694,7 @@ struct B: public A @{
@end smallexample
the @code{A} class version of @code{f} is hidden in @code{B}, and code
like this:
like:
@smallexample
B* b;
@ -1711,7 +1711,7 @@ to a plain pointer.
@item -Wsign-promo @r{(C++ only)}
@opindex Wsign-promo
Warn when overload resolution chooses a promotion from unsigned or
enumeral type to a signed type over a conversion to an unsigned type of
enumeral type to a signed type, over a conversion to an unsigned type of
the same size. Previous versions of G++ would try to preserve
unsignedness, but the standard mandates the current behavior.
@ -1746,7 +1746,7 @@ In this example, G++ will synthesize a default @samp{A& operator =
@cindex Objective-C options, command line
@cindex options, Objective-C
This section describes the command-line options that are only meaningful
for Objective-C programs; but you can also use most of the GNU compiler
for Objective-C programs, but you can also use most of the GNU compiler
options regardless of what language your program is in. For example,
you might compile a file @code{some_class.m} like this:
@ -1755,7 +1755,7 @@ gcc -g -fgnu-runtime -O -c some_class.m
@end example
@noindent
In this example, only @option{-fgnu-runtime} is an option meant only for
In this example, @option{-fgnu-runtime} is an option meant only for
Objective-C programs; you can use the other options with any language
supported by GCC@.
@ -1801,8 +1801,8 @@ and no warning is issued for them.
Warn if multiple methods of different types for the same selector are
found during compilation. The check is performed on the list of methods
in the final stage of compilation. Additionally, a check is performed
that for each selector appearing in a @code{@@selector(@dots{})}
expression, a corresponding method with that selector has been found
for each selector appearing in a @code{@@selector(@dots{})}
expression, and a corresponding method for that selector has been found
during compilation. Because these checks scan the method table only at
the end of compilation, these warnings are not produced if the final
stage of compilation is not reached, for example because an error is
@ -1813,13 +1813,13 @@ being used.
@opindex Wundeclared-selector
Warn if a @code{@@selector(@dots{})} expression referring to an
undeclared selector is found. A selector is considered undeclared if no
method with that name has been declared (explicitly, in an
@code{@@interface} or @code{@@protocol} declaration, or implicitly, in
an @code{@@implementation} section) before the
@code{@@selector(@dots{})} expression. This option always performs its
checks as soon as a @code{@@selector(@dots{})} expression is found
(while @code{-Wselector} only performs its checks in the final stage of
compilation), and so additionally enforces the coding style convention
method with that name has been declared before the
@code{@@selector(@dots{})} expression, either explicitly in an
@code{@@interface} or @code{@@protocol} declaration, or implicitly in
an @code{@@implementation} section. This option always performs its
checks as soon as a @code{@@selector(@dots{})} expression is found,
while @code{-Wselector} only performs its checks in the final stage of
compilation. This also enforces the coding style convention
that methods and selectors must be declared before being used.
@c not documented because only avail via -Wp
@ -2386,7 +2386,7 @@ For example, an expression such as @samp{x[i,j]} will cause a warning,
but @samp{x[(void)i,j]} will not.
@item
An unsigned value is compared against zero with @samp{<} or @samp{<=}.
An unsigned value is compared against zero with @samp{<} or @samp{>=}.
@item
A comparison like @samp{x<=y<=z} appears; this is equivalent to
@ -3447,7 +3447,7 @@ optimizations designed to reduce code size.
@option{-Os} disables the following optimization flags:
@gccoptlist{-falign-functions -falign-jumps -falign-loops @gol
-falign-labels -freorder-blocks -fprefetch-loop-arrays}
-falign-labels -freorder-blocks -fprefetch-loop-arrays}
If you use multiple @option{-O} options, with or without level numbers,
the last such option is the one that is effective.
@ -3559,7 +3559,7 @@ specified individually by using @option{--param @var{name}=@var{value}}.
The @option{-finline-limit=@var{n}} option sets some of these parameters
as follows:
@table @gcctabopt
@table @gcctabopt
@item max-inline-insns
is set to @var{n}.
@item max-inline-insns-single
@ -3570,7 +3570,7 @@ as follows:
is set to 130 or @var{n}/4, whichever is smaller.
@item max-inline-insns-rtl
is set to @var{n}.
@end table
@end table
Using @option{-finline-limit=600} thus results in the default settings
for these parameters. See below for a documentation of the individual
@ -4259,7 +4259,6 @@ using the ELF object format and SPARC processors running Solaris 2 have
linkers with such optimizations. AIX may have these optimizations in
the future.
Only use these options when there are significant benefits from doing
so. When you specify these options, the assembler and linker will
create larger object and executable files and will also be slower.
@ -5016,7 +5015,7 @@ for each @samp{%g.s} and another for each @samp{%U.s}. Previously, @samp{%U} wa
simply substituted with a file name chosen for the previous @samp{%u},
without regard to any appended suffix.
@item %j@var{SUFFIX}
@item %j@var{suffix}
Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
writable, and if save-temps is off; otherwise, substitute the name
of a temporary file, just like @samp{%u}. This temporary file is not
@ -5780,6 +5779,22 @@ ABI@. Thus, it's intended only for use on targets where the developer
acknowledges that their resulting code will not be directly in line with
the rules of the ABI@.
@item -mimpure-text
@opindex mimpure-text
@option{-mimpure-text}, used in addition to @option{-shared}, tells
the compiler to not pass @option{-z text} to the linker when linking a
shared object. Using this option, you can link position-dependent
code into a shared object.
@option{-mimpure-text} suppresses the ``relocations remain against
allocatable but non-writable sections'' linker error message.
However, the necessary relocations will trigger copy-on-write, and the
shared object is not actually shared across processes. Instead of
using @option{-mimpure-text}, you should compile all source code with
@option{-fpic} or @option{-fPIC}.
This option is only available on SunOS and Solaris.
@item -mv8
@itemx -msparclite
@opindex mv8
@ -5888,7 +5903,8 @@ on SPARC V9 processors in 64-bit environments.
@table @gcctabopt
@item -mlittle-endian
@opindex mlittle-endian
Generate code for a processor running in little-endian mode.
Generate code for a processor running in little-endian mode. It is only
available for a few configurations and most notably not on Solaris.
@item -m32
@itemx -m64
@ -7222,7 +7238,7 @@ This option sets flags for both the preprocessor and linker.
@cindex Darwin options
These options are defined for all architectures running the Darwin operating
system. These are useful for compatibility with other Mac OS compilers.
system. They are useful for compatibility with other Mac OS compilers.
@table @gcctabopt
@item -all_load
@ -7961,22 +7977,33 @@ the published application binary interface specifications for the 386
and will not be binary compatible with structures in code compiled
without that switch.
@item -m96bit-long-double
@item -m128bit-long-double
@opindex m96bit-long-double
@opindex m128bit-long-double
Control the size of @code{long double} type. i386 application binary interface
specify the size to be 12 bytes, while modern architectures (Pentium and newer)
prefer @code{long double} aligned to 8 or 16 byte boundary. This is
impossible to reach with 12 byte long doubles in the array accesses.
These switches control the size of @code{long double} type. The i386
application binary interface specifies the size to be 96 bits,
so @option{-m96bit-long-double} is the default in 32 bit mode.
@strong{Warning:} if you use the @option{-m128bit-long-double} switch, the
Modern architectures (Pentium and newer) would prefer @code{long double}
to be aligned to an 8 or 16 byte boundary. In arrays or structures
conforming to the ABI, this would not be possible. So specifying a
@option{-m128bit-long-double} will align @code{long double}
to a 16 byte boundary by padding the @code{long double} with an additional
32 bit zero.
In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
Notice that neither of these options enable any extra precision over the x87
standard of 80 bits for a @code{long double}.
@strong{Warning:} if you override the default value for your target ABI, the
structures and arrays containing @code{long double} will change their size as
well as function calling convention for function taking @code{long double}
will be modified.
will be modified. Hence they will not be binary compatible with arrays or
structures in code compiled without that switch.
@item -m96bit-long-double
@opindex m96bit-long-double
Set the size of @code{long double} to 96 bits as required by the i386
application binary interface. This is the default.
@item -msvr3-shlib
@itemx -mno-svr3-shlib
@ -9156,11 +9183,11 @@ option is on by default if you optimize.
@itemx -mprolog-function
@opindex mno-prolog-function
@opindex mprolog-function
Do not use (do use) external functions to save and restore registers at
the prolog and epilog of a function. The external functions are slower,
but use less code space if more than one function saves the same number
of registers. The @option{-mprolog-function} option is on by default if
you optimize.
Do not use (do use) external functions to save and restore registers
at the prologue and epilogue of a function. The external functions
are slower, but use less code space if more than one function saves
the same number of registers. The @option{-mprolog-function} option
is on by default if you optimize.
@item -mspace
@opindex mspace

View File

@ -1,5 +1,5 @@
@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1996, 1998, 1999, 2000, 2001, 2002
@c Free Software Foundation, Inc.
@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1996, 1998, 1999, 2000, 2001,
@c 2002, 2003 Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@ -5514,8 +5514,8 @@ in such processors and suggestions for their representation.
@cindex automaton based pipeline description
This section describes constructions of the automaton based processor
pipeline description. The order of all mentioned below constructions
in the machine description file is not important.
pipeline description. The order of constructions within the machine
description file is not important.
@findex define_automaton
@cindex pipeline hazard recognizer
@ -5523,7 +5523,7 @@ The following optional construction describes names of automata
generated and used for the pipeline hazards recognition. Sometimes
the generated finite state automaton used by the pipeline hazard
recognizer is large. If we use more than one automaton and bind functional
units to the automata, the summary size of the automata usually is
units to the automata, the total size of the automata is usually
less than the size of the single automaton. If there is no one such
construction, only one finite state automaton is generated.
@ -5533,12 +5533,12 @@ construction, only one finite state automaton is generated.
@var{automata-names} is a string giving names of the automata. The
names are separated by commas. All the automata should have unique names.
The automaton name is used in construction @code{define_cpu_unit} and
The automaton name is used in the constructions @code{define_cpu_unit} and
@code{define_query_cpu_unit}.
@findex define_cpu_unit
@cindex processor functional units
Each processor functional unit used in description of instruction
Each processor functional unit used in the description of instruction
reservations should be described by the following construction.
@smallexample
@ -5599,7 +5599,7 @@ is negative, the cost is considered to be zero). You can always
change the default costs for any description by using the target hook
@code{TARGET_SCHED_ADJUST_COST} (@pxref{Scheduling}).
@var{insn-names} is a string giving the internal name of the insn. The
@var{insn-name} is a string giving the internal name of the insn. The
internal names are used in constructions @code{define_bypass} and in
the automaton description file generated for debugging. The internal
name has nothing in common with the names in @code{define_insn}. It is a
@ -5685,7 +5685,7 @@ the common part by the following construction
@var{reservation-name} is a string giving name of @var{regexp}.
Functional unit names and reservation names are in the same name
space. So the reservation names should be different from the
functional unit names and can not be reserved name @samp{nothing}.
functional unit names and can not be the reserved name @samp{nothing}.
@findex define_bypass
@cindex instruction latency time
@ -5772,8 +5772,8 @@ code. Currently there are the following options:
@itemize @bullet
@item
@dfn{no-minimization} makes no minimization of the automaton. This is
only worth to do when we are going to query CPU functional unit
reservations in an automaton state.
only worth to do when we are debugging the description and need to
look more accurately at reservations of states.
@item
@dfn{time} means printing additional time statistics about

View File

@ -1,5 +1,5 @@
@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
@c 1999, 2000, 2001 Free Software Foundation, Inc.
@c 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@ -8,10 +8,11 @@
@cindex portability
@cindex GCC and portability
The main goal of GCC was to make a good, fast compiler for machines in
the class that the GNU system aims to run on: 32-bit machines that address
8-bit bytes and have several general registers. Elegance, theoretical
power and simplicity are only secondary.
GCC itself aims to be portable to any machine where @code{int} is at least
a 32-bit type. It aims to target machines with a flat (non-segmented) byte
addressed data address space (the code address space can be separate).
Target ABIs may have 8, 16, 32 or 64-bit @code{int} type. @code{char}
can be wider than 8 bits.
GCC gets most of the information about the target machine from a machine
description which gives an algebraic formula for each of the machine's

View File

@ -608,9 +608,22 @@ Stored in the @code{integrated} field and printed as @samp{/i}.
@cindex @code{concat} and @samp{/u}
@cindex @code{unchanging}, in @code{reg} and @code{mem}
@item RTX_UNCHANGING_P (@var{x})
Nonzero in a @code{reg}, @code{mem}, or @code{concat} if the memory
is set at most once,
anywhere. This does not mean that it is function invariant.
Nonzero in a @code{reg}, @code{mem}, or @code{concat} if the register or
memory is set at most once, anywhere. This does not mean that it is
function invariant.
GCC uses this flag to determine whether two references conflict. As
implemented by @code{true_dependence} in @file{alias.c} for memory
references, unchanging memory can't conflict with non-unchanging memory;
a non-unchanging read can conflict with a non-unchanging write; an
unchanging read can conflict with an unchanging write (since there may
be a single store to this address to initialize it); and an unchanging
store can conflict with a non-unchanging read. This means we must make
conservative assumptions when choosing the value of this flag for a
memory reference to an object containing both unchanging and
non-unchanging fields: we must set the flag when writing to the object
and clear it when reading from the object.
Stored in the @code{unchanging} field and printed as @samp{/u}.
@findex SCHED_GROUP_P
@ -687,13 +700,6 @@ Promoted variables are always either sign- or zero-extended to the wider
mode on every assignment. Stored in the @code{in_struct} field and
printed as @samp{/s}.
@findex SYMBOL_REF_FLAG
@cindex @code{symbol_ref} and @samp{/v}
@cindex @code{volatil}, in @code{symbol_ref}
@item SYMBOL_REF_FLAG (@var{x})
In a @code{symbol_ref}, this is used as a flag for machine-specific purposes.
Stored in the @code{volatil} field and printed as @samp{/v}.
@findex SYMBOL_REF_USED
@cindex @code{used}, in @code{symbol_ref}
@item SYMBOL_REF_USED (@var{x})
@ -707,6 +713,17 @@ once. Stored in the @code{used} field.
@item SYMBOL_REF_WEAK (@var{x})
In a @code{symbol_ref}, indicates that @var{x} has been declared weak.
Stored in the @code{integrated} field and printed as @samp{/i}.
@findex SYMBOL_REF_FLAG
@cindex @code{symbol_ref} and @samp{/v}
@cindex @code{volatil}, in @code{symbol_ref}
@item SYMBOL_REF_FLAG (@var{x})
In a @code{symbol_ref}, this is used as a flag for machine-specific purposes.
Stored in the @code{volatil} field and printed as @samp{/v}.
Most uses of @code{SYMBOL_REF_FLAG} are historic and may be subsumed
by @code{SYMBOL_REF_FLAGS}. Certainly use of @code{SYMBOL_REF_FLAGS}
is mandatory if the target requires more than one bit of storage.
@end table
These are the fields to which the above macros refer:
@ -2195,9 +2212,9 @@ the operands of these.
@item (set @var{lval} @var{x})
Represents the action of storing the value of @var{x} into the place
represented by @var{lval}. @var{lval} must be an expression
representing a place that can be stored in: @code{reg} (or @code{subreg}
or @code{strict_low_part}), @code{mem}, @code{pc}, @code{parallel}, or
@code{cc0}.
representing a place that can be stored in: @code{reg} (or @code{subreg},
@code{strict_low_part} or @code{zero_extract}), @code{mem}, @code{pc},
@code{parallel}, or @code{cc0}.
If @var{lval} is a @code{reg}, @code{subreg} or @code{mem}, it has a
machine mode; then @var{x} must be valid for that mode.
@ -2210,10 +2227,10 @@ rest of the register receives an undefined value. Likewise, if
the mode of the register, the rest of the register can be changed in
an undefined way.
If @var{lval} is a @code{strict_low_part} of a @code{subreg}, then the
part of the register specified by the machine mode of the
@code{subreg} is given the value @var{x} and the rest of the register
is not changed.
If @var{lval} is a @code{strict_low_part} or @code{zero_extract}
of a @code{subreg}, then the part of the register specified by the
machine mode of the @code{subreg} is given the value @var{x} and
the rest of the register is not changed.
If @var{lval} is @code{(cc0)}, it has no machine mode, and @var{x} may
be either a @code{compare} expression or a value that may have any mode.

View File

@ -1,4 +1,4 @@
@c Copyright (C) 2002 Free Software Foundation, Inc.
@c Copyright (C) 2002, 2003 Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@ -466,10 +466,9 @@ following are also necessary:
@itemize @bullet
@item
At least one GNATS category for bugs in that front end and runtime
At least one Bugzilla component for bugs in that front end and runtime
libraries. This category needs to be mentioned in
@file{gcc/gccbug.in}, and in @file{gnats.html} on the GCC web site, as
well as being added to the GNATS database.
@file{gcc/gccbug.in}, as well as being added to the Bugzilla database.
@item
Normally, one or more maintainers of that front end listed in
@file{MAINTAINERS}.
@ -931,9 +930,9 @@ 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.
Runtime tests are executed via @samp{make check} in the
@file{@var{target}/libjava/testsuite} directory 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}

View File

@ -993,7 +993,7 @@ inside @samp{func} in the example).
g++ implements the ``intuitive'' algorithm for copy-assignment: assign all
direct bases, then assign all members. In that algorithm, the virtual
base subobject can be encountered many times. In the example, copying
base subobject can be encountered more than once. In the example, copying
proceeds in the following order: @samp{val}, @samp{name} (via
@code{strdup}), @samp{bval}, and @samp{name} again.

View File

@ -10383,14 +10383,15 @@ gen_enumeration_type_die (type, context_die)
add_name_attribute (enum_die,
IDENTIFIER_POINTER (TREE_PURPOSE (link)));
if (host_integerp (TREE_VALUE (link), 0))
if (host_integerp (TREE_VALUE (link),
TREE_UNSIGNED (TREE_TYPE (TREE_VALUE (link)))))
{
if (tree_int_cst_sgn (TREE_VALUE (link)) < 0)
add_AT_int (enum_die, DW_AT_const_value,
tree_low_cst (TREE_VALUE (link), 0));
else
add_AT_unsigned (enum_die, DW_AT_const_value,
tree_low_cst (TREE_VALUE (link), 0));
tree_low_cst (TREE_VALUE (link), 1));
}
}
}

View File

@ -153,7 +153,7 @@ static rtx clear_storage_via_libcall PARAMS ((rtx, rtx));
static tree clear_storage_libcall_fn PARAMS ((int));
static rtx compress_float_constant PARAMS ((rtx, rtx));
static rtx get_subtarget PARAMS ((rtx));
static int is_zeros_p PARAMS ((tree));
static int is_zeros_p PARAMS ((tree));
static int mostly_zeros_p PARAMS ((tree));
static void store_constructor_field PARAMS ((rtx, unsigned HOST_WIDE_INT,
HOST_WIDE_INT, enum machine_mode,
@ -177,6 +177,7 @@ static rtx do_store_flag PARAMS ((tree, rtx, enum machine_mode, int));
static void emit_single_push_insn PARAMS ((enum machine_mode, rtx, tree));
#endif
static void do_tablejump PARAMS ((rtx, enum machine_mode, rtx, rtx, rtx));
static rtx const_vector_from_tree PARAMS ((tree));
/* Record for each mode whether we can move a register directly to or
from an object of that mode in memory. If we can't, we won't try
@ -2659,6 +2660,9 @@ can_store_by_pieces (len, constfun, constfundata, align)
int reverse;
rtx cst;
if (len == 0)
return 1;
if (! MOVE_BY_PIECES_P (len, align))
return 0;
@ -2734,6 +2738,9 @@ store_by_pieces (to, len, constfun, constfundata, align)
{
struct store_by_pieces data;
if (len == 0)
return;
if (! MOVE_BY_PIECES_P (len, align))
abort ();
to = protect_from_queue (to, 1);
@ -2756,6 +2763,9 @@ clear_by_pieces (to, len, align)
{
struct store_by_pieces data;
if (len == 0)
return;
data.constfun = clear_by_pieces_1;
data.constfundata = NULL;
data.len = len;
@ -2926,7 +2936,9 @@ clear_storage (object, size)
object = protect_from_queue (object, 1);
size = protect_from_queue (size, 0);
if (GET_CODE (size) == CONST_INT
if (GET_CODE (size) == CONST_INT && INTVAL (size) == 0)
;
else if (GET_CODE (size) == CONST_INT
&& CLEAR_BY_PIECES_P (INTVAL (size), align))
clear_by_pieces (object, INTVAL (size), align);
else if (clear_storage_via_clrstr (object, size, align))
@ -4802,11 +4814,13 @@ store_constructor (exp, target, cleared, size)
{
tree elt;
/* If size is zero or the target is already cleared, do nothing. */
if (size == 0 || cleared)
cleared = 1;
/* We either clear the aggregate or indicate the value is dead. */
if ((TREE_CODE (type) == UNION_TYPE
|| TREE_CODE (type) == QUAL_UNION_TYPE)
&& ! cleared
&& ! CONSTRUCTOR_ELTS (exp))
else if ((TREE_CODE (type) == UNION_TYPE
|| TREE_CODE (type) == QUAL_UNION_TYPE)
&& ! CONSTRUCTOR_ELTS (exp))
/* If the constructor is empty, clear the union. */
{
clear_storage (target, expr_size (exp));
@ -4817,7 +4831,7 @@ store_constructor (exp, target, cleared, size)
set the initial value as zero so we can fold the value into
a constant. But if more than one register is involved,
this probably loses. */
else if (! cleared && GET_CODE (target) == REG && TREE_STATIC (exp)
else if (GET_CODE (target) == REG && TREE_STATIC (exp)
&& GET_MODE_SIZE (GET_MODE (target)) <= UNITS_PER_WORD)
{
emit_move_insn (target, CONST0_RTX (GET_MODE (target)));
@ -4829,10 +4843,8 @@ store_constructor (exp, target, cleared, size)
clear the whole structure first. Don't do this if TARGET is a
register whose mode size isn't equal to SIZE since clear_storage
can't handle this case. */
else if (! cleared && size > 0
&& ((list_length (CONSTRUCTOR_ELTS (exp))
!= fields_length (type))
|| mostly_zeros_p (exp))
else if (((list_length (CONSTRUCTOR_ELTS (exp)) != fields_length (type))
|| mostly_zeros_p (exp))
&& (GET_CODE (target) != REG
|| ((HOST_WIDE_INT) GET_MODE_SIZE (GET_MODE (target))
== size)))
@ -6782,6 +6794,9 @@ expand_expr (exp, target, tmode, modifier)
return temp;
case VECTOR_CST:
return const_vector_from_tree (exp);
case CONST_DECL:
return expand_expr (DECL_INITIAL (exp), target, VOIDmode, modifier);
@ -11232,4 +11247,41 @@ vector_mode_valid_p (mode)
return mov_optab->handlers[innermode].insn_code != CODE_FOR_nothing;
}
/* Return a CONST_VECTOR rtx for a VECTOR_CST tree. */
static rtx
const_vector_from_tree (exp)
tree exp;
{
rtvec v;
int units, i;
tree link, elt;
enum machine_mode inner, mode;
mode = TYPE_MODE (TREE_TYPE (exp));
if (is_zeros_p (exp))
return CONST0_RTX (mode);
units = GET_MODE_NUNITS (mode);
inner = GET_MODE_INNER (mode);
v = rtvec_alloc (units);
link = TREE_VECTOR_CST_ELTS (exp);
for (i = 0; link; link = TREE_CHAIN (link), ++i)
{
elt = TREE_VALUE (link);
if (TREE_CODE (elt) == REAL_CST)
RTVEC_ELT (v, i) = CONST_DOUBLE_FROM_REAL_VALUE (TREE_REAL_CST (elt),
inner);
else
RTVEC_ELT (v, i) = immed_double_const (TREE_INT_CST_LOW (elt),
TREE_INT_CST_HIGH (elt),
inner);
}
return gen_rtx_raw_CONST_VECTOR (mode, v);
}
#include "gt-expr.h"

View File

@ -1,3 +1,11 @@
2003-08-04 Release Manager
* GCC 3.3.1 Released.
2003-08-04 Release Manager
* GCC 3.3.1 Released.
2003-07-09 Toon Moene <toon@moene.indiv.nluug.nl>
PR Fortran/11301

View File

@ -1757,8 +1757,10 @@ propagate_one_insn (pbi, insn)
if (GET_CODE (insn) == CALL_INSN)
{
int i;
regset live_at_end;
bool sibcall_p;
rtx note, cond;
int i;
cond = NULL_RTX;
if (GET_CODE (PATTERN (insn)) == COND_EXEC)
@ -1783,9 +1785,19 @@ propagate_one_insn (pbi, insn)
mark_set_1 (pbi, CLOBBER, XEXP (XEXP (note, 0), 0),
cond, insn, pbi->flags);
/* Calls change all call-used and global registers. */
/* Calls change all call-used and global registers; sibcalls do not
clobber anything that must be preserved at end-of-function,
except for return values. */
sibcall_p = SIBLING_CALL_P (insn);
live_at_end = EXIT_BLOCK_PTR->global_live_at_start;
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i))
if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i)
&& ! (sibcall_p
&& REGNO_REG_SET_P (live_at_end, i)
&& ! refers_to_regno_p (i, i+1,
current_function_return_rtx,
(rtx *) 0)))
{
/* We do not want REG_UNUSED notes for these registers. */
mark_set_1 (pbi, CLOBBER, regno_reg_rtx[i], cond, insn,

View File

@ -3954,9 +3954,12 @@ try_replace_reg (from, to, insn)
&& validate_change (insn, &SET_SRC (set), src, 0))
success = 1;
/* If we've failed to do replacement, have a single SET, and don't already
have a note, add a REG_EQUAL note to not lose information. */
if (!success && note == 0 && set != 0)
/* If we've failed to do replacement, have a single SET, don't already
have a note, and have no special SET, add a REG_EQUAL note to not
lose information. */
if (!success && note == 0 && set != 0
&& GET_CODE (XEXP (set, 0)) != ZERO_EXTRACT
&& GET_CODE (XEXP (set, 0)) != SIGN_EXTRACT)
note = set_unique_reg_note (insn, REG_EQUAL, copy_rtx (src));
}

View File

@ -380,6 +380,8 @@ copy_decl_for_inlining (decl, from_fn, to_fn)
else
{
copy = copy_node (decl);
/* The COPY is not abstract; it will be generated in TO_FN. */
DECL_ABSTRACT (copy) = 0;
(*lang_hooks.dup_lang_specific_decl) (copy);
/* TREE_ADDRESSABLE isn't used to indicate that a label's

View File

@ -184,3 +184,9 @@ GCC_3.3 {
_Unwind_Resume_or_Rethrow
_Unwind_SjLj_Resume_or_Rethrow
}
%inherit GCC_3.3.1 GCC_3.3
GCC_3.3.1 {
__gcc_personality_sj0
__gcc_personality_v0
}

View File

@ -7865,11 +7865,12 @@ loop_iv_add_mult_emit_before (loop, b, m, a, reg, before_bb, before_insn)
update_reg_last_use (b, before_insn);
update_reg_last_use (m, before_insn);
loop_insn_emit_before (loop, before_bb, before_insn, seq);
/* It is possible that the expansion created lots of new registers.
Iterate over the sequence we just created and record them all. */
Iterate over the sequence we just created and record them all. We
must do this before inserting the sequence. */
loop_regs_update (loop, seq);
loop_insn_emit_before (loop, before_bb, before_insn, seq);
}
@ -7894,11 +7895,12 @@ loop_iv_add_mult_sink (loop, b, m, a, reg)
update_reg_last_use (b, loop->sink);
update_reg_last_use (m, loop->sink);
loop_insn_sink (loop, seq);
/* It is possible that the expansion created lots of new registers.
Iterate over the sequence we just created and record them all. */
Iterate over the sequence we just created and record them all. We
must do this before inserting the sequence. */
loop_regs_update (loop, seq);
loop_insn_sink (loop, seq);
}
@ -7917,11 +7919,12 @@ loop_iv_add_mult_hoist (loop, b, m, a, reg)
/* Use copy_rtx to prevent unexpected sharing of these rtx. */
seq = gen_add_mult (copy_rtx (b), copy_rtx (m), copy_rtx (a), reg);
loop_insn_hoist (loop, seq);
/* It is possible that the expansion created lots of new registers.
Iterate over the sequence we just created and record them all. */
Iterate over the sequence we just created and record them all. We
must do this before inserting the sequence. */
loop_regs_update (loop, seq);
loop_insn_hoist (loop, seq);
}

View File

@ -3532,7 +3532,12 @@ prepare_operand (icode, x, opnum, mode, wider_mode, unsignedp)
if (! (*insn_data[icode].operand[opnum].predicate)
(x, insn_data[icode].operand[opnum].mode))
x = copy_to_mode_reg (insn_data[icode].operand[opnum].mode, x);
{
if (no_new_pseudos)
return NULL_RTX;
x = copy_to_mode_reg (insn_data[icode].operand[opnum].mode, x);
}
return x;
}
@ -5483,7 +5488,12 @@ gen_cond_trap (code, op1, op2, tcode)
start_sequence ();
op1 = prepare_operand (icode, op1, 0, mode, mode, 0);
op2 = prepare_operand (icode, op2, 0, mode, mode, 0);
op2 = prepare_operand (icode, op2, 1, mode, mode, 0);
if (!op1 || !op2)
{
end_sequence ();
return 0;
}
emit_insn (GEN_FCN (icode) (op1, op2));
PUT_CODE (trap_rtx, code);

View File

@ -977,12 +977,17 @@ sched_analyze_insn (deps, x, insn, loop_notes)
else
{
rtx pending, pending_mem;
regset_head tmp;
INIT_REG_SET (&tmp);
regset_head tmp_uses, tmp_sets;
INIT_REG_SET (&tmp_uses);
INIT_REG_SET (&tmp_sets);
(*current_sched_info->compute_jump_reg_dependencies) (insn, &tmp);
IOR_REG_SET (reg_pending_uses, &tmp);
CLEAR_REG_SET (&tmp);
(*current_sched_info->compute_jump_reg_dependencies)
(insn, &deps->reg_conditional_sets, &tmp_uses, &tmp_sets);
IOR_REG_SET (reg_pending_uses, &tmp_uses);
IOR_REG_SET (reg_pending_sets, &tmp_sets);
CLEAR_REG_SET (&tmp_uses);
CLEAR_REG_SET (&tmp_sets);
/* All memory writes and volatile reads must happen before the
jump. Non-volatile reads must happen before the jump iff
@ -1079,6 +1084,7 @@ sched_analyze_insn (deps, x, insn, loop_notes)
}
flush_pending_lists (deps, insn, true, true);
CLEAR_REG_SET (&deps->reg_conditional_sets);
reg_pending_barrier = false;
}
else
@ -1110,6 +1116,7 @@ sched_analyze_insn (deps, x, insn, loop_notes)
add_dependence_list (insn, reg_last->clobbers, REG_DEP_OUTPUT);
add_dependence_list (insn, reg_last->uses, REG_DEP_ANTI);
reg_last->sets = alloc_INSN_LIST (insn, reg_last->sets);
SET_REGNO_REG_SET (&deps->reg_conditional_sets, i);
});
}
else
@ -1158,6 +1165,7 @@ sched_analyze_insn (deps, x, insn, loop_notes)
reg_last->sets = alloc_INSN_LIST (insn, reg_last->sets);
reg_last->uses_length = 0;
reg_last->clobbers_length = 0;
CLEAR_REGNO_REG_SET (&deps->reg_conditional_sets, i);
});
}
@ -1484,6 +1492,7 @@ init_deps (deps)
deps->reg_last = (struct deps_reg *)
xcalloc (max_reg, sizeof (struct deps_reg));
INIT_REG_SET (&deps->reg_last_in_use);
INIT_REG_SET (&deps->reg_conditional_sets);
deps->pending_read_insns = 0;
deps->pending_read_mems = 0;
@ -1526,6 +1535,7 @@ free_deps (deps)
free_INSN_LIST_list (&reg_last->clobbers);
});
CLEAR_REG_SET (&deps->reg_last_in_use);
CLEAR_REG_SET (&deps->reg_conditional_sets);
free (deps->reg_last);
}

View File

@ -52,7 +52,8 @@ static int schedule_more_p PARAMS ((void));
static const char *ebb_print_insn PARAMS ((rtx, int));
static int rank PARAMS ((rtx, rtx));
static int contributes_to_priority PARAMS ((rtx, rtx));
static void compute_jump_reg_dependencies PARAMS ((rtx, regset));
static void compute_jump_reg_dependencies PARAMS ((rtx, regset, regset,
regset));
static void schedule_ebb PARAMS ((rtx, rtx));
/* Return nonzero if there are more insns that should be scheduled. */
@ -160,22 +161,30 @@ contributes_to_priority (next, insn)
return 1;
}
/* INSN is a JUMP_INSN. Store the set of registers that must be considered
to be set by this jump in SET. */
/* INSN is a JUMP_INSN, COND_SET is the set of registers that are
conditionally set before INSN. Store the set of registers that
must be considered as used by this jump in USED and that of
registers that must be considered as set in SET. */
static void
compute_jump_reg_dependencies (insn, set)
compute_jump_reg_dependencies (insn, cond_set, used, set)
rtx insn;
regset set;
regset cond_set, used, set;
{
basic_block b = BLOCK_FOR_INSN (insn);
edge e;
for (e = b->succ; e; e = e->succ_next)
if ((e->flags & EDGE_FALLTHRU) == 0)
{
bitmap_operation (set, set, e->dest->global_live_at_start,
BITMAP_IOR);
}
if (e->flags & EDGE_FALLTHRU)
/* The jump may be a by-product of a branch that has been merged
in the main codepath after being conditionalized. Therefore
it may guard the fallthrough block from using a value that has
conditionally overwritten that of the main codepath. So we
consider that it restores the value of the main codepath. */
bitmap_operation (set, e->dest->global_live_at_start, cond_set,
BITMAP_AND);
else
bitmap_operation (used, used, e->dest->global_live_at_start,
BITMAP_IOR);
}
/* Used in schedule_insns to initialize current_sched_info for scheduling

View File

@ -112,6 +112,9 @@ struct deps
/* Element N is set for each register that has any nonzero element
in reg_last[N].{uses,sets,clobbers}. */
regset_head reg_last_in_use;
/* Element N is set for each register that is conditionally set. */
regset_head reg_conditional_sets;
};
/* This structure holds some state of the current scheduling pass, and
@ -146,9 +149,9 @@ struct sched_info
calculations. */
int (*contributes_to_priority) PARAMS ((rtx, rtx));
/* Called when computing dependencies for a JUMP_INSN. This function
should store the set of registers that must be considered as set by
the jump in the regset. */
void (*compute_jump_reg_dependencies) PARAMS ((rtx, regset));
should store the set of registers that must be considered as used
and the set of registers that must be considered as set by the jump. */
void (*compute_jump_reg_dependencies) PARAMS ((rtx, regset, regset, regset));
/* The boundaries of the set of insns to be scheduled. */
rtx prev_head, next_tail;

View File

@ -1967,7 +1967,8 @@ static int schedule_more_p PARAMS ((void));
static const char *rgn_print_insn PARAMS ((rtx, int));
static int rgn_rank PARAMS ((rtx, rtx));
static int contributes_to_priority PARAMS ((rtx, rtx));
static void compute_jump_reg_dependencies PARAMS ((rtx, regset));
static void compute_jump_reg_dependencies PARAMS ((rtx, regset, regset,
regset));
/* Return nonzero if there are more insns that should be scheduled. */
@ -2254,12 +2255,16 @@ contributes_to_priority (next, insn)
return BLOCK_NUM (next) == BLOCK_NUM (insn);
}
/* INSN is a JUMP_INSN. Store the set of registers that must be considered
to be set by this jump in SET. */
/* INSN is a JUMP_INSN, COND_SET is the set of registers that are
conditionally set before INSN. Store the set of registers that
must be considered as used by this jump in USED and that of
registers that must be considered as set in SET. */
static void
compute_jump_reg_dependencies (insn, set)
compute_jump_reg_dependencies (insn, cond_set, used, set)
rtx insn ATTRIBUTE_UNUSED;
regset cond_set ATTRIBUTE_UNUSED;
regset used ATTRIBUTE_UNUSED;
regset set ATTRIBUTE_UNUSED;
{
/* Nothing to do here, since we postprocess jumps in

View File

@ -2847,8 +2847,8 @@ rest_of_compilation (decl)
open_dump_file (DFI_addressof, decl);
purge_addressof (insns);
if (optimize)
purge_all_dead_edges (0);
if (optimize && purge_all_dead_edges (0))
delete_unreachable_blocks ();
reg_scan (insns, max_reg_num (), 1);
close_dump_file (DFI_addressof, print_rtl, insns);

View File

@ -1003,7 +1003,8 @@ inlinable_function_p (fn, id)
/* In case we don't disregard the inlining limits and we basically
can inline this function, investigate further. */
if (! (*lang_hooks.tree_inlining.disregard_inline_limits) (fn)
&& inlinable)
&& inlinable
&& currfn_insns > MIN_INLINE_INSNS)
{
int sum_insns = (id ? id->inlined_stmts : 0) * INSNS_PER_STMT
+ currfn_insns;
@ -1016,8 +1017,7 @@ inlinable_function_p (fn, id)
with slope -1/MAX_INLINE_SLOPE to exceedingly decrease the
allowable size. We always allow a size of MIN_INLINE_INSNS
though. */
else if ((sum_insns > MAX_INLINE_INSNS)
&& (currfn_insns > MIN_INLINE_INSNS))
else if (sum_insns > MAX_INLINE_INSNS)
{
int max_curr = MAX_INLINE_INSNS_SINGLE
- (sum_insns - MAX_INLINE_INSNS) / MAX_INLINE_SLOPE;

View File

@ -3676,7 +3676,7 @@ loop_iterations (loop)
if (find_common_reg_term (temp, reg2))
initial_value = temp;
else
else if (loop_invariant_p (loop, reg2))
{
/* Find what reg2 is equivalent to. Hopefully it will
either be reg1 or reg1 plus a constant. Let's ignore

View File

@ -77,7 +77,6 @@ parse_lsda_header (struct _Unwind_Context *context, const unsigned char *p,
#else
#define PERSONALITY_FUNCTION __gcc_personality_v0
#endif
#define PERSONALITY_FUNCTION __gcc_personality_v0
_Unwind_Reason_Code
PERSONALITY_FUNCTION (int, _Unwind_Action, _Unwind_Exception_Class,

View File

@ -4050,6 +4050,23 @@ output_constant (exp, size, align)
thissize = MIN (TREE_STRING_LENGTH (exp), size);
assemble_string (TREE_STRING_POINTER (exp), thissize);
}
else if (TREE_CODE (exp) == VECTOR_CST)
{
int elt_size;
tree link;
unsigned int nalign;
enum machine_mode inner;
inner = GET_MODE_INNER (TYPE_MODE (TREE_TYPE (exp)));
nalign = MIN (align, GET_MODE_ALIGNMENT (inner));
elt_size = GET_MODE_UNIT_SIZE (TYPE_MODE (TREE_TYPE (exp)));
link = TREE_VECTOR_CST_ELTS (exp);
output_constant (TREE_VALUE (link), elt_size, align);
while ((link = TREE_CHAIN (link)) != NULL)
output_constant (TREE_VALUE (link), elt_size, nalign);
}
else
abort ();
break;

View File

@ -6,7 +6,7 @@
please modify this string to indicate that, e.g. by putting your
organization's name in parentheses at the end of the string. */
const char version_string[] = "3.3.1 20030711 (prerelease)";
const char version_string[] = "3.3.1";
/* This is the location of the online document giving instructions for
reporting bugs. If you distribute a modified version of GCC,