gcc/gcc
Zack Weinberg 6de6668085 langhooks.c: Don't include gt-langhooks.h.
* langhooks.c: Don't include gt-langhooks.h.
	(var_labelno): Delete.
	(lhd_set_decl_assembler_name): Do not append a distinguishing
	number to file-scope internal-linkage declarations for the first
	input file, even if they have DECL_CONTEXT set.  Use DECL_UID of
	the declaration itself (if at block scope), or its containing
	TRANSLATION_UNIT_DECL (if at file scope) for the distinguishing
	number.

	* opts.c (cur_in_fname): New global.
	* opts.h: Declare it.
	* tree.c: Include opts.h.
	(make_node_stat): If creating a TRANSLATION_UNIT_DECL, give it
	DECL_UID equal to cur_in_fname.
	(copy_node_stat): Do not change DECL_UID when copying a
	TRANSLATION_UNIT_DECL.
	(build_common_tree_nodes): Adjust next_decl_uid to reserve the
	range 0 .. num_in_fnames-1 for TRANSLATION_UNIT_DECLs.

	* c-decl.c (c_static_assembler_name): Delete.
	* c-tree.h (c_static_assembler_name): Delete prototype.
	* c-lang.c, objc/objc-lang.c: Don't override
	LANG_HOOKS_SET_DECL_ASSEMBLER_NAME.

	* Makefile.in (tree.o): Update dependencies.
	(GTFILES): Remove langhooks.c.

cp:
	* decl.c (cxx_init_decl_processing): Call
	build_common_tree_nodes before creating the global NAMESPACE_DECL.

