gcc/gcc
Richard Guenther d53bed0b2c re PR tree-optimization/43783 (-O -ftree-pre options compile libbid wrong)
2010-04-19  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/43783
	* tree-ssa-pre.c (create_component_ref_by_pieces_1): Drop
	constant ARRAY_REF operands two and three if possible.

	* gcc.c-torture/execute/pr43783.c: New testcase.

From-SVN: r158517
2010-04-19 13:36:54 +00:00
..
ada fold-const.c (fold_comparison): Use ssizetype. 2010-04-18 21:49:29 +00:00
config re PR target/43766 (x86 prefetch doesn't use complex memory addressing) 2010-04-19 14:37:16 +02:00
cp re PR c++/43704 (ICE: tree check: accessed elt 2 of tree_vec with 1 elts in tsubst, at cp/pt.c:10074) 2010-04-19 11:32:16 +02:00
doc configure.ac: Check for elf_getshdrstrndx or elf_getshstrndx separately. 2010-04-16 13:45:25 +00:00
fortran fold-const.c (fold_comparison): Use ssizetype. 2010-04-18 21:49:29 +00:00
ginclude
java fold-const.c (fold_comparison): Use ssizetype. 2010-04-18 21:49:29 +00:00
lto fold-const.c (fold_comparison): Use ssizetype. 2010-04-18 21:49:29 +00:00
objc re PR c/18624 (GCC does not detect local variable set but never used) 2010-04-07 22:33:36 +02:00
objcp Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
po zh_CN.po: Update. 2010-04-19 11:12:53 +01:00
testsuite re PR tree-optimization/43783 (-O -ftree-pre options compile libbid wrong) 2010-04-19 13:36:54 +00:00
ABOUT-GCC-NLS
BASE-VER * BASE-VER: Change to 4.6.0. 2010-04-06 13:14:22 +02:00
COPYING
COPYING.LIB
COPYING3
COPYING3.LIB
ChangeLog re PR tree-optimization/43783 (-O -ftree-pre options compile libbid wrong) 2010-04-19 13:36:54 +00:00
ChangeLog-1997
ChangeLog-1998
ChangeLog-1999
ChangeLog-2000
ChangeLog-2001
ChangeLog-2002
ChangeLog-2003
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007 Fix nit 2010-03-26 09:51:32 +00:00
ChangeLog-2008
ChangeLog-2009
ChangeLog.dataflow
ChangeLog.graphite Fix 473.astar miscompile. 2010-04-06 21:03:37 +00:00
ChangeLog.lib
ChangeLog.ptr
ChangeLog.tree-ssa
ChangeLog.tuples
DATESTAMP Daily bump. 2010-04-19 00:17:30 +00:00
DEV-PHASE
FSFChangeLog
FSFChangeLog.10
FSFChangeLog.11
LANGUAGES
Makefile.in Makefile.in (OBJS-common): Add gimple-fold.o. 2010-04-15 12:58:05 +00:00
ONEWS
README.Portability
acinclude.m4
aclocal.m4 Update to Automake 1.11.1. 2010-04-02 18:18:06 +00:00
addresses.h
alias.c re PR bootstrap/43767 (Revision 158401 failed to bootstrap) 2010-04-16 23:43:36 +02:00
alias.h
alloc-pool.c
alloc-pool.h
attribs.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
auto-inc-dec.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
basic-block.h re PR rtl-optimization/21803 ([ia64] gcc produces really odd predicated code) 2010-04-14 20:42:02 +00:00
bb-reorder.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
bitmap.c
bitmap.h
bt-load.c
builtin-attrs.def
builtin-types.def
builtins.c PR 42694: Optimize pow (x, 0.25), pow (x, 0.75), pow (x, 1./6.) 2010-04-14 15:01:40 +00:00
builtins.def
c-aux-info.c
c-common.c re PR c++/36625 (bogus error on __attribute__((aligned(N))) in template code) 2010-04-14 16:17:34 -04:00
c-common.def
c-common.h re PR c++/36625 (bogus error on __attribute__((aligned(N))) in template code) 2010-04-14 16:17:34 -04:00
c-config-lang.in
c-convert.c
c-cppbuiltin.c
c-decl.c fold-const.c (fold_comparison): Use ssizetype. 2010-04-18 21:49:29 +00: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 diagnostic.h (diagnostic_override_option_index): New macro to set a diagnostic's option_index. 2010-04-07 17:18:10 +00:00
c-parser.c re PR c/18624 (GCC does not detect local variable set but never used) 2010-04-07 22:33:36 +02:00
c-pch.c Makefile.in (c-pch.o, [...]): Depend on timevar.h. 2010-04-13 09:30:31 -04:00
c-ppoutput.c
c-pragma.c
c-pragma.h
c-pretty-print.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
c-pretty-print.h
c-semantics.c
c-tree.h re PR c/18624 (GCC does not detect local variable set but never used) 2010-04-07 22:33:36 +02:00
c-typeck.c re PR bootstrap/43699 ("variable set but not used" error during bootstrap) 2010-04-12 15:27:07 +02:00
c.opt re PR c++/28584 (Cast to pointer from integer of different size) 2010-04-09 07:49:41 +00:00
caller-save.c re PR other/43562 (GCC ICE on optimize attribute) 2010-03-31 02:44:10 +00:00
calls.c tree.h (TREE_ADDRESSABLE): Document its effect for function types. 2010-04-08 20:16:36 +00:00
cfg.c
cfganal.c
cfgbuild.c
cfgcleanup.c re PR rtl-optimization/21803 ([ia64] gcc produces really odd predicated code) 2010-04-14 20:42:02 +00:00
cfgexpand.c tree-ssa-structalias.c (struct variable_info): Add is_fn_info flag. 2010-04-15 13:16:44 +00:00
cfghooks.c
cfghooks.h
cfglayout.c
cfglayout.h
cfgloop.c
cfgloop.h
cfgloopanal.c
cfgloopmanip.c
cfgrtl.c
cgraph.c cgraph.c (cgraph_add_function_insertion_hook): Update comment. 2010-04-01 17:33:32 +00:00
cgraph.h Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
cgraphbuild.c
cgraphunit.c re PR middle-end/43600 (Segmentation fault for large C file (24MB)) 2010-03-31 13:20:19 +00:00
cif-code.def
collect2-aix.c
collect2-aix.h
collect2.c
collect2.h Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
combine-stack-adj.c
combine.c re PR rtl-optimization/43438 (possible wrong code bug) 2010-03-20 13:44:18 +00:00
common.opt gcc.c (cc1_options): Handle -iplugindir before processing the cc1 spec. 2010-04-12 23:58:18 +00:00
conditions.h
config.build config.build (alpha*-dec-osf4*): Remove. 2010-04-12 18:36:30 +00:00
config.gcc config.gcc: Handle softfp as for Linux. 2010-04-15 15:29:07 +02:00
config.host
config.in configure.ac: Check for elf_getshdrstrndx or elf_getshstrndx separately. 2010-04-16 13:45:25 +00:00
configure configure.ac: Check for elf_getshdrstrndx or elf_getshstrndx separately. 2010-04-16 13:45:25 +00:00
configure.ac configure.ac: Check for elf_getshdrstrndx or elf_getshstrndx separately. 2010-04-16 13:45:25 +00:00
convert.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
convert.h
coretypes.h
coverage.c
coverage.h
cppdefault.c
cppdefault.h
cppspec.c
crtstuff.c
cse.c
cselib.c re PR bootstrap/43596 (Failed to boostrap) 2010-03-31 17:26:57 +02:00
cselib.h re PR debug/42977 ("-fcompare-debug failure" with "-O2 -finline-functions -fomit-frame-pointer -ftracer -fsched2-use-superblocks -fPIC") 2010-03-30 23:00:47 +02:00
cstamp-h.in
dbgcnt.c
dbgcnt.def
dbgcnt.h
dbxout.c
dbxout.h
dce.c
dce.h
ddg.c
ddg.h
debug.c
debug.h
defaults.h re PR target/38118 (gcc emits non-TLS data as TLS on Solaris 11/SPARC) 2010-03-24 18:49:49 +00:00
df-byte-scan.c
df-core.c df-core.c (df_ref_debug): Change format string placeholder from 0x%x to %#x. 2010-04-14 17:08:54 +02:00
df-problems.c
df-scan.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
df.h
dfp.c
dfp.h
diagnostic.c re PR other/42966 (add some indication that a warning has been converted to an error) 2010-04-14 16:08:23 +00:00
diagnostic.def
diagnostic.h re PR other/42965 (no "warnings being treated as errors" for individual -Werror=x options) 2010-04-09 15:45:52 +00:00
dojump.c
dominance.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
domwalk.c
domwalk.h
double-int.c double-int.h (tree_to_double_int): Convert to macro. 2010-04-16 21:31:00 +04:00
double-int.h double-int.h (tree_to_double_int): Convert to macro. 2010-04-16 21:31:00 +04:00
dse.c re PR debug/43051 (VTA causes a stack living parameter unavailable in most of the function) 2010-03-16 11:50:42 +01:00
dse.h
dummy-checksum.c
dwarf2asm.c df-core.c (df_ref_debug): Change format string placeholder from 0x%x to %#x. 2010-04-14 17:08:54 +02:00
dwarf2asm.h
dwarf2out.c tree.h (ENUM_IS_SCOPED): Define. 2010-04-19 09:48:46 +02:00
dwarf2out.h
ebitmap.c
ebitmap.h
emit-rtl.c invoke.texi (-fargument-alias, [...]): Remove. 2010-04-07 13:08:24 +00:00
emit-rtl.h
emutls.c
errors.c
errors.h
et-forest.c
et-forest.h
except.c Remove lang_eh_type_covers, which is dead, and the corresponding 2010-04-13 09:21:12 +00:00
except.h Remove lang_eh_type_covers, which is dead, and the corresponding 2010-04-13 09:21:12 +00:00
exec-tool.in
explow.c
expmed.c double-int.h (HOST_BITS_PER_DOUBLE_INT): Define. 2010-04-15 02:05:32 +04:00
expr.c expr.c (categorize_ctor_elements_1): Properly count sub-elements of non-constant aggregate elements. 2010-04-12 10:00:13 +00:00
expr.h
final.c re PR debug/43516 ("-fcompare-debug failure" at -O2) 2010-03-26 17:18:51 +01:00
fixed-value.c
fixed-value.h
flags.h re PR debug/43516 ("-fcompare-debug failure" at -O2) 2010-03-26 17:18:51 +01:00
fold-const.c fold-const.c (fold_comparison): Use ssizetype. 2010-04-18 21:49:29 +00:00
fp-test.c
function.c function.c (assign_parms_initialize_all): Add unused attribute to fntype. 2010-04-12 16:04:42 +00:00
function.h
fwprop.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
gbl-ctors.h
gcc-plugin.h gcc.c (cc1_options): Handle -iplugindir before processing the cc1 spec. 2010-04-12 23:58:18 +00:00
gcc.c gcc.c (main): Search for liblto_plugin.so with mode R_OK. 2010-04-18 17:44:42 +00:00
gcc.h re PR driver/42485 (-V switch broken) 2010-04-08 17:21:26 +00:00
gccbug.in
gccspec.c
gcov-dump.c
gcov-io.c
gcov-io.h
gcov-iov.c
gcov.c
gcse.c re PR debug/43051 (VTA causes a stack living parameter unavailable in most of the function) 2010-03-16 11:50:42 +01:00
gdbinit.in
genattr.c
genattrtab.c df-core.c (df_ref_debug): Change format string placeholder from 0x%x to %#x. 2010-04-14 17:08:54 +02:00
genautomata.c
gencheck.c
genchecksum.c
gencodes.c
genconditions.c
genconfig.c
genconstants.c
genemit.c tree-ssa-pre.c (my_rev_post_order_compute): Remove set but not used count variable. 2010-04-07 22:27:37 +02:00
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 recog.h (struct recog_data): New field is_operator. 2010-04-16 09:32:21 +00:00
genpeep.c
genpreds.c
genrecog.c
gensupport.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
gensupport.h
ggc-common.c Makefile.in (c-pch.o, [...]): Depend on timevar.h. 2010-04-13 09:30:31 -04:00
ggc-none.c
ggc-page.c
ggc-zone.c
ggc.h
gimple-fold.c fold-const.c (fold_comparison): Use ssizetype. 2010-04-18 21:49:29 +00:00
gimple-iterator.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
gimple-low.c
gimple-pretty-print.c gimple-pretty-print.c (dump_gimple_phi): Dump alias info. 2010-04-16 09:49:20 +00:00
gimple.c gimple.c (walk_gimple_op): Do not request a pure rvalue on the RHS if the LHS is of a non-renamable type. 2010-04-13 07:08:24 +00:00
gimple.def gsstruct.def (GSS_CALL): New. 2010-04-12 15:20:48 +00:00
gimple.h Makefile.in (OBJS-common): Add gimple-fold.o. 2010-04-15 12:58:05 +00:00
gimplify.c expr.c (categorize_ctor_elements_1): Properly count sub-elements of non-constant aggregate elements. 2010-04-12 10:00:13 +00:00
glimits.h
graph.c
graph.h
graphds.c
graphds.h
graphite-blocking.c
graphite-clast-to-gimple.c Fix 473.astar miscompile. 2010-04-06 21:03:37 +00:00
graphite-clast-to-gimple.h Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
graphite-dependences.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
graphite-dependences.h
graphite-interchange.c
graphite-poly.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
graphite-poly.h Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
graphite-ppl.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
graphite-ppl.h Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
graphite-scop-detection.c Avoid calling verify_ssa twice in verify_loop_closed_ssa. 2010-04-06 19:20:47 +00:00
graphite-scop-detection.h
graphite-sese-to-poly.c Compute min and max bounds for IVs and infer types. 2010-04-06 21:01:16 +00:00
graphite-sese-to-poly.h Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
graphite.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
graphite.h
gsstruct.def gsstruct.def (GSS_CALL): New. 2010-04-12 15:20:48 +00:00
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-posix.c
gthr-posix.h
gthr-posix95.h
gthr-rtems.h
gthr-single.h
gthr-solaris.h
gthr-tpf.h
gthr-vxworks.h
gthr-win32.h
gthr.h
haifa-sched.c
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/21803 ([ia64] gcc produces really odd predicated code) 2010-04-14 20:42:02 +00:00
incpath.c
incpath.h
init-regs.c
input.h
insn-addr.h
insn-notes.def
integrate.c
integrate.h
intl.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
intl.h Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
ipa-cp.c ipa-cp.c (ipcp_lats_are_equal): Return true also if the two lattices are addresses of CONST_DECLs with the same... 2010-04-09 22:24:11 +02:00
ipa-inline.c * ipa-inline.c (cgraph_early_inlining): Handle flattening too. 2010-04-17 23:42:04 +00:00
ipa-prop.c fold-const.c (fold_comparison): Use ssizetype. 2010-04-18 21:49:29 +00:00
ipa-prop.h Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
ipa-pure-const.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
ipa-reference.c ipa-reference.c (mark_load): Use get_base_address. 2010-04-07 15:31:37 +00:00
ipa-reference.h
ipa-struct-reorg.c re PR tree-optimization/43317 (ICE: Segmentation fault with -fipa-struct-reorg -g) 2010-03-15 13:05:05 +00:00
ipa-struct-reorg.h
ipa-type-escape.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
ipa-type-escape.h
ipa-utils.c
ipa-utils.h
ipa.c ipa.c (cgraph_postorder): Adjust postorder to guarantee single-iteration always-inline inlining. 2010-04-12 13:37:32 +00:00
ira-build.c
ira-color.c ira-color.c (ira_reassign_pseudos): Collect and sort all the pseudos needing assignment rather than doing a... 2010-04-16 19:30:35 -06:00
ira-conflicts.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
ira-costs.c ira-costs.c (record_reg_classes): Ignore alternatives that are not enabled. 2010-04-10 12:28:25 +00:00
ira-emit.c
ira-int.h
ira-lives.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
ira.c re PR other/43562 (GCC ICE on optimize attribute) 2010-03-31 02:44:10 +00:00
ira.h
jump.c
lambda-code.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
lambda-mat.c
lambda-trans.c
lambda.h
langhooks-def.h
langhooks.c
langhooks.h
lcm.c
libfuncs.h
libgcc-libsystem.ver
libgcc-std.ver re PR other/25232 (libgcc-std.ver should include __unordxf2 and __unordtf2) 2010-03-30 13:35:08 +01:00
libgcc2.c
libgcc2.h
libgcov.c
limitx.h
limity.h
lists.c
longlong.h s390.md: Replace TARGET_64BIT with TARGET_ZARCH. 2010-04-13 09:04:31 +00:00
loop-doloop.c
loop-init.c
loop-invariant.c loop-invariant.c (replace_uses): New static function. 2010-04-09 20:13:59 +00:00
loop-iv.c
loop-unroll.c Implement target hook for loop unrolling 2010-04-08 15:07:57 +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 gsstruct.def (GSS_CALL): New. 2010-04-12 15:20:48 +00:00
lto-streamer-out.c re PR c++/12909 (ambiguity in mangling vector types) 2010-03-03 14:02:08 -05:00
lto-streamer.c
lto-streamer.h Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
lto-symtab.c
lto-wpa-fixup.c
lto-wrapper.c
machmode.def
machmode.h
main.c
matrix-reorg.c
mcf.c
mips-tdump.c
mips-tfile.c
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 Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
opt-functions.awk opt-functions.awk (opt_sanitized_name): New. 2010-04-13 14:27:22 +00:00
opt-gather.awk
optabs.c optabs.c (avoid_expensive_constant): Fix formatting. 2010-03-19 19:45:01 +00:00
optabs.h
optc-gen.awk opt-functions.awk (opt_sanitized_name): New. 2010-04-13 14:27:22 +00:00
opth-gen.awk opt-functions.awk (opt_sanitized_name): New. 2010-04-13 14:27:22 +00:00
opts-common.c
opts.c diagnostic.h (diagnostic_override_option_index): New macro to set a diagnostic's option_index. 2010-04-07 17:18:10 +00:00
opts.h diagnostic.h (diagnostic_override_option_index): New macro to set a diagnostic's option_index. 2010-04-07 17:18:10 +00:00
output.h
params.c
params.def Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
params.h
passes.c Avoid calling verify_ssa twice in verify_loop_closed_ssa. 2010-04-06 19:20:47 +00:00
plugin.c gcc.c (cc1_options): Handle -iplugindir before processing the cc1 spec. 2010-04-12 23:58:18 +00:00
plugin.def
plugin.h
pointer-set.c
pointer-set.h
postreload-gcse.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
postreload.c re PR debug/43051 (VTA causes a stack living parameter unavailable in most of the function) 2010-03-16 11:50:42 +01:00
predict.c
predict.def
predict.h
prefix.c
prefix.h
pretty-print.c
pretty-print.h
print-rtl.c df-core.c (df_ref_debug): Change format string placeholder from 0x%x to %#x. 2010-04-14 17:08:54 +02:00
print-tree.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
profile.c
profile.h
read-rtl.c read-rtl.c (read_rtx_1): Give an error for EOF while looking for ']'. 2010-04-02 16:51:01 +01:00
real.c
real.h
recog.c recog.h (struct recog_data): New field is_operator. 2010-04-16 09:32:21 +00:00
recog.h recog.h (struct recog_data): New field is_operator. 2010-04-16 09:32:21 +00:00
reg-notes.def re PR debug/43290 (ICE in dwarf2out_frame_debug_expr) 2010-03-10 19:17:10 +01:00
reg-stack.c
regcprop.c
reginfo.c re PR target/43662 (ICE in insert_save with ms_abi attribute) 2010-04-19 10:02:52 +00:00
regmove.c
regrename.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
regs.h
regstat.c
reload.c recog.h (struct recog_data): New field is_operator. 2010-04-16 09:32:21 +00:00
reload.h Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
reload1.c reload1.c (eliminate_regs_in_insn): Don't restore an operand if doing so would replace the entire pattern. 2010-04-10 12:33:17 +00:00
reorg.c
resource.c
resource.h
rtl-error.c
rtl.c
rtl.def Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
rtl.h re PR debug/43051 (VTA causes a stack living parameter unavailable in most of the function) 2010-03-16 11:50:42 +01:00
rtlanal.c
rtlhooks-def.h
rtlhooks.c
sbitmap.c
sbitmap.h
sched-deps.c re PR debug/42977 ("-fcompare-debug failure" with "-O2 -finline-functions -fomit-frame-pointer -ftracer -fsched2-use-superblocks -fPIC") 2010-03-30 23:00:47 +02:00
sched-ebb.c
sched-int.h Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
sched-rgn.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
sched-vis.c
sdbout.c
sdbout.h
sel-sched-dump.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
sel-sched-dump.h
sel-sched-ir.c
sel-sched-ir.h
sel-sched.c
sel-sched.h
sese.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
sese.h Compute min and max bounds for IVs and infer types. 2010-04-06 21:01:16 +00:00
simplify-rtx.c re PR debug/43051 (VTA causes a stack living parameter unavailable in most of the function) 2010-03-16 11:50:42 +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 fold-const.c (fold_comparison): Use ssizetype. 2010-04-18 21:49:29 +00:00
store-motion.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
stringpool.c
stub-objc.c
sync-builtins.def
system.h
target-def.h Implement target hook for loop unrolling 2010-04-08 15:07:57 +00:00
target.h target.h (builtin_conversion): Pass in input and output types. 2010-04-09 13:21:43 +00:00
targhooks.c target.h (builtin_conversion): Pass in input and output types. 2010-04-09 13:21:43 +00:00
targhooks.h target.h (builtin_conversion): Pass in input and output types. 2010-04-09 13:21:43 +00:00
timevar.c
timevar.def Makefile.in (c-pch.o, [...]): Depend on timevar.h. 2010-04-13 09:30:31 -04:00
timevar.h
tlink.c
toplev.c re PR other/42965 (no "warnings being treated as errors" for individual -Werror=x options) 2010-04-09 15:45:52 +00:00
toplev.h toplev.h (inform_n, error_n): Declare. 2010-03-01 09:56:41 +00: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/42963 (Redundant switch labels not cleaned up anymore) 2010-04-14 14:50:33 +00:00
tree-cfgcleanup.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
tree-chrec.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
tree-chrec.h
tree-complex.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
tree-data-ref.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
tree-data-ref.h
tree-dfa.c re PR tree-optimization/43572 (FAIL: gfortran.dg/PR19872.f execution test; formatted read - wrong numbers) 2010-04-16 13:21:38 +00:00
tree-dump.c tree-ssa-structalias.c (struct variable_info): Add is_fn_info flag. 2010-04-15 13:16:44 +00:00
tree-dump.h
tree-eh.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
tree-flow-inline.h re PR tree-optimization/43572 (FAIL: gfortran.dg/PR19872.f execution test; formatted read - wrong numbers) 2010-04-16 13:21:38 +00:00
tree-flow.h re PR tree-optimization/43572 (FAIL: gfortran.dg/PR19872.f execution test; formatted read - wrong numbers) 2010-04-16 13:21:38 +00:00
tree-if-conv.c Fix comments, simplify logic. 2010-04-08 17:32:23 +00:00
tree-inline.c tree-ssa-structalias.c (struct variable_info): Add is_fn_info flag. 2010-04-15 13:16:44 +00:00
tree-inline.h
tree-into-ssa.c tree-ssa-structalias.c (struct variable_info): Add is_fn_info flag. 2010-04-15 13:16:44 +00:00
tree-iterator.c
tree-iterator.h
tree-loop-distribution.c fold-const.c (fold_comparison): Use ssizetype. 2010-04-18 21:49:29 +00:00
tree-loop-linear.c
tree-mudflap.c
tree-mudflap.h
tree-nested.c
tree-nomudflap.c
tree-nrv.c re PR tree-optimization/43572 (FAIL: gfortran.dg/PR19872.f execution test; formatted read - wrong numbers) 2010-04-16 13:21:38 +00:00
tree-object-size.c fold-const.c (fold_comparison): Use ssizetype. 2010-04-18 21:49:29 +00:00
tree-optimize.c
tree-outof-ssa.c tree-ssa-pre.c (my_rev_post_order_compute): Remove set but not used count variable. 2010-04-07 22:27:37 +02:00
tree-parloops.c gsstruct.def (GSS_CALL): New. 2010-04-12 15:20:48 +00:00
tree-pass.h tree-ssa-structalias.c (struct variable_info): Add is_fn_info flag. 2010-04-15 13:16:44 +00:00
tree-phinodes.c re PR debug/42897 (yet another ice in verify_ssa) 2010-03-06 20:30:10 +00:00
tree-predcom.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
tree-pretty-print.c tree-ssa-structalias.c (struct variable_info): Add is_fn_info flag. 2010-04-15 13:16:44 +00:00
tree-profile.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
tree-scalar-evolution.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
tree-scalar-evolution.h
tree-sra.c tree-sra.c (replace_uses_with_default_def_ssa_name): New function. 2010-04-13 15:47:34 +02:00
tree-ssa-address.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
tree-ssa-alias.c re PR tree-optimization/43572 (FAIL: gfortran.dg/PR19872.f execution test; formatted read - wrong numbers) 2010-04-16 13:21:38 +00:00
tree-ssa-alias.h re PR tree-optimization/43572 (FAIL: gfortran.dg/PR19872.f execution test; formatted read - wrong numbers) 2010-04-16 13:21:38 +00:00
tree-ssa-ccp.c Makefile.in (OBJS-common): Add gimple-fold.o. 2010-04-15 12:58:05 +00:00
tree-ssa-coalesce.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
tree-ssa-copy.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
tree-ssa-copyrename.c
tree-ssa-dce.c re PR tree-optimization/42906 (Empty loop not removed) 2010-04-06 15:18:18 +00:00
tree-ssa-dom.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
tree-ssa-dse.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
tree-ssa-forwprop.c ipa-reference.c (mark_load): Use get_base_address. 2010-04-07 15:31:37 +00:00
tree-ssa-ifcombine.c
tree-ssa-live.c
tree-ssa-live.h
tree-ssa-loop-ch.c
tree-ssa-loop-im.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
tree-ssa-loop-ivcanon.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
tree-ssa-loop-ivopts.c re PR tree-optimization/43614 (ice in gimple_rhs_has_side_effects, at gimple.c:2248) 2010-04-01 16:18:07 +00:00
tree-ssa-loop-manip.c Avoid calling verify_ssa twice in verify_loop_closed_ssa. 2010-04-06 19:20:47 +00:00
tree-ssa-loop-niter.c
tree-ssa-loop-prefetch.c
tree-ssa-loop-unswitch.c Fix a problematic logic at unswitch-loops pass. 2010-04-08 18:16:57 +00:00
tree-ssa-loop.c Always execute verify_loop_closed_ssa at LNO level. 2010-04-06 19:20:29 +00:00
tree-ssa-math-opts.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
tree-ssa-operands.c ipa-reference.c (mark_load): Use get_base_address. 2010-04-07 15:31:37 +00:00
tree-ssa-operands.h tree-ssa-pre.c (my_rev_post_order_compute): Remove set but not used count variable. 2010-04-07 22:27:37 +02:00
tree-ssa-phiopt.c
tree-ssa-phiprop.c
tree-ssa-pre.c re PR tree-optimization/43783 (-O -ftree-pre options compile libbid wrong) 2010-04-19 13:36:54 +00:00
tree-ssa-propagate.c
tree-ssa-propagate.h
tree-ssa-reassoc.c tree-ssa-reassoc.c (struct operand_entry): Add new field ID. 2010-04-16 20:31:39 +00:00
tree-ssa-sccvn.c re PR tree-optimization/43270 (array-bounds false negative) 2010-04-07 12:31:32 +00:00
tree-ssa-sccvn.h re PR tree-optimization/43270 (array-bounds false negative) 2010-04-07 12:31:32 +00:00
tree-ssa-sink.c
tree-ssa-structalias.c tree-ssa-structalias.c (struct variable_info): Add is_fn_info flag. 2010-04-15 13:16:44 +00:00
tree-ssa-ter.c
tree-ssa-threadedge.c
tree-ssa-threadupdate.c
tree-ssa-uncprop.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
tree-ssa.c gsstruct.def (GSS_CALL): New. 2010-04-12 15:20:48 +00:00
tree-ssanames.c
tree-stdarg.c
tree-stdarg.h
tree-switch-conversion.c
tree-tailcall.c re PR tree-optimization/43572 (FAIL: gfortran.dg/PR19872.f execution test; formatted read - wrong numbers) 2010-04-16 13:21:38 +00:00
tree-vect-data-refs.c tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Only add RW dependence for dependence distance zero. 2010-04-13 09:48:26 +00:00
tree-vect-generic.c
tree-vect-loop-manip.c
tree-vect-loop.c re PR tree-optimization/37027 (SLP loop vectorization missing support for reductions) 2010-04-19 09:10:45 +00:00
tree-vect-patterns.c re PR tree-optimization/37027 (SLP loop vectorization missing support for reductions) 2010-04-19 09:10:45 +00:00
tree-vect-slp.c re PR tree-optimization/37027 (SLP loop vectorization missing support for reductions) 2010-04-19 09:10:45 +00:00
tree-vect-stmts.c re PR tree-optimization/37027 (SLP loop vectorization missing support for reductions) 2010-04-19 09:10:45 +00:00
tree-vectorizer.c
tree-vectorizer.h re PR tree-optimization/37027 (SLP loop vectorization missing support for reductions) 2010-04-19 09:10:45 +00:00
tree-vrp.c re PR tree-optimization/43270 (array-bounds false negative) 2010-04-07 12:31:32 +00:00
tree.c fold-const.c (fold_comparison): Use ssizetype. 2010-04-18 21:49:29 +00:00
tree.def Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
tree.h tree.h (ENUM_IS_SCOPED): Define. 2010-04-19 09:48:46 +02: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 Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
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.h
var-tracking.c var-tracking.c (vt_init_cfa_base): Use cselib_lookup_from_insn instead of cselib_lookup following by tweaking... 2010-03-31 17:27:41 +02:00
varasm.c re PR bootstrap/43684 (multiple 'set but not used' errors.) 2010-04-09 13:34:33 +00:00
varpool.c Make-lang.in, [...]: Update copyright years. 2010-04-02 19:54:46 +00:00
varray.c
varray.h
vec.c
vec.h
vecprim.h
version.c
version.h
vmsdbg.h
vmsdbgout.c
web.c Makefile.in (web.o): Depend on insn-config.h and $(RECOG_H). 2010-04-10 12:30:29 +00:00
xcoff.h
xcoffout.c
xcoffout.h

README.Portability

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.