gcc/gcc
Andrew MacLeod 60ffe2fe5e re PR middle-end/37567 (tree SSA to normal checking takes abnormally long time)
PR middle-end/37567
	* tree-ssa-ter.c (free_temp_expr_table): Make sure fields are actually
	empty before freeing them.
	(find_replaceable_exprs): Move asserts to free_temp_expr_table.


Co-Authored-By: Jan Hubicka <jh@suse.cz>

From-SVN: r140494
2008-09-19 17:37:13 +00:00
..
ada utils.c (create_subprog_decl): Use DECL_DECLARED_INLINE_P. 2008-09-18 20:08:13 +00:00
config configure.ac: Add HAVE_AS_TLS check for Xtensa. 2008-09-19 00:18:42 +00:00
cp re PR c++/22374 (C++ front-end produces mis-match types in MODIFY_EXPR (dynamic_cast)) 2008-09-17 19:07:27 +00:00
doc cpplib.h (struct cpp_options): Add new boolean flag warn_builtin_macro_redefined. 2008-09-18 15:39:08 +00:00
fortran re PR fortran/35945 (Complex module-based overloading fails) 2008-09-18 20:21:03 +00:00
ginclude float.h (DEC_EVAL_METHOD): Correct the macro name. 2008-09-11 22:50:51 +00:00
java re PR objc/37460 (NeXT runtime ICEs) 2008-09-17 14:39:13 -07:00
objc re PR objc/37460 (NeXT runtime ICEs) 2008-09-17 14:39:13 -07:00
objcp re PR objc/37460 (NeXT runtime ICEs) 2008-09-17 14:39:13 -07:00
po
testsuite pr11832.c: xfail on xtensa*-*-*. 2008-09-19 00:16:04 +00:00
ABOUT-GCC-NLS
acinclude.m4
aclocal.m4
addresses.h
alias.c re PR middle-end/37385 (ICE in set_mem_alias_set with the vectorizer and function pointers) 2008-09-17 11:42:11 +00:00
alias.h
alloc-pool.c
alloc-pool.h
attribs.c
auto-inc-dec.c
BASE-VER
basic-block.h
bb-reorder.c
bitmap.c
bitmap.h
bt-load.c
builtin-attrs.def
builtin-types.def
builtins.c
builtins.def
c-aux-info.c
c-common.c c-common.c (c_expand_decl): Remove. 2008-09-09 08:56:58 +00:00
c-common.def
c-common.h c-common.c (c_expand_decl): Remove. 2008-09-09 08:56:58 +00:00
c-config-lang.in
c-convert.c
c-cppbuiltin.c
c-decl.c c-common.c (c_expand_decl): Remove. 2008-09-09 08:56:58 +00:00
c-dump.c
c-errors.c
c-format.c
c-format.h
c-gimplify.c
c-lang.c
c-lex.c
c-objc-common.c
c-objc-common.h c-common.c (c_expand_decl): Remove. 2008-09-09 08:56:58 +00:00
c-omp.c
c-opts.c cpplib.h (struct cpp_options): Add new boolean flag warn_builtin_macro_redefined. 2008-09-18 15:39:08 +00:00
c-parser.c function.h (struct function): Add function_start_locus. 2008-09-09 10:56:23 +00:00
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
c.opt cpplib.h (struct cpp_options): Add new boolean flag warn_builtin_macro_redefined. 2008-09-18 15:39:08 +00:00
caller-save.c re PR rtl-optimization/37435 (ICE with volatiles) 2008-09-09 16:58:57 -07:00
calls.c
cfg.c
cfganal.c
cfgbuild.c
cfgcleanup.c
cfgexpand.c re PR debug/34037 (Bounds for VLAs not emitted into debuginfo) 2008-09-18 17:17:10 +02:00
cfghooks.c
cfghooks.h
cfglayout.c function.c (free_after_compilation): Call insn_locators_free. 2008-09-11 12:31:40 +00:00
cfglayout.h
cfgloop.c
cfgloop.h
cfgloopanal.c
cfgloopmanip.c
cfgrtl.c
cgraph.c cgraph.c: Include value-prof.h 2008-09-13 22:32:57 +00:00
cgraph.h ipa-prop.h (struct ipa_param_flags): Removed. 2008-09-11 19:03:23 +02:00
cgraphbuild.c
cgraphunit.c
ChangeLog re PR middle-end/37567 (tree SSA to normal checking takes abnormally long time) 2008-09-19 17:37:13 +00:00
ChangeLog-1997
ChangeLog-1998
ChangeLog-1999
ChangeLog-2000
ChangeLog-2001
ChangeLog-2002
ChangeLog-2003
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog.dataflow
ChangeLog.lib
ChangeLog.ptr
ChangeLog.tree-ssa
ChangeLog.tuples
collect2.c
collect2.h
combine-stack-adj.c
combine.c
common.opt invoke.texi (-fconserve-stack): Document. 2008-09-14 17:05:39 +00:00
conditions.h
config.build
config.gcc
config.host config.host: Add x-aix to host_xmake_file. 2008-09-14 09:55:29 -04:00
config.in
configure configure.ac: Add HAVE_AS_TLS check for Xtensa. 2008-09-19 00:18:42 +00:00
configure.ac configure.ac: Add HAVE_AS_TLS check for Xtensa. 2008-09-19 00:18:42 +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/37489 (const_true_rtx returned for float compare) 2008-09-13 08:47:41 -07:00
cselib.c
cselib.h
cstamp-h.in
DATESTAMP Daily bump. 2008-09-19 00:16:37 +00:00
dbgcnt.c
dbgcnt.def
dbgcnt.h
dbxout.c
dbxout.h
dce.c ggc-common.c (loc_array): Make static. 2008-09-11 12:48:53 +00:00
dce.h
ddg.c
ddg.h
debug.c
debug.h
defaults.h
DEV-PHASE
df-byte-scan.c
df-core.c
df-problems.c
df-scan.c
df.h
dfp.c
dfp.h
diagnostic.c
diagnostic.def
diagnostic.h
dojump.c dojump.c (do_jump): Move below. 2008-09-11 14:45:05 +00:00
dominance.c
domwalk.c
domwalk.h
double-int.c
double-int.h
dse.c re PR target/37382 (ICE in extract_insn: <var_decl 0x7fda26ff4b40 swig_module>) 0)) 2008-09-11 09:33:23 +02:00
dse.h
dummy-checksum.c
dwarf2.h
dwarf2asm.c re PR other/37265 (mt_allocator.cc:646: ICE: in gt_ggc_m_S, at ggc-page.c:1281) 2008-09-09 23:57:41 +00:00
dwarf2asm.h
dwarf2out.c re PR bootstrap/37441 (dwarf2 unwind info patches produce undefined symbols) 2008-09-17 12:26:43 +00:00
dwarf2out.h
dwarf.h
ebitmap.c
ebitmap.h
emit-rtl.c emit-rtl.c (set_reg_attrs_from_value): Fix invalid alignment information passed to mark_reg_pointer. 2008-09-12 13:31:51 +00:00
emit-rtl.h
emutls.c
errors.c
errors.h
et-forest.c
et-forest.h
except.c
except.h
exec-tool.in
explow.c emit-rtl.c (set_reg_attrs_from_value): Fix invalid alignment information passed to mark_reg_pointer. 2008-09-12 13:31:51 +00:00
expmed.c re PR target/37382 (ICE in extract_insn: <var_decl 0x7fda26ff4b40 swig_module>) 0)) 2008-09-11 09:33:23 +02:00
expr.c expr.c (emit_group_store): Do not shift before moving via a stack slot. 2008-09-18 02:09:40 +01:00
expr.h
final.c
fix-header.c
fixed-value.c
fixed-value.h
fixproto
flags.h
fold-const.c tree-vectorizer.c (slpeel_add_loop_guard): Fix types. 2008-09-11 14:53:20 +00:00
fp-test.c
FSFChangeLog
FSFChangeLog.10
FSFChangeLog.11
function.c re PR debug/34037 (Bounds for VLAs not emitted into debuginfo) 2008-09-18 17:17:10 +02:00
function.h cgraph.c (cgraph_release_function_body): Plug memory leak on ipa_transforms_to_apply and CFG... 2008-09-11 12:41:36 +00:00
fwprop.c
gbl-ctors.h
gcc.c
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
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-common.c (loc_array): Make static. 2008-09-11 12:48:53 +00:00
ggc-none.c
ggc-page.c
ggc-zone.c
ggc.h
gimple-iterator.c
gimple-low.c
gimple-pretty-print.c
gimple.c
gimple.def
gimple.h
gimplify.c re PR debug/34037 (Bounds for VLAs not emitted into debuginfo) 2008-09-18 17:17:10 +02:00
glimits.h
global.c
graph.c
graph.h
graphds.c
graphds.h
graphite.c re PR middle-end/37484 ([graphite] Valgrind gives invalid reads/writes on CPU2006 403.gcc benchmark) 2008-09-12 23:03:54 +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 haifa-sched.c (dep_cost_1): Recognize the producer even if the consumer is an asm. 2008-09-18 05:24:57 +00:00
hard-reg-set.h
hooks.c
hooks.h
host-default.c
hosthooks-def.h
hosthooks.h
hwint.h
ifcvt.c re PR rtl-optimization/37483 (Segfault in noce_try_sign_mask (ifcvt.c): b_unconditional) 2008-09-16 22:15:49 +00: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 ipa-cp.c (ipcp_estimate_growth): Return 0 instead of false. 2008-09-18 19:57:05 +02:00
ipa-inline.c ipa-prop.h (struct ipa_param_flags): Removed. 2008-09-11 19:03:23 +02:00
ipa-prop.c ipa-cp.c (ipcp_estimate_growth): Return 0 instead of false. 2008-09-18 19:57:05 +02:00
ipa-prop.h ipa-cp.c (ipcp_estimate_growth): Return 0 instead of false. 2008-09-18 19:57:05 +02:00
ipa-pure-const.c re PR middle-end/37448 (cannot compile big function) 2008-09-18 17:28:40 +00:00
ipa-reference.c re PR middle-end/37448 (cannot compile big function) 2008-09-18 17:28:40 +00:00
ipa-reference.h re PR middle-end/37448 (cannot compile big function) 2008-09-18 17:28:40 +00:00
ipa-struct-reorg.c
ipa-struct-reorg.h
ipa-type-escape.c
ipa-type-escape.h
ipa-utils.c re PR middle-end/37448 (cannot compile big function) 2008-09-18 17:28:40 +00:00
ipa-utils.h
ipa.c
ira-build.c re PR rtl-optimization/37377 (Bootstrap failure compiling libgcc) 2008-09-12 22:55:23 +00:00
ira-color.c ira-color.c (finish_cost_update): Free update_cost_queue_elems rather than update_cost_queue. 2008-09-15 23:57:17 +02:00
ira-conflicts.c ira-conflicts.c (process_regs_for_copy): Check that the hard regno is in the right range. 2008-09-09 16:52:55 +00:00
ira-costs.c
ira-emit.c re PR rtl-optimization/37377 (Bootstrap failure compiling libgcc) 2008-09-12 22:55:23 +00:00
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 re PR objc/37460 (NeXT runtime ICEs) 2008-09-17 14:39:13 -07:00
langhooks.c c-common.c (c_expand_decl): Remove. 2008-09-09 08:56:58 +00:00
langhooks.h re PR objc/37460 (NeXT runtime ICEs) 2008-09-17 14:39:13 -07:00
LANGUAGES
lcm.c
libfuncs.h
libgcc2.c
libgcc2.h
libgcc-std.ver
libgcov.c
limitx.h
limity.h
lists.c
local-alloc.c
longlong.h
loop-doloop.c re PR rtl-optimization/37451 (Extra addition for doloop in some cases) 2008-09-18 12:28:48 -07:00
loop-init.c
loop-invariant.c
loop-iv.c
loop-unroll.c
loop-unswitch.c
lower-subreg.c
machmode.def
machmode.h
main.c
Makefile.in cgraph.c: Include value-prof.h 2008-09-13 22:32:57 +00:00
matrix-reorg.c
mcf.c
mips-tdump.c Makefile.in (mips-tfile.o-warn): Don't error out on mips-tfile.c warnings. 2008-09-09 16:36:14 +00:00
mips-tfile.c Makefile.in (mips-tfile.o-warn): Don't error out on mips-tfile.c warnings. 2008-09-09 16:36:14 +00: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
ONEWS
opt-functions.awk
opt-gather.awk
optabs.c
optabs.h
optc-gen.awk
opth-gen.awk
opts-common.c
opts.c invoke.texi (-fconserve-stack): Document. 2008-09-14 17:05:39 +00:00
opts.h
output.h
params.c
params.def
params.h
passes.c re PR tree-optimization/14703 (Inadequate optimization of inline templated functions, infinite loop in ipa-reference and memory hog) 2008-09-06 17:10:00 +00:00
pointer-set.c
pointer-set.h
postreload-gcse.c
postreload.c
predict.c re PR middle-end/37414 (ICE with -ffast-math) 2008-09-08 23:30:23 +02:00
predict.def
predict.h
prefix.c
prefix.h
pretty-print.c
pretty-print.h
print-rtl.c
print-tree.c
profile.c profile.c (is_edge_inconsistent): Add debug output; ignore negative count on fake edges. 2008-09-09 15:28:19 +00:00
profile.h
protoize.c
ra-conflict.c
ra.h
read-rtl.c
README.Portability
real.c
real.h
recog.c
recog.h
reg-notes.def
reg-stack.c
regclass.c
regmove.c
regrename.c re PR rtl-optimization/37544 (Conversion double -> unsigned long long -> unsigned -> double gives wrong results) 2008-09-18 12:17:42 +02:00
regs.h
regstat.c
reload1.c reload1.c (alter_reg): Undo the BYTE_BIG_ENDIAN correction performed by assign_stack_local on the IRA... 2008-09-11 11:17:57 -06:00
reload.c
reload.h
reorg.c
resource.c
resource.h
rtl-error.c
rtl-factoring.c
rtl.c
rtl.def
rtl.h function.c (free_after_compilation): Call insn_locators_free. 2008-09-11 12:31:40 +00:00
rtlanal.c
rtlhooks-def.h
rtlhooks.c
sbitmap.c
sbitmap.h
scan-decls.c
scan-types.sh
scan.c
scan.h
sched-deps.c value-prof.c (gimple_ic): Fix tuplification bug. 2008-09-10 11:37:18 +00:00
sched-ebb.c
sched-int.h re PR middle-end/37499 (Scheduling pass 2 time increases by order of magnitude) 2008-09-18 12:29:48 +04:00
sched-rgn.c re PR middle-end/37499 (Scheduling pass 2 time increases by order of magnitude) 2008-09-18 12:29:48 +04:00
sched-vis.c
sdbout.c
sdbout.h
see.c
sel-sched-dump.c
sel-sched-dump.h
sel-sched-ir.c
sel-sched-ir.h
sel-sched.c
sel-sched.h
simplify-rtx.c
sort-protos
sparseset.c
sparseset.h
sreal.c
sreal.h
stab.def
stack-ptr-mod.c
statistics.c
statistics.h
stmt.c cgraph.c (cgraph_release_function_body): Plug memory leak on ipa_transforms_to_apply and CFG... 2008-09-11 12:41:36 +00:00
stor-layout.c
stringpool.c
stub-objc.c
sync-builtins.def
sys-protos.h
sys-types.h
system.h
target-def.h
target.h
targhooks.c
targhooks.h
timevar.c
timevar.def
timevar.h
tlink.c
toplev.c toplev.c (dump_memory_report): Call dump_vec_loc_statistics. 2008-09-11 12:17:22 +00:00
toplev.h
tracer.c
tree-affine.c
tree-affine.h
tree-browser.c
tree-browser.def
tree-call-cdce.c * tree-call-cdce.c (check_target_format): Accept Motorola formats. 2008-09-14 17:58:14 +00:00
tree-cfg.c re PR middle-end/37284 (ICE on valid code with -fstrict-aliasing) 2008-09-18 12:52:31 +00:00
tree-cfgcleanup.c
tree-chrec.c
tree-chrec.h
tree-complex.c
tree-data-ref.c tree-predcom.c (filter_suitable_components): Free all refs in act->refs vector before calling release_component. 2008-09-15 23:55:05 +02:00
tree-data-ref.h
tree-dfa.c
tree-dump.c
tree-dump.h
tree-eh.c
tree-flow-inline.h
tree-flow.h re PR middle-end/37448 (cannot compile big function) 2008-09-18 18:16:45 +00:00
tree-if-conv.c
tree-inline.c re PR middle-end/18071 (-Winline does not respect -fno-default-inline) 2008-09-17 15:00:59 +00:00
tree-inline.h
tree-into-ssa.c
tree-iterator.c
tree-iterator.h
tree-loop-distribution.c
tree-loop-linear.c tree-predcom.c (filter_suitable_components): Free all refs in act->refs vector before calling release_component. 2008-09-15 23:55:05 +02:00
tree-mudflap.c re PR libmudflap/36397 (ICE with pointer cast and -fmudflap) 2008-09-15 23:52:53 +02:00
tree-mudflap.h
tree-nested.c re PR middle-end/30141 (nested function can produce invalid gimple) 2008-09-13 16:29:22 +00:00
tree-nomudflap.c
tree-nrv.c
tree-object-size.c
tree-optimize.c
tree-outof-ssa.c Fix comments and formatrting 2008-09-18 14:13:54 +00:00
tree-parloops.c
tree-pass.h
tree-phinodes.c
tree-predcom.c tree-predcom.c (filter_suitable_components): Free all refs in act->refs vector before calling release_component. 2008-09-15 23:55:05 +02:00
tree-pretty-print.c
tree-profile.c re PR middle-end/32581 (make profiledbootstrap - stageprofile - gcc/ada/a-except.adb:1301: error: control flow in the middle of basic block 20) 2008-09-13 21:39:44 +00:00
tree-scalar-evolution.c tree-scalar-evolution.c (set_instantiated_value): Set instantiated_below. 2008-09-12 23:02:24 +00:00
tree-scalar-evolution.h re PR middle-end/37375 ([graphite] Parameter detection and scev only take a surrounding loop as border) 2008-09-09 18:39:45 +00:00
tree-sra.c re PR middle-end/37380 (../../gcc/libcpp/charset.c:1103: error: 'cvt.77.width' is used uninitialized in this function) 2008-09-16 12:34:01 +00:00
tree-ssa-address.c
tree-ssa-alias-warnings.c
tree-ssa-alias.c tree-ssa-alias.c (init_alias_info): Call bitmap_obstack_release in every call starting with the second one... 2008-09-15 23:56:35 +02:00
tree-ssa-ccp.c re PR tree-optimization/37433 (tree check: expected function_decl, have string_cst in ccp_fold, at tree-ssa-ccp.c:1050) 2008-09-09 10:06:54 +00:00
tree-ssa-coalesce.c
tree-ssa-copy.c
tree-ssa-copyrename.c
tree-ssa-dce.c
tree-ssa-dom.c re PR middle-end/37337 (ICE: verify_flow_info failed) 2008-09-08 21:31:18 +02:00
tree-ssa-dse.c
tree-ssa-forwprop.c tree-vectorizer.c (slpeel_add_loop_guard): Fix types. 2008-09-11 14:53:20 +00:00
tree-ssa-ifcombine.c re PR tree-optimization/37387 (ICE in extract_range_from_binary_expr, at tree-vrp.c:2145) 2008-09-09 10:05:49 +00:00
tree-ssa-live.c re PR tree-optimization/14703 (Inadequate optimization of inline templated functions, infinite loop in ipa-reference and memory hog) 2008-09-06 17:10:00 +00:00
tree-ssa-live.h
tree-ssa-loop-ch.c
tree-ssa-loop-im.c
tree-ssa-loop-ivcanon.c
tree-ssa-loop-ivopts.c re PR rtl-optimization/37263 (extra code for doloop with unsigned 32bit types on LP64) 2008-09-16 09:21:35 -07:00
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
tree-ssa-operands.c re PR middle-end/37448 (cannot compile big function) 2008-09-18 17:28:40 +00:00
tree-ssa-operands.h
tree-ssa-phiopt.c
tree-ssa-phiprop.c tree-ssa-uncprop.c (associate_equivalences_with_edges): Avoid entering the weaker equivalence recording. 2008-09-11 21:48:11 +00:00
tree-ssa-pre.c * tree-ssa-pre.c (phi_translate_1): Fix memory leak 2008-09-11 12:36:53 +00:00
tree-ssa-propagate.c dojump.c (do_jump): Move below. 2008-09-11 14:45:05 +00:00
tree-ssa-propagate.h
tree-ssa-reassoc.c re PR middle-end/37456 (ICE: verify_flow_info failed: control flow in the middle of basic block) 2008-09-18 11:28:18 +00:00
tree-ssa-sccvn.c re PR tree-optimization/37258 (ice in simplify_subreg, at simplify-rtx.c:4957) 2008-09-18 15:27:21 +00:00
tree-ssa-sccvn.h
tree-ssa-sink.c
tree-ssa-structalias.c
tree-ssa-structalias.h
tree-ssa-ter.c re PR middle-end/37567 (tree SSA to normal checking takes abnormally long time) 2008-09-19 17:37:13 +00:00
tree-ssa-threadedge.c
tree-ssa-threadupdate.c
tree-ssa-uncprop.c tree-ssa-uncprop.c (associate_equivalences_with_edges): Avoid entering the weaker equivalence recording. 2008-09-11 21:48:11 +00:00
tree-ssa.c tree-ssa.c (redirect_edge_var_map_clear): Fix formatting. 2008-09-11 12:36:05 +00:00
tree-ssanames.c
tree-stdarg.c
tree-stdarg.h
tree-switch-conversion.c
tree-tailcall.c
tree-vect-analyze.c re PR tree-optimization/37474 (vect_supported_slp_permutation_p memory corruption) 2008-09-11 12:08:01 +00:00
tree-vect-generic.c
tree-vect-patterns.c
tree-vect-transform.c re PR middle-end/37385 (ICE in set_mem_alias_set with the vectorizer and function pointers) 2008-09-17 11:42:11 +00:00
tree-vectorizer.c tree-vectorizer.c (slpeel_add_loop_guard): Fix types. 2008-09-11 14:53:20 +00:00
tree-vectorizer.h
tree-vrp.c re PR tree-optimization/37508 (ICE in in simplify_truth_ops_using_ranges, at tree-vrp.c:6334) 2008-09-16 12:31:51 +00:00
tree.c re PR objc/37460 (NeXT runtime ICEs) 2008-09-17 14:39:13 -07:00
tree.def tree-cfg.c (verify_types_in_gimple_assign): Rename to ... 2008-09-17 21:42:55 +00:00
tree.h re PR middle-end/18071 (-Winline does not respect -fno-default-inline) 2008-09-17 15:00:59 +00: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
unwind-dw2-fde-glibc.c
unwind-dw2-fde.c
unwind-dw2-fde.h
unwind-dw2.c
unwind-dw2.h
unwind-generic.h
unwind-pe.h
unwind-sjlj.c
unwind.inc
value-prof.c value-prof.c (gimple_ic): Fix tuplification bug. 2008-09-10 11:37:18 +00:00
value-prof.h
var-tracking.c
varasm.c varasm.c (initializer_constant_valid_p): Forbid view-conversions from aggregate to non-aggregate type if... 2008-09-17 21:48:08 +00:00
varpool.c
varray.c
varray.h
vec.c toplev.c (dump_memory_report): Call dump_vec_loc_statistics. 2008-09-11 12:17:22 +00:00
vec.h toplev.c (dump_memory_report): Call dump_vec_loc_statistics. 2008-09-11 12:17:22 +00:00
vecprim.h
version.c
version.h
vmsdbg.h
vmsdbgout.c
web.c
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.