From-SVN: r84123
2004-07-05 17:28:37 +00:00
..
ada Make-lang.in (doc/gnat_ugn_unw.texi): Eliminate explicit dependency on xgnatugn, instead build it via a submake. 2004-07-04 20:04:31 +00:00
config re PR target/16357 (ICE copying 7 bytes between extern char[]s) 2004-07-05 06:37:10 +00:00
cp langhooks.c: Don't include gt-langhooks.h. 2004-07-05 17:28:37 +00:00
doc sourcebuild.texi (Config Fragments): Use @comma{} in cross-reference to section title. 2004-07-05 15:47:22 +01:00
fixinc
fortran re PR libfortran/15280 (Fortran9x commandline not accessable) 2004-07-04 17:00:12 +00:00
ginclude
java c-tree.h (TYPE_ACTUAL_ARG_TYPES): Use TYPE_LANG_SLOT_1. 2004-07-05 09:35:44 +00:00
objc langhooks.c: Don't include gt-langhooks.h. 2004-07-05 17:28:37 +00:00
po
testsuite re PR c++/2518 (user-declared operator new hides standard one) 2004-07-05 15:56:10 +00:00
treelang rtl.def (ADDRESSOF): Remove. 2004-07-04 01:07:15 -07:00
.cvsignore
ABOUT-GCC-NLS
aclocal.m4
alias.c rtl.def (ADDRESSOF): Remove. 2004-07-04 01:07:15 -07:00
alias.h
alloc-pool.c
alloc-pool.h
attribs.c
basic-block.h Conditionally compile support for --enable-mapped_location. 2004-06-30 11:05:07 -07:00
bb-reorder.c
bitmap.c
bitmap.h
bt-load.c
builtin-attrs.def
builtin-types.def
builtins.c alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 12:52:53 +00:00
builtins.def builtins.c (fold_builtin_classify): New. 2004-07-01 08:02:34 +00:00
c-aux-info.c Conditionally compile support for --enable-mapped_location. 2004-06-30 11:11:14 -07:00
c-common.c c-common.h (check_function_format): Remove first parameter. 2004-06-30 23:28:02 +01:00
c-common.def
c-common.h c-common.h (check_function_format): Remove first parameter. 2004-06-30 23:28:02 +01:00
c-config-lang.in
c-convert.c
c-cppbuiltin.c
c-decl.c langhooks.c: Don't include gt-langhooks.h. 2004-07-05 17:28:37 +00:00
c-dump.c Conditionally compile support for --enable-mapped_location. 2004-06-30 11:05:07 -07:00
c-errors.c
c-format.c re PR c/1027 (slightly misleading printf format warning) 2004-07-01 09:52:33 +01:00
c-gimplify.c Conditionally compile support for --enable-mapped_location. 2004-06-30 11:05:07 -07:00
c-incpath.c
c-incpath.h
c-lang.c langhooks.c: Don't include gt-langhooks.h. 2004-07-05 17:28:37 +00:00
c-lex.c Conditionally compile support for --enable-mapped_location. 2004-06-30 11:05:07 -07:00
c-mudflap.c
c-objc-common.c re PR c/1027 (slightly misleading printf format warning) 2004-07-01 09:52:33 +01:00
c-opts.c Conditionally compile support for --enable-mapped_location. 2004-06-30 11:05:07 -07:00
c-parse.in Conditionally compile support for --enable-mapped_location. 2004-06-30 11:11:14 -07:00
c-pch.c
c-ppoutput.c Conditionally compile support for --enable-mapped_location. 2004-06-30 11:11:14 -07:00
c-pragma.c
c-pragma.h
c-pretty-print.c c-pretty-print.c (pp_c_postfix_expression): Fix pasto. 2004-07-01 17:51:54 +00:00
c-pretty-print.h
c-semantics.c Conditionally compile support for --enable-mapped_location. 2004-06-30 11:11:14 -07:00
c-tree.h langhooks.c: Don't include gt-langhooks.h. 2004-07-05 17:28:37 +00:00
c-typeck.c re PR c/16348 (Loop gets executed when it shouldnt) 2004-07-04 10:28:56 -07:00
c.opt re PR c++/15145 (Implementing -Wsequence-point for C++ would be very useful) 2004-06-27 18:58:24 -07:00
caller-save.c
calls.c c-decl.c (grokdeclarator): Don't frob current_function_decl around variable_size. 2004-07-02 17:15:50 -07:00
cfg.c
cfganal.c
cfgbuild.c
cfgcleanup.c
cfgexpand.c c-decl.c (grokdeclarator): Don't frob current_function_decl around variable_size. 2004-07-02 17:15:50 -07:00
cfghooks.c
cfghooks.h
cfglayout.c function.h (struct function): Remove dont_emit_block_notes. 2004-07-01 01:00:47 -07:00
cfglayout.h
cfgloop.c
cfgloop.h
cfgloopanal.c
cfgloopmanip.c
cfgrtl.c Conditionally compile support for --enable-mapped_location. 2004-06-30 11:18:01 -07:00
cgraph.c
cgraph.h cgraph.h (cgraph_build_static_cdtor): Declare. 2004-07-01 00:51:12 -07:00
cgraphunit.c cgraph.h (cgraph_build_static_cdtor): Declare. 2004-07-01 00:51:12 -07:00
ChangeLog langhooks.c: Don't include gt-langhooks.h. 2004-07-05 17:28:37 +00:00
ChangeLog.0
ChangeLog.1
ChangeLog.2
ChangeLog.3
ChangeLog.4
ChangeLog.5
ChangeLog.6
ChangeLog.7
ChangeLog.8
ChangeLog.9
ChangeLog.10
ChangeLog.11 Rotate ChangeLog 2004-07-01 12:47:14 +00:00
ChangeLog.lib
ChangeLog.tree-ssa
collect2.c
collect2.h
combine.c * combine.c (simplify_comparison): Fix comment typo. 2004-07-04 22:22:50 +00:00
common.opt common.opt (ftree-loop-optimize): New flag. 2004-06-30 21:29:00 +00:00
conditions.h
config.build
config.gcc * config.gcc (sh*-*elf*): Remove dead assignment of sh_multilibs. 2004-06-28 23:06:17 +01:00
config.host
config.in
configure configure.ac (ranlib_flags): New variable. 2004-07-04 17:18:59 +00:00
configure.ac configure.ac (ranlib_flags): New variable. 2004-07-04 17:18:59 +00:00
conflict.c
convert.c
convert.h
COPYING
COPYING.LIB
coretypes.h
coverage.c cgraph.h (cgraph_build_static_cdtor): Declare. 2004-07-01 00:51:12 -07:00
coverage.h
cppdefault.c
cppdefault.h
cppspec.c
crtstuff.c
cse.c rtl.def (ADDRESSOF): Remove. 2004-07-04 01:07:15 -07:00
cselib.c alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 12:52:53 +00:00
cselib.h
cstamp-h.in
dbxout.c alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 12:52:53 +00:00
dbxout.h
ddg.c alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 12:42:07 +00:00
ddg.h
debug.c
debug.h
defaults.h
df.c alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 12:52:53 +00:00
df.h
diagnostic.c Conditionally compile support for --enable-mapped_location. 2004-06-30 11:18:01 -07:00
diagnostic.def
diagnostic.h
dojump.c alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 12:52:53 +00:00
dominance.c
domwalk.c
domwalk.h
dummy-conditions.c
dwarf2.h
dwarf2asm.c
dwarf2asm.h
dwarf2out.c c-tree.h (TYPE_ACTUAL_ARG_TYPES): Use TYPE_LANG_SLOT_1. 2004-07-05 09:35:44 +00:00
dwarf2out.h
dwarf.h
emit-rtl.c rtl.def (ADDRESSOF): Remove. 2004-07-04 01:07:15 -07:00
emit-rtl.h
errors.c
errors.h
et-forest.c
et-forest.h
except.c
except.h
explow.c rtl.def (ADDRESSOF): Remove. 2004-07-04 01:07:15 -07:00
expmed.c rtl.def (ADDRESSOF): Remove. 2004-07-04 01:07:15 -07:00
expr.c expr.c (expand_expr_real_1, [...]): Don't check against bounds if bounds aren't constant. 2004-07-05 11:09:06 -04:00
expr.h
final.c * final.c (final): Fix typo reported by Aaron W. LaFramboise. 2004-07-01 10:09:32 -07:00
fix-header.c
fixproto
flags.h common.opt (ftree-fre): New flag. 2004-06-28 21:53:04 -04:00
flow.c alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 12:52:53 +00:00
fold-const.c fold-const.c (fold): Optimize unsigned modulus by a power of two into a bit-wise AND, i.e. 2004-07-05 16:44:17 +00:00
fp-test.c
FSFChangeLog
FSFChangeLog.10
FSFChangeLog.11
function.c function.c, [...]: Move max_size hook to type hooks; remove bogus PARAMS. 2004-07-05 10:22:28 -04:00
function.h rtl.def (ADDRESSOF): Remove. 2004-07-04 01:07:15 -07:00
gbl-ctors.h
gcc.c gcc.c (STANDARD_STARTFILE_PREFIX_1): Define. 2004-07-01 23:55:22 +00:00
gcc.h
gccbug.in
gccspec.c
gcov-dump.c
gcov-io.c
gcov-io.h
gcov-iov.c
gcov.c
gcse.c
gdbinit.in
gen-protos.c
genattr.c
genattrtab.c
genattrtab.h
genautomata.c
gencheck.c
gencodes.c
genconditions.c
genconfig.c
genconstants.c
genemit.c
genextract.c
genflags.c
gengenrtl.c
gengtype-lex.l Conditionally compile support for --enable-mapped_location. 2004-06-30 11:21:54 -07:00
gengtype-yacc.y
gengtype.c c-decl.c (grokdeclarator): Don't frob current_function_decl around variable_size. 2004-07-02 17:15:50 -07:00
gengtype.h
genmodes.c
genmultilib
genopinit.c
genoutput.c
genpeep.c
genpreds.c
genrecog.c rtl.def (ADDRESSOF): Remove. 2004-07-04 01:07:15 -07:00
gensupport.c
gensupport.h
ggc-common.c
ggc-none.c
ggc-page.c
ggc-zone.c
ggc.h
gimple-low.c gimple-low.c (lower_function_body): Don't reset_block_changes here. 2004-07-01 21:53:37 -07:00
gimplify.c tree.h (DECL_SEEN_IN_BIND_EXPR_P): New macro. 2004-07-05 12:39:15 -04:00
glimits.h
global.c
gmon.c
graph.c
graph.h
gstab.h
gsyms.h
gsyslimits.h
gthr-aix.h
gthr-dce.h
gthr-gnat.c
gthr-gnat.h
gthr-posix.c
gthr-posix.h
gthr-rtems.h
gthr-single.h
gthr-solaris.h
gthr-vxworks.h
gthr-win32.h
gthr.h
haifa-sched.c Conditionally compile support for --enable-mapped_location. 2004-06-30 11:18:01 -07:00
hard-reg-set.h
hooks.c
hooks.h
host-default.c
hosthooks-def.h
hosthooks.h
hwint.h
ifcvt.c ifcvt.c (noce_try_sign_mask): Call emit_store_flag to generate a "sign mask" instead of using ashr_optab directly. 2004-07-04 14:57:34 +00:00
input.h Conditionally compile support for --enable-mapped_location. 2004-06-30 10:58:21 -07:00
insn-addr.h
integrate.c rtl.def (ADDRESSOF): Remove. 2004-07-04 01:07:15 -07:00
integrate.h
intl.c
intl.h
jump.c Conditionally compile support for --enable-mapped_location. 2004-06-30 11:18:01 -07:00
langhooks-def.h function.c, [...]: Move max_size hook to type hooks; remove bogus PARAMS. 2004-07-05 10:22:28 -04:00
langhooks.c langhooks.c: Don't include gt-langhooks.h. 2004-07-05 17:28:37 +00:00
langhooks.h function.c, [...]: Move max_size hook to type hooks; remove bogus PARAMS. 2004-07-05 10:22:28 -04:00
LANGUAGES
lcm.c
libada-mk.in
libfuncs.h cgraph.h (cgraph_build_static_cdtor): Declare. 2004-07-01 00:51:12 -07:00
libgcc2.c
libgcc2.h
libgcc-darwin.ver
libgcc-std.ver
libgcov.c
limitx.h
limity.h
lists.c
local-alloc.c alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 12:52:53 +00:00
longlong.h
loop-doloop.c
loop-init.c
loop-invariant.c
loop-iv.c
loop-unroll.c
loop-unswitch.c
loop.c alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 12:52:53 +00:00
loop.h
machmode.def
machmode.h
main.c
Makefile.in langhooks.c: Don't include gt-langhooks.h. 2004-07-05 17:28:37 +00:00
mips-tdump.c
mips-tfile.c
mkconfig.sh
mkheaders.in
mklibgcc.in
mkmap-flat.awk
mkmap-symver.awk
mode-classes.def
modulo-sched.c ifcvt.c, [...]: Fix comment typos. 2004-07-02 00:51:01 +00:00
ONEWS
opt-functions.awk
opt-gather.awk
optabs.c alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 12:52:53 +00:00
optabs.h
optc-gen.awk
opth-gen.awk
opts.c langhooks.c: Don't include gt-langhooks.h. 2004-07-05 17:28:37 +00:00
opts.h langhooks.c: Don't include gt-langhooks.h. 2004-07-05 17:28:37 +00:00
output.h
params.c
params.def
params.h
passes.c rtl.def (ADDRESSOF): Remove. 2004-07-04 01:07:15 -07:00
postreload.c alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 12:52:53 +00:00
predict.c
predict.def
predict.h
prefix.c prefix.c (lookup_key): Cast buffer to LPBYTE. 2004-06-30 11:45:58 -07:00
prefix.h
pretty-print.c Conditionally compile support for --enable-mapped_location. 2004-06-30 11:18:01 -07:00
pretty-print.h
print-rtl.c Conditionally compile support for --enable-mapped_location. 2004-06-30 11:18:01 -07:00
print-tree.c c-decl.c (grokdeclarator): Don't frob current_function_decl around variable_size. 2004-07-02 17:15:50 -07:00
profile.c Conditionally compile support for --enable-mapped_location. 2004-06-30 11:18:01 -07:00
protoize.c
ra-build.c alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 12:52:53 +00:00
ra-colorize.c
ra-debug.c alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 12:52:53 +00:00
ra-rewrite.c alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 12:52:53 +00:00
ra.c
ra.h
read-rtl.c
README-fixinc
README.Portability
real.c
real.h
recog.c rtl.def (ADDRESSOF): Remove. 2004-07-04 01:07:15 -07:00
recog.h
reg-stack.c alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 12:52:53 +00:00
regclass.c alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 12:52:53 +00:00
regmove.c alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 12:52:53 +00:00
regrename.c alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 12:52:53 +00:00
regs.h
reload1.c rtl.def (ADDRESSOF): Remove. 2004-07-04 01:07:15 -07:00
reload.c alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 12:52:53 +00:00
reload.h
reorg.c RTL prologue/epilogue for SPARC 2004-06-30 10:31:30 +00:00
resource.c alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 12:52:53 +00:00
resource.h
rtl-error.c Conditionally compile support for --enable-mapped_location. 2004-06-30 11:18:01 -07:00
rtl-profile.c
rtl.c rtl.def (ADDRESSOF): Remove. 2004-07-04 01:07:15 -07:00
rtl.def rtl.def (ADDRESSOF): Remove. 2004-07-04 01:07:15 -07:00
rtl.h rtl.h (struct rtx_def): Remove the integrated flag. 2004-07-05 07:22:45 +00:00
rtlanal.c rtl.def (ADDRESSOF): Remove. 2004-07-04 01:07:15 -07:00
rtlhooks-def.h
rtlhooks.c rtl.def (ADDRESSOF): Remove. 2004-07-04 01:07:15 -07:00
sbitmap.c
sbitmap.h
scan-decls.c
scan-types.sh
scan.c
scan.h
sched-deps.c alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 12:52:53 +00:00
sched-ebb.c
sched-int.h
sched-rgn.c Conditionally compile support for --enable-mapped_location. 2004-06-30 11:21:54 -07:00
sched-vis.c Conditionally compile support for --enable-mapped_location. 2004-06-30 11:21:54 -07:00
sdbout.c alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 12:52:53 +00:00
sdbout.h
SERVICE
simplify-rtx.c simplify-rtx.c (simplify_binary_operation): Use rtx_cost instead of "had_mult" to determine whether the transformed... 2004-07-01 13:09:39 +00:00
sort-protos
sreal.c
sreal.h
stab.def
stack.h
statistics.h
stmt.c rtl.def (ADDRESSOF): Remove. 2004-07-04 01:07:15 -07:00
stor-layout.c c-decl.c (grokdeclarator): Don't frob current_function_decl around variable_size. 2004-07-02 17:15:50 -07:00
stringpool.c
stub-objc.c
sys-protos.h
sys-types.h
system.h
target-def.h target.h (struct gcc_target): Add new field to struct cxx: import_export_class. 2004-07-01 08:47:16 +00:00
target.h target.h (struct gcc_target): Add new field to struct cxx: import_export_class. 2004-07-01 08:47:16 +00:00
targhooks.c target-def.h (TARGET_CXX_GET_COOKIE_SIZE, [...]): Define. 2004-06-29 14:50:35 +00:00
targhooks.h target-def.h (TARGET_CXX_GET_COOKIE_SIZE, [...]): Define. 2004-06-29 14:50:35 +00:00
timevar.c
timevar.def common.opt (ftree-fre): New flag. 2004-06-28 21:53:04 -04:00
timevar.h
tlink.c
toplev.c Conditionally compile support for --enable-mapped_location. 2004-06-30 10:58:21 -07:00
toplev.h
tracer.c
tree-alias-ander.c
tree-alias-ander.h
tree-alias-common.c ifcvt.c, [...]: Fix comment typos. 2004-07-02 00:51:01 +00:00
tree-alias-common.h
tree-alias-type.c
tree-alias-type.h
tree-browser.c
tree-browser.def
tree-cfg.c * tree-cfg.c (verify_expr): Use CHECK_OK in binary case. 2004-07-05 10:25:14 -04:00
tree-chrec.c Makefile.in (OBJS-common): Add tree-chrec.o. 2004-06-30 15:37:42 +00:00
tree-chrec.h Makefile.in (OBJS-common): Add tree-chrec.o. 2004-06-30 15:37:42 +00:00
tree-complex.c
tree-dfa.c
tree-dump.c Conditionally compile support for --enable-mapped_location. 2004-06-30 11:11:14 -07:00
tree-dump.h
tree-eh.c tree-cfg.c (verify_stmt): Add last_in_block parameter. 2004-06-28 23:59:35 -07:00
tree-flow-inline.h Conditionally compile support for --enable-mapped_location. 2004-06-30 11:21:54 -07:00
tree-flow.h * tree-flow.h (bb_ann_d): Remove ephi_nodes field. 2004-07-02 07:34:30 +00:00
tree-gimple.c tree.def (RTL_EXPR): Remove. 2004-07-01 18:15:43 -07:00
tree-gimple.h gimplify.c (gimplify_compound_lval): Take fallback argument instead of want_lvalue. 2004-06-30 17:14:43 -07:00
tree-inline.c tree.h (DECL_SEEN_IN_BIND_EXPR_P): New macro. 2004-07-05 12:39:15 -04:00
tree-inline.h c-decl.c (grokdeclarator): Don't frob current_function_decl around variable_size. 2004-07-02 17:15:50 -07:00
tree-into-ssa.c tree-ssa-loop-ch.c: New file. 2004-06-30 21:11:28 +00:00
tree-iterator.c
tree-iterator.h
tree-mudflap.c Conditionally compile support for --enable-mapped_location. 2004-06-30 11:11:14 -07:00
tree-mudflap.h
tree-nested.c tree.h (DECL_SEEN_IN_BIND_EXPR_P): New macro. 2004-07-05 12:39:15 -04:00
tree-nomudflap.c
tree-nrv.c
tree-optimize.c function.h (struct function): Remove x_whole_function_mode_p. 2004-06-30 18:12:19 -07:00
tree-outof-ssa.c
tree-pass.h common.opt (ftree-loop-optimize): New flag. 2004-06-30 21:29:00 +00:00
tree-phinodes.c
tree-pretty-print.c tree-pretty-print.c (dump_generic_node, [...]): Properly print bounds. 2004-07-05 11:16:10 -04:00
tree-profile.c
tree-sra.c tree-sra.c (struct sra_walk_fns): Init function now returns bool. 2004-07-05 12:14:51 -04:00
tree-ssa-alias.c
tree-ssa-ccp.c tree-ssa-ccp.c (set_rhs): Change function to return a bool. 2004-07-04 18:41:05 +00:00
tree-ssa-copy.c ifcvt.c, [...]: Fix comment typos. 2004-07-02 00:51:01 +00:00
tree-ssa-copyrename.c
tree-ssa-dce.c tree-cfg.c (verify_stmt): Add last_in_block parameter. 2004-06-28 23:59:35 -07:00
tree-ssa-dom.c tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Don't fold fp plus with minus. 2004-07-03 11:57:18 -07:00
tree-ssa-dse.c
tree-ssa-forwprop.c
tree-ssa-live.c
tree-ssa-live.h
tree-ssa-loop-ch.c tree-ssa-loop-ch.c: New file. 2004-06-30 21:11:28 +00:00
tree-ssa-loop.c common.opt (ftree-loop-optimize): New flag. 2004-06-30 21:29:00 +00:00
tree-ssa-operands.c tree-ssa-loop-ch.c: New file. 2004-06-30 21:11:28 +00:00
tree-ssa-operands.h tree-ssa-loop-ch.c: New file. 2004-06-30 21:11:28 +00:00
tree-ssa-phiopt.c
tree-ssa-pre.c tree-ssa-pre.c (bb_value_sets): phi_gen, tmp_gen, new_sets now are bitmap_set_t's. 2004-07-04 22:51:36 +00:00
tree-ssa.c tree-ssa.c (tree_ssa_useless_type_conversion): Also look at VIEW_CONVERT_EXPR and NON_LVALUE_EXPR. 2004-07-03 09:45:29 -04:00
tree-ssanames.c
tree-tailcall.c
tree-vn.c tree-ssa-pre.c (phi_trans_add): Use is_gimple_min_invariant to check for constants. 2004-06-30 07:06:28 -04:00
tree.c langhooks.c: Don't include gt-langhooks.h. 2004-07-05 17:28:37 +00:00
tree.def c-tree.h (TYPE_ACTUAL_ARG_TYPES): Use TYPE_LANG_SLOT_1. 2004-07-05 09:35:44 +00:00
tree.h tree.h (DECL_SEEN_IN_BIND_EXPR_P): New macro. 2004-07-05 12:39:15 -04:00
tsystem.h
typeclass.h
unroll.c alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 12:52:53 +00:00
unwind-c.c
unwind-dw2-fde-darwin.c
unwind-dw2-fde-glibc.c
unwind-dw2-fde.c
unwind-dw2-fde.h
unwind-dw2.c Index: gcc/ChangeLog 2004-07-01 04:09:07 +00:00
unwind-dw2.h Index: gcc/ChangeLog 2004-07-01 04:09:07 +00:00
unwind-pe.h
unwind-sjlj.c
unwind.h
unwind.inc
value-prof.c
value-prof.h
var-tracking.c var-tracking.c: Fix some comments. 2004-07-05 04:50:22 +00:00
varasm.c alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 12:52:53 +00:00
varray.c
varray.h
vec.c vec.h, vec.c: New, type safe vector API. 2004-06-28 10:30:21 +00:00
vec.h vec.h (VEC_T_safe_push, [...]): Tweak for when size_t is bigger than int. 2004-06-29 15:56:17 +00:00
version.c Daily bump. 2004-07-05 00:16:11 +00:00
version.h
vmsdbg.h
vmsdbgout.c
web.c rtl.def (ADDRESSOF): Remove. 2004-07-04 01:07:15 -07:00
xcoff.h
xcoffout.c Conditionally compile support for --enable-mapped_location. 2004-06-30 11:05:07 -07:00
xcoffout.h

