gcc/gcc
Jason Merrill f000c6a763 re PR c++/4926 (C++ ABI needs clarification on mangling of complex expressions)
PR c++/4926
	PR c++/38600
	* mangle.c (write_unqualified_id): Split out from write_expression.
	(write_unqualified_name): Call it.
	(write_member_name): Likewise.
	(write_expression): Support TEMPLATE_ID_EXPR.
	Disambiguate operator names.

From-SVN: r156482
2010-02-03 15:42:48 -05:00
..
ada s-win32.ads: Add some missing constants. 2010-01-28 14:44:54 +01:00
config h8300.md (can_delay): Fix attibute condition. 2010-02-03 13:18:44 -07:00
cp re PR c++/4926 (C++ ABI needs clarification on mangling of complex expressions) 2010-02-03 15:42:48 -05:00
doc invoke.texi: Fix name of sched1 dump. 2010-02-03 12:36:27 +00:00
fortran re PR fortran/42936 (Result of passing NULL() as actual arg doesn't inherit characteristics from the corresponding dummy arg) 2010-02-03 09:26:08 +01:00
ginclude
java * jvspec.c (lang_specific_driver): Constify two variables named "p". 2010-01-20 10:35:38 +00:00
lto lto.c (O_BINARY): Define. 2010-01-11 23:15:32 +00:00
objc configure.ac: Add install-html to target_list for Make-hooks. 2010-01-04 01:36:36 +00:00
objcp configure.ac: Add install-html to target_list for Make-hooks. 2010-01-04 01:36:36 +00:00
po * sv.po: Update. 2010-02-01 00:28:40 +00:00
testsuite re PR c++/4926 (C++ ABI needs clarification on mangling of complex expressions) 2010-02-03 15:42:48 -05:00
ABOUT-GCC-NLS
acinclude.m4
aclocal.m4
addresses.h
alias.c
alias.h
alloc-pool.c
alloc-pool.h
attribs.c
auto-inc-dec.c postreload-gcse.c (insert_expr_in_table): Replace BLOCK_NUM with BLOCK_FOR_INSN. 2010-01-03 13:13:03 +00:00
BASE-VER
basic-block.h postreload-gcse.c (insert_expr_in_table): Replace BLOCK_NUM with BLOCK_FOR_INSN. 2010-01-03 13:13:03 +00:00
bb-reorder.c re PR rtl-optimization/42621 (Computed gotos on AMD 800% slower) 2010-01-10 23:31:30 +00:00
bitmap.c
bitmap.h
bt-load.c
builtin-attrs.def
builtin-types.def
builtins.c re PR c++/35652 (offset warning should be given in the front-end) 2010-02-03 11:28:07 -05:00
builtins.def
c-aux-info.c
c-common.c tree.h (TYPE_TRANSPARENT_UNION): Replace with ... 2010-01-21 00:49:35 -05:00
c-common.def
c-common.h
c-config-lang.in
c-convert.c
c-cppbuiltin.c
c-decl.c tree.h (TYPE_TRANSPARENT_UNION): Replace with ... 2010-01-21 00:49:35 -05:00
c-dump.c
c-errors.c
c-format.c
c-format.h
c-gimplify.c
c-lang.c
c-lang.h
c-lex.c
c-objc-common.c
c-objc-common.h
c-omp.c
c-opts.c
c-parser.c
c-pch.c
c-ppoutput.c
c-pragma.c
c-pragma.h
c-pretty-print.c
c-pretty-print.h
c-semantics.c
c-tree.h
c-typeck.c tree.h (TYPE_TRANSPARENT_UNION): Replace with ... 2010-01-21 00:49:35 -05:00
c.opt re PR translation/42467 (exgettext should not remove TABs from option help strings) 2010-01-11 04:28:36 +00:00
caller-save.c
calls.c tree.h (TYPE_TRANSPARENT_UNION): Replace with ... 2010-01-21 00:49:35 -05:00
cfg.c
cfganal.c
cfgbuild.c
cfgcleanup.c
cfgexpand.c re PR middle-end/39954 (Revision 146817 caused unaligned access in gcc.dg/torture/pr26565.c) 2010-01-18 12:59:50 +00:00
cfghooks.c
cfghooks.h
cfglayout.c
cfglayout.h
cfgloop.c
cfgloop.h
cfgloopanal.c
cfgloopmanip.c
cfgrtl.c
cgraph.c re PR tree-optimization/42625 (-fipa-sra can generate different destructors in different object files, binary breaks after linking) 2010-01-07 16:10:26 +01:00
cgraph.h
cgraphbuild.c
cgraphunit.c sel-sched.c (create_speculation_check): Remove set but not used variable twin. 2010-01-20 12:30:05 +01:00
ChangeLog h8300.md (can_delay): Fix attibute condition. 2010-02-03 13:18:44 -07:00
ChangeLog-1997
ChangeLog-1998
ChangeLog-1999
ChangeLog-2000
ChangeLog-2001
ChangeLog-2002
ChangeLog-2003
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog.dataflow
ChangeLog.graphite re PR tree-optimization/42681 (ICE: in build2_stat, at tree.c:3664 with "-O1 -fgraphite-identity") 2010-01-14 08:37:26 +00:00
ChangeLog.lib
ChangeLog.ptr
ChangeLog.tree-ssa
ChangeLog.tuples
cif-code.def
collect2-aix.c
collect2-aix.h
collect2.c configure.ac (HAVE_AS_REF): New C macro. 2010-01-16 12:14:09 +00:00
collect2.h
combine-stack-adj.c
combine.c re PR rtl-optimization/42691 (problematic REG_EQUAL note added to SUBREG) 2010-01-15 21:54:01 +00:00
common.opt re PR c++/12909 (ambiguity in mangling vector types) 2010-02-03 15:42:35 -05:00
conditions.h
config.build
config.gcc config.gcc: Reenable check for obsolete targets. 2010-02-03 09:03:59 +00:00
config.host
config.in configure.ac (HAVE_AS_REF): New C macro. 2010-01-16 12:14:09 +00:00
configure configure.ac: Fix __stack_chk_fail check for cross builds configured --with-headers 2010-01-31 15:01:53 +00:00
configure.ac configure.ac: Fix __stack_chk_fail check for cross builds configured --with-headers 2010-01-31 15:01:53 +00:00
convert.c
convert.h
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
coretypes.h
coverage.c
coverage.h
cppdefault.c
cppdefault.h
cppspec.c
crtstuff.c
cse.c re PR rtl-optimization/42699 (ZERO_EXTRACT on lhs never optimized out) 2010-01-12 21:25:10 +01:00
cselib.c re PR debug/42896 (Random debug generation differences, bootstrap fails) 2010-02-03 15:00:33 +00:00
cselib.h re PR debug/42896 (Random debug generation differences, bootstrap fails) 2010-02-03 15:00:33 +00:00
cstamp-h.in
DATESTAMP Daily bump. 2010-02-03 00:16:56 +00:00
dbgcnt.c
dbgcnt.def
dbgcnt.h
dbxout.c
dbxout.h
dce.c
dce.h
ddg.c
ddg.h
debug.c
debug.h
defaults.h
DEV-PHASE
df-byte-scan.c
df-core.c re PR rtl-optimization/42889 ("-fcompare-debug failure (length)" with "-O1 -fgcse") 2010-01-29 13:14:47 +01:00
df-problems.c
df-scan.c re PR rtl-optimization/42889 ("-fcompare-debug failure (length)" with "-O1 -fgcse") 2010-01-29 13:14:47 +01:00
df.h re PR rtl-optimization/42889 ("-fcompare-debug failure (length)" with "-O1 -fgcse") 2010-01-29 13:14:47 +01:00
dfp.c
dfp.h
diagnostic.c
diagnostic.def
diagnostic.h
dojump.c
dominance.c re PR bootstrap/41771 (Bootstrap with Sun Studio 12.1 fails) 2010-01-05 17:14:30 +00:00
domwalk.c
domwalk.h
double-int.c
double-int.h
dse.c re PR debug/42896 (Random debug generation differences, bootstrap fails) 2010-02-03 15:00:33 +00:00
dse.h
dummy-checksum.c
dwarf2asm.c
dwarf2asm.h
dwarf2out.c dwarf2out.c (mem_loc_descriptor): Remove special casing of CONSTANT_POOL_ADDRESS_P SYMBOL_REFs. 2010-01-27 17:38:58 +01:00
dwarf2out.h
ebitmap.c
ebitmap.h
emit-rtl.c
emit-rtl.h
emutls.c
errors.c
errors.h
et-forest.c
et-forest.h
except.c
except.h
exec-tool.in
explow.c
expmed.c
expr.c
expr.h
final.c
fixed-value.c
fixed-value.h
flags.h re PR bootstrap/41771 (Bootstrap with Sun Studio 12.1 fails) 2010-01-05 17:14:30 +00:00
fold-const.c re PR middle-end/19988 (pessimizes fp multiply-add/subtract combo) 2010-01-21 12:15:40 +00:00
fp-test.c
FSFChangeLog
FSFChangeLog.10
FSFChangeLog.11
function.c tree.h (TYPE_TRANSPARENT_UNION): Replace with ... 2010-01-21 00:49:35 -05:00
function.h
fwprop.c re PR debug/42728 ("-fcompare-debug failure (length)" at -O1) 2010-01-19 13:38:25 +01:00
gbl-ctors.h
gcc-plugin.h * gcc-plugin.h (plugin_init): Use "C" likage for c++. 2010-01-22 21:01:49 +00:00
gcc.c gcc.c (process_command): Move lang_specific_driver before setting cc_libexec_prefix. 2010-01-21 15:29:30 +00:00
gcc.h Pass -dumpbase and -dumpdir to gcc for LTO 2010-01-03 09:03:38 -08:00
gccbug.in
gccspec.c
gcov-dump.c gcc.c (process_command): Update copyright notice dates. 2010-01-09 01:00:42 +01:00
gcov-io.c
gcov-io.h
gcov-iov.c
gcov.c gcc.c (process_command): Update copyright notice dates. 2010-01-09 01:00:42 +01:00
gcse.c invoke.texi: Fix name of sched1 dump. 2010-02-03 12:36:27 +00:00
gdbinit.in
genattr.c
genattrtab.c
genautomata.c
gencheck.c
genchecksum.c
gencodes.c
genconditions.c
genconfig.c
genconstants.c
genemit.c
genextract.c
genflags.c
gengenrtl.c
gengtype-lex.l
gengtype-parse.c
gengtype.c
gengtype.h
genmddeps.c
genmodes.c
genmultilib
genopinit.c
genoutput.c
genpeep.c
genpreds.c
genrecog.c
gensupport.c
gensupport.h
ggc-common.c
ggc-none.c
ggc-page.c
ggc-zone.c
ggc.h
gimple-iterator.c
gimple-low.c
gimple-pretty-print.c
gimple.c re PR lto/42665 (Internal compiler exception in with gfortran when using -fwhole-program -flto -fopenmp) 2010-01-14 09:38:56 +00:00
gimple.def
gimple.h gimple.h (gss_for_code): Wrap gcc_assert in ENABLE_CHECKING. 2010-01-07 16:14:02 +00:00
gimplify.c re PR middle-end/42898 (volatile structures and compound literal initializers) 2010-01-31 17:01:38 +00:00
glimits.h
graph.c
graph.h
graphds.c
graphds.h
graphite-blocking.c Update loop-block testcases. 2010-01-07 18:33:01 +00:00
graphite-clast-to-gimple.c sel-sched.c (create_speculation_check): Remove set but not used variable twin. 2010-01-20 12:30:05 +01:00
graphite-clast-to-gimple.h
graphite-dependences.c
graphite-dependences.h
graphite-interchange.c Memoize memory strides per loop. 2010-01-08 04:35:43 +00:00
graphite-poly.c
graphite-poly.h Memoize memory strides per loop. 2010-01-08 04:35:43 +00:00
graphite-ppl.c
graphite-ppl.h
graphite-scop-detection.c Remove COMPONENT_REF limitation in SCoP detection. 2010-01-08 16:07:18 +00:00
graphite-scop-detection.h
graphite-sese-to-poly.c
graphite-sese-to-poly.h
graphite.c re PR tree-optimization/42521 (ICE: in graphite_loop_normal_form, at graphite-sese-to-poly.c:2844) 2010-01-08 07:39:01 +00:00
graphite.h
gsstruct.def
gstab.h
gsyms.h
gsyslimits.h
gthr-aix.h
gthr-dce.h
gthr-gnat.c
gthr-gnat.h
gthr-lynx.h
gthr-mipssde.h
gthr-nks.h
gthr-posix95.h
gthr-posix.c
gthr-posix.h
gthr-rtems.h
gthr-single.h
gthr-solaris.h
gthr-tpf.h
gthr-vxworks.h
gthr-win32.h
gthr.h
haifa-sched.c sel-sched.c (create_speculation_check): Remove set but not used variable twin. 2010-01-20 12:30:05 +01:00
hard-reg-set.h
highlev-plugin-common.h
hooks.c
hooks.h
host-default.c
hosthooks-def.h
hosthooks.h
hwint.h
ifcvt.c re PR rtl-optimization/42511 (bootstrap error in stage3 on alpha-linux-gnu) 2010-01-07 14:02:34 +01:00
incpath.c
incpath.h
init-regs.c
input.h
insn-addr.h
insn-notes.def
integrate.c
integrate.h
intl.c
intl.h
ipa-cp.c re PR tree-optimization/42366 (ICE in ipa_write_node_info, at ipa-prop.c:2023) 2010-01-04 19:18:54 +01:00
ipa-inline.c re PR middle-end/37448 (cannot compile big function) 2010-01-29 11:26:27 +00:00
ipa-prop.c re PR tree-optimization/42366 (ICE in ipa_write_node_info, at ipa-prop.c:2023) 2010-01-04 19:18:54 +01:00
ipa-prop.h
ipa-pure-const.c
ipa-reference.c
ipa-reference.h
ipa-struct-reorg.c
ipa-struct-reorg.h
ipa-type-escape.c re PR tree-optimization/42250 (segfault in ipa-type-escape.c for several cpu2000 tests) 2010-01-26 12:29:09 +00:00
ipa-type-escape.h
ipa-utils.c
ipa-utils.h
ipa.c
ira-build.c
ira-color.c
ira-conflicts.c
ira-costs.c
ira-emit.c
ira-int.h
ira-lives.c
ira.c
ira.h
jump.c
lambda-code.c
lambda-mat.c
lambda-trans.c
lambda.h
langhooks-def.h
langhooks.c
langhooks.h
LANGUAGES
lcm.c
libfuncs.h
libgcc2.c
libgcc2.h
libgcc-libsystem.ver re PR java/41991 (gcj segfaults on i686-apple-darwin9 and x86_64-apple-darwin9) 2010-02-02 09:18:08 +01:00
libgcc-std.ver
libgcov.c
limitx.h
limity.h
lists.c
longlong.h
loop-doloop.c
loop-init.c
loop-invariant.c
loop-iv.c
loop-unroll.c re PR debug/42630 ("-fcompare-debug failure (length)" with "-O1 -fvariable-expansion-in-unroller -funroll-loops") 2010-01-09 14:41:35 +00:00
loop-unswitch.c
lower-subreg.c
lto-cgraph.c
lto-compress.c
lto-compress.h
lto-opts.c
lto-section-in.c
lto-section-out.c
lto-streamer-in.c tree.h (TYPE_TRANSPARENT_UNION): Replace with ... 2010-01-21 00:49:35 -05:00
lto-streamer-out.c tree.h (TYPE_TRANSPARENT_UNION): Replace with ... 2010-01-21 00:49:35 -05:00
lto-streamer.c
lto-streamer.h
lto-symtab.c
lto-wpa-fixup.c
lto-wrapper.c Pass -dumpbase and -dumpdir to gcc for LTO 2010-01-03 09:03:38 -08:00
machmode.def
machmode.h
main.c
Makefile.in Makefile.in (tree-sra.o): Add $(EXPR_H) dependency. 2010-01-22 22:22:51 +00:00
matrix-reorg.c
mcf.c
mips-tdump.c gcc.c (process_command): Update copyright notice dates. 2010-01-09 01:00:42 +01:00
mips-tfile.c gcc.c (process_command): Update copyright notice dates. 2010-01-09 01:00:42 +01:00
mkconfig.sh
mkmap-flat.awk
mkmap-symver.awk
mode-classes.def
mode-switching.c
modulo-sched.c
omega.c
omega.h
omp-builtins.def
omp-low.c re PR fortran/42866 (ICE for REDUCTION with ALLOCATABLE array as variable on SECTIONS) 2010-01-26 10:47:45 +01:00
ONEWS
opt-functions.awk
opt-gather.awk
optabs.c
optabs.h
optc-gen.awk
opth-gen.awk
opts-common.c
opts.c invoke.texi: Fix name of sched1 dump. 2010-02-03 12:36:27 +00:00
opts.h
output.h
params.c
params.def
params.h
passes.c re PR middle-end/42678 (ICE with lto1 in expand_mult, at expmed.c:3253) 2010-01-13 10:07:47 +00:00
plugin.c
plugin.def
plugin.h
pointer-set.c
pointer-set.h
postreload-gcse.c postreload-gcse.c (insert_expr_in_table): Replace BLOCK_NUM with BLOCK_FOR_INSN. 2010-01-03 13:13:03 +00:00
postreload.c
predict.c
predict.def
predict.h
prefix.c
prefix.h
pretty-print.c
pretty-print.h
print-rtl.c re PR debug/42896 (Random debug generation differences, bootstrap fails) 2010-02-03 15:00:33 +00:00
print-tree.c tree.h (TYPE_TRANSPARENT_UNION): Replace with ... 2010-01-21 00:49:35 -05:00
profile.c
profile.h
read-rtl.c
README.Portability
real.c
real.h re PR bootstrap/41771 (Bootstrap with Sun Studio 12.1 fails) 2010-01-05 17:14:30 +00:00
recog.c
recog.h
reg-notes.def
reg-stack.c
regcprop.c
reginfo.c
regmove.c
regrename.c
regs.h
regstat.c
reload1.c
reload.c
reload.h
reorg.c
resource.c
resource.h
rtl-error.c
rtl.c
rtl.def
rtl.h
rtlanal.c
rtlhooks-def.h
rtlhooks.c
sbitmap.c
sbitmap.h
sched-deps.c re PR rtl-optimization/42941 (-fsched-pressure -fschedule-insns - valgrind warns about using uninitialized variable) 2010-02-03 19:01:31 +00:00
sched-ebb.c
sched-int.h postreload-gcse.c (insert_expr_in_table): Replace BLOCK_NUM with BLOCK_FOR_INSN. 2010-01-03 13:13:03 +00:00
sched-rgn.c
sched-vis.c
sdbout.c
sdbout.h
sel-sched-dump.c
sel-sched-dump.h
sel-sched-ir.c sel-sched.c: Add 2010 to copyright years. 2010-01-14 16:50:09 +03:00
sel-sched-ir.h sel-sched.c: Add 2010 to copyright years. 2010-01-14 16:50:09 +03:00
sel-sched.c sel-sched.c (create_speculation_check): Remove set but not used variable twin. 2010-01-20 12:30:05 +01:00
sel-sched.h
sese.c re PR tree-optimization/42681 (ICE: in build2_stat, at tree.c:3664 with "-O1 -fgraphite-identity") 2010-01-14 08:37:26 +00:00
sese.h re PR tree-optimization/42681 (ICE: in build2_stat, at tree.c:3664 with "-O1 -fgraphite-identity") 2010-01-14 08:37:26 +00:00
simplify-rtx.c Update Copyright years. 2010-01-12 10:49:51 +01:00
sparseset.c
sparseset.h
sreal.c
sreal.h
ssaexpand.h
stab.def
stack-ptr-mod.c
statistics.c
statistics.h
stmt.c
stor-layout.c
store-motion.c gcse.c (execute_rtl_cprop, [...]): Do not add the DF_NOTE problem. 2010-01-07 11:49:25 +00:00
stringpool.c
stub-objc.c
sync-builtins.def
system.h
target-def.h
target.h target.h (struct gcc_target): Change type of last argument to secondary_reload_info *. 2010-01-19 08:22:22 +00:00
targhooks.c
targhooks.h
timevar.c
timevar.def
timevar.h
tlink.c
toplev.c toplev.c (default_get_pch_validity): Rename argument to "sz". 2010-01-18 05:46:19 +00:00
toplev.h Pass -dumpbase and -dumpdir to gcc for LTO 2010-01-03 09:03:38 -08:00
tracer.c
tree-affine.c
tree-affine.h
tree-browser.c
tree-browser.def
tree-call-cdce.c
tree-cfg.c re PR tree-optimization/42927 (type mismatch in shift expression produces ice with -O3) 2010-02-03 11:13:17 +00:00
tree-cfgcleanup.c re PR middle-end/42883 (internal compiler error: in redirect_eh_edge_1, at tree-eh.c:2112) 2010-01-28 14:40:59 +00:00
tree-chrec.c
tree-chrec.h
tree-complex.c re PR middle-end/42678 (ICE with lto1 in expand_mult, at expmed.c:3253) 2010-01-13 10:07:47 +00:00
tree-data-ref.c re PR tree-optimization/41783 (r151561 (PRE fix) regresses zeusmp) 2010-01-19 16:05:57 +00:00
tree-data-ref.h
tree-dfa.c
tree-dump.c
tree-dump.h
tree-eh.c re PR tree-optimization/42806 ("-fcompare-debug failure (length)" at -O1 in recent builds) 2010-01-26 15:09:43 +00:00
tree-flow-inline.h gimple.h (gss_for_code): Wrap gcc_assert in ENABLE_CHECKING. 2010-01-07 16:14:02 +00:00
tree-flow.h gimple.h (gss_for_code): Wrap gcc_assert in ENABLE_CHECKING. 2010-01-07 16:14:02 +00:00
tree-if-conv.c
tree-inline.c re PR tree-optimization/42878 ("-fcompare-debug failure" at -O1 (2)) 2010-01-27 16:00:31 +00:00
tree-inline.h
tree-into-ssa.c tree-into-ssa.c (maybe_register_def): If stmt ends the bb, insert the debug stmt on the single non-EH edge from the stmt. 2010-01-22 20:20:51 +01:00
tree-iterator.c
tree-iterator.h
tree-loop-distribution.c tree-loop-distribution.c (distribute_loop): Fix declaration and initialization of variable res to agree with return type. 2010-01-23 12:21:15 +00:00
tree-loop-linear.c
tree-mudflap.c
tree-mudflap.h
tree-nested.c
tree-nomudflap.c
tree-nrv.c
tree-object-size.c
tree-optimize.c
tree-outof-ssa.c re PR tree-optimization/42719 ("-fcompare-debug failure" with "-O2 -ftracer") 2010-01-19 13:39:42 +01:00
tree-parloops.c 28-01-2010 Razya Ladelsky <razya@il.ibm.com> 2010-01-28 14:24:25 +00:00
tree-pass.h re PR middle-end/42678 (ICE with lto1 in expand_mult, at expmed.c:3253) 2010-01-13 10:07:47 +00:00
tree-phinodes.c
tree-predcom.c tree-predcom.c (combine_chains): Return NULL, not false. 2010-01-23 14:33:26 +00:00
tree-pretty-print.c
tree-profile.c
tree-scalar-evolution.c re PR tree-optimization/42732 ([graphite] ICE: verify_ssa failed) 2010-01-14 07:38:15 +00:00
tree-scalar-evolution.h re PR tree-optimization/42732 ([graphite] ICE: verify_ssa failed) 2010-01-14 07:38:15 +00:00
tree-sra.c tree-sra.c (ptr_parm_has_direct_uses): Rewrite to be conservatively correct. 2010-01-31 19:54:32 +00:00
tree-ssa-address.c
tree-ssa-alias.c re PR tree-optimization/42944 (errno misoptimization around malloc call) 2010-02-03 13:03:39 +00:00
tree-ssa-alias.h
tree-ssa-ccp.c tree-ssa-ccp.c (ccp_fold_stmt): Unshare values we substitute. 2010-01-29 12:19:36 +00:00
tree-ssa-coalesce.c tree-ssa-sccvn.c (get_or_alloc_constant_value_id): Allocate a new entry only if needed. 2010-01-04 21:02:42 +00:00
tree-ssa-copy.c
tree-ssa-copyrename.c
tree-ssa-dce.c re PR tree-optimization/42717 (ice: verify_ssa failed) 2010-01-20 12:30:15 +00:00
tree-ssa-dom.c tree-ssa-sccvn.c (get_or_alloc_constant_value_id): Allocate a new entry only if needed. 2010-01-04 21:02:42 +00:00
tree-ssa-dse.c
tree-ssa-forwprop.c
tree-ssa-ifcombine.c
tree-ssa-live.c
tree-ssa-live.h
tree-ssa-loop-ch.c
tree-ssa-loop-im.c tree-ssa-loop-im.c (gen_lsm_tmp_name): Fix bogus fallthru. 2010-01-15 10:34:24 +00:00
tree-ssa-loop-ivcanon.c
tree-ssa-loop-ivopts.c
tree-ssa-loop-manip.c
tree-ssa-loop-niter.c
tree-ssa-loop-prefetch.c
tree-ssa-loop-unswitch.c
tree-ssa-loop.c
tree-ssa-math-opts.c re PR rtl-optimization/42589 (bswap optimization does not work for 32bit (but for 64bit) on 64bit registers) 2010-01-03 15:23:29 +00:00
tree-ssa-operands.c
tree-ssa-operands.h
tree-ssa-phiopt.c
tree-ssa-phiprop.c
tree-ssa-pre.c re PR tree-optimization/42871 (g++: Internal error: Segmentation fault (program cc1plus)) 2010-01-28 14:45:09 +00:00
tree-ssa-propagate.c
tree-ssa-propagate.h
tree-ssa-reassoc.c re PR tree-optimization/42705 (verify_flow_info failed with -O) 2010-01-13 15:04:38 +00:00
tree-ssa-sccvn.c tree-ssa-sccvn.c (get_or_alloc_constant_value_id): Allocate a new entry only if needed. 2010-01-04 21:02:42 +00:00
tree-ssa-sccvn.h
tree-ssa-sink.c
tree-ssa-structalias.c re PR tree-optimization/42781 (ICE in pt_solutions_same_restrict_base, at tree-ssa-structalias.c:5072) 2010-01-18 09:57:11 +00:00
tree-ssa-ter.c
tree-ssa-threadedge.c
tree-ssa-threadupdate.c
tree-ssa-uncprop.c tree-ssa-uncprop.c (uncprop_into_successor_phis): Fix PHI node existence check. 2010-01-17 16:22:17 +00:00
tree-ssa.c
tree-ssanames.c
tree-stdarg.c
tree-stdarg.h
tree-switch-conversion.c
tree-tailcall.c
tree-vect-data-refs.c re PR tree-optimization/41783 (r151561 (PRE fix) regresses zeusmp) 2010-01-19 16:05:57 +00:00
tree-vect-generic.c
tree-vect-loop-manip.c re PR tree-optimization/41783 (r151561 (PRE fix) regresses zeusmp) 2010-01-19 16:05:57 +00:00
tree-vect-loop.c tree-ssa-uncprop.c (uncprop_into_successor_phis): Fix PHI node existence check. 2010-01-17 16:22:17 +00:00
tree-vect-patterns.c
tree-vect-slp.c re PR tree-optimization/42709 (error: type mismatch in pointer plus expression) 2010-01-14 07:49:39 +00:00
tree-vect-stmts.c
tree-vectorizer.c
tree-vectorizer.h
tree-vrp.c
tree.c tree.h (TYPE_TRANSPARENT_UNION): Replace with ... 2010-01-21 00:49:35 -05:00
tree.def * tree.def (PLACEHOLDER_EXPR): Fix comment. 2010-01-20 09:47:41 +00:00
tree.h tree.h (TYPE_TRANSPARENT_UNION): Replace with ... 2010-01-21 00:49:35 -05:00
treestruct.def
tsystem.h
typeclass.h
unwind-c.c
unwind-compat.c
unwind-compat.h
unwind-dw2-fde-compat.c
unwind-dw2-fde-darwin.c re PR java/41991 (gcj segfaults on i686-apple-darwin9 and x86_64-apple-darwin9) 2010-02-02 09:18:08 +01:00
unwind-dw2-fde-glibc.c
unwind-dw2-fde.c
unwind-dw2-fde.h
unwind-dw2.c dwarf2out.c (mem_loc_descriptor): Use DW_OP_mod for UMOD instead of MOD... 2010-01-20 09:13:50 +01:00
unwind-dw2.h
unwind-generic.h
unwind-pe.h
unwind-sjlj.c
unwind.inc
value-prof.c
value-prof.h
var-tracking.c re PR debug/42896 (Random debug generation differences, bootstrap fails) 2010-02-03 15:00:33 +00:00
varasm.c re PR middle-end/42803 (c++ compilation hang) 2010-01-20 12:08:24 +01:00
varpool.c
varray.c
varray.h
vec.c
vec.h Update copyright notices of my recent commits. 2010-01-09 14:46:25 +00:00
vecprim.h
version.c
version.h
vmsdbg.h
vmsdbgout.c
web.c re PR tree-optimization/42685 ("-fcompare-debug failure" with "-O1 -funroll-loops" (2)) 2010-01-26 16:27:34 +00:00
xcoff.h
xcoffout.c
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.