Copyright (C) 2000, 2003 Free Software Foundation, Inc.

This file is intended to contain a few notes about writing C code
within GCC so that it compiles without error on the full range of
compilers GCC needs to be able to compile on.

The problem is that many ISO-standard constructs are not accepted by
either old or buggy compilers, and we keep getting bitten by them.
This knowledge until know has been sparsely spread around, so I
thought I'd collect it in one useful place.  Please add and correct
any problems as you come across them.

I'm going to start from a base of the ISO C90 standard, since that is
probably what most people code to naturally.  Obviously using
constructs introduced after that is not a good idea.

For the complete coding style conventions used in GCC, please read
http://gcc.gnu.org/codingconventions.html


String literals
---------------

Irix6 "cc -n32" and OSF4 "cc" have problems with constant string
initializers with parens around it, e.g.

const char string[] = ("A string");

This is unfortunate since this is what the GNU gettext macro N_
produces.  You need to find a different way to code it.

Some compilers like MSVC++ have fairly low limits on the maximum
length of a string literal; 509 is the lowest we've come across.  You
may need to break up a long printf statement into many smaller ones.


Empty macro arguments
---------------------

ISO C (6.8.3 in the 1990 standard) specifies the following:

If (before argument substitution) any argument consists of no
preprocessing tokens, the behavior is undefined.

This was relaxed by ISO C99, but some older compilers emit an error,
so code like

#define foo(x, y) x y
foo (bar, )

needs to be coded in some other way.


free and realloc
----------------

Some implementations crash upon attempts to free or realloc the null
pointer.  Thus if mem might be null, you need to write

  if (mem)
    free (mem);


Trigraphs
---------

You weren't going to use them anyway, but some otherwise ISO C
compliant compilers do not accept trigraphs.


Suffixes on Integer Constants
-----------------------------

You should never use a 'l' suffix on integer constants ('L' is fine),
since it can easily be confused with the number '1'.


			Common Coding Pitfalls
			======================

errno
-----

errno might be declared as a macro.


Implicit int
------------

In C, the 'int' keyword can often be omitted from type declarations.
For instance, you can write

  unsigned variable;

as shorthand for

  unsigned int variable;

There are several places where this can cause trouble.  First, suppose
'variable' is a long; then you might think

  (unsigned) variable

would convert it to unsigned long.  It does not.  It converts to
unsigned int.  This mostly causes problems on 64-bit platforms, where
long and int are not the same size.

Second, if you write a function definition with no return type at
all:

  operate (int a, int b)
  {
    ...
  }

that function is expected to return int, *not* void.  GCC will warn
about this.

Implicit function declarations always have return type int.  So if you
correct the above definition to

  void
  operate (int a, int b)
  ...

but operate() is called above its definition, you will get an error
about a "type mismatch with previous implicit declaration".  The cure
is to prototype all functions at the top of the file, or in an
appropriate header.

Char vs unsigned char vs int
----------------------------

In C, unqualified 'char' may be either signed or unsigned; it is the
implementation's choice.  When you are processing 7-bit ASCII, it does
not matter.  But when your program must handle arbitrary binary data,
or fully 8-bit character sets, you have a problem.  The most obvious
issue is if you have a look-up table indexed by characters.

For instance, the character '\341' in ISO Latin 1 is SMALL LETTER A
WITH ACUTE ACCENT.  In the proper locale, isalpha('\341') will be
true.  But if you read '\341' from a file and store it in a plain
char, isalpha(c) may look up character 225, or it may look up
character -31.  And the ctype table has no entry at offset -31, so
your program will crash.  (If you're lucky.)

It is wise to use unsigned char everywhere you possibly can.  This
avoids all these problems.  Unfortunately, the routines in <string.h>
take plain char arguments, so you have to remember to cast them back
and forth - or avoid the use of strxxx() functions, which is probably
a good idea anyway.

Another common mistake is to use either char or unsigned char to
receive the result of getc() or related stdio functions.  They may
return EOF, which is outside the range of values representable by
char.  If you use char, some legal character value may be confused
with EOF, such as '\377' (SMALL LETTER Y WITH UMLAUT, in Latin-1).
The correct choice is int.

A more subtle version of the same mistake might look like this:

  unsigned char pushback[NPUSHBACK];
  int pbidx;
  #define unget(c) (assert(pbidx < NPUSHBACK), pushback[pbidx++] = (c))
  #define get(c) (pbidx ? pushback[--pbidx] : getchar())
  ...
  unget(EOF);

which will mysteriously turn a pushed-back EOF into a SMALL LETTER Y
WITH UMLAUT.


Other common pitfalls
---------------------

o Expecting 'plain' char to be either sign or unsigned extending.

o Shifting an item by a negative amount or by greater than or equal to
  the number of bits in a type (expecting shifts by 32 to be sensible
  has caused quite a number of bugs at least in the early days).

o Expecting ints shifted right to be sign extended.

o Modifying the same value twice within one sequence point.

o Host vs. target floating point representation, including emitting NaNs
  and Infinities in a form that the assembler handles.

o qsort being an unstable sort function (unstable in the sense that
  multiple items that sort the same may be sorted in different orders
  by different qsort functions).

o Passing incorrect types to fprintf and friends.

o Adding a function declaration for a module declared in another file to
  a .c file instead of to a .h file.