gcc/gcc
Richard Biener 5105b576df re PR tree-optimization/92645 (Hand written vector code is 450 times slower when compiled with GCC compared to Clang)
2019-12-03  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/92645
	* gimple-fold.c (gimple_fold_builtin_memory_op): Fold memcpy
	from or to a properly aligned register variable.

	* gcc.target/i386/pr92645-5.c: New testcase.

From-SVN: r278934
2019-12-03 11:59:13 +00:00
..
ada utils.c (potential_alignment_gap): Delete. 2019-12-03 10:23:06 +00:00
brig
c Diagnose use of [*] in old-style parameter definitions (PR c/88704). 2019-12-03 01:27:43 +00:00
c-family cgraph.h (symtab_node): Add symver flag. 2019-11-30 21:03:25 +00:00
common Delete common/config/powerpcspe 2019-11-16 20:32:12 +01:00
config re PR target/92744 (error: insn does not satisfy its constraints since r278439) 2019-12-03 09:23:06 +01:00
cp re PR c++/92732 (Bit-field of scoped enumeration type cannot be initialized) 2019-12-03 09:21:29 +01:00
d Remove build_{same_sized_,}truth_vector_type 2019-11-14 14:49:36 +00:00
doc Enable recursive function versioning 2019-12-02 06:37:30 +00:00
fortran Do not look at _data component in gfc_dep_resolver. 2019-11-30 15:02:50 +00:00
ginclude
go re PR go/92605 (r278509 causes/reveals issue in building go library) 2019-11-21 01:06:47 +00:00
jit Remove unused decimal floating-point pointer types 2019-11-29 00:58:35 +00:00
lto cgraph.c (cgraph_node::dump): Dump unit_id and merged_extern_inline. 2019-11-30 16:56:45 +00:00
objc
objcp
po
testsuite re PR tree-optimization/92645 (Hand written vector code is 450 times slower when compiled with GCC compared to Clang) 2019-12-03 11:59:13 +00:00
ABOUT-GCC-NLS
acinclude.m4
aclocal.m4
addresses.h
alias.c re PR target/92462 ([arm32] -ftree-pre makes a variable to be wrongly hoisted out) 2019-11-18 09:44:52 +00:00
alias.h
align.h
alloc-pool.c
alloc-pool.h
array-traits.h
asan.c
asan.h
attribs.c Properly handle C2x attributes on types. 2019-11-25 13:42:49 +00:00
attribs.h PR middle-end/83859 - attributes to associate pointer arguments and sizes 2019-11-22 10:14:17 -07:00
auto-inc-dec.c Allow autoinc in jumps, but only when using reload. 2019-11-27 03:31:24 +00:00
auto-profile.c
auto-profile.h
backend.h
BASE-VER
basic-block.h
bb-reorder.c Add pool_allocator for fibonaci heaps. 2019-11-20 15:04:34 +00:00
bb-reorder.h
bitmap.c
bitmap.h
brig-builtins.def
builtin-attrs.def
builtin-types.def Remove unused decimal floating-point pointer types 2019-11-29 00:58:35 +00:00
builtins.c PR 92463 - Cleanups due to minimum MPFR version bump to 3.1.0 2019-11-27 10:16:24 +01:00
builtins.def
builtins.h PR middle-end/83859 - attributes to associate pointer arguments and sizes 2019-11-22 10:14:17 -07:00
caller-save.c
calls.c PR middle-end/83859 - attributes to associate pointer arguments and sizes 2019-11-22 10:14:17 -07:00
calls.h
ccmp.c
ccmp.h
cfg-flags.def
cfg.c
cfg.h
cfganal.c re PR target/92669 (ICE in pre_and_rev_post_order_compute_fn at gcc/cfganal.c:1034 since r278666) 2019-11-26 12:03:58 +00:00
cfganal.h
cfgbuild.c
cfgbuild.h
cfgcleanup.c Make flag_thread_jumps a gate of pass_jump_after_combine 2019-11-14 16:40:33 +00:00
cfgcleanup.h
cfgexpand.c
cfgexpand.h
cfghooks.c
cfghooks.h
cfgloop.c cfgloop.h (get_loop_exit_edges): Add extra parameter denoting loop body, defaulted to NULL. 2019-11-25 07:51:38 +00:00
cfgloop.h cfgloop.h (get_loop_exit_edges): Add extra parameter denoting loop body, defaulted to NULL. 2019-11-25 07:51:38 +00:00
cfgloopanal.c cfgloop.h (get_loop_exit_edges): Add extra parameter denoting loop body, defaulted to NULL. 2019-11-25 07:51:38 +00:00
cfgloopmanip.c
cfgloopmanip.h
cfgrtl.c
cfgrtl.h
cgraph.c cgraph.c (cgraph_node::dump): Dump unit_id and merged_extern_inline. 2019-11-30 16:56:45 +00:00
cgraph.h cgraph.h (symtab_node): Add symver flag. 2019-11-30 21:03:25 +00:00
cgraphbuild.c
cgraphclones.c cgraph.c (cgraph_node::dump): Dump unit_id and merged_extern_inline. 2019-11-30 16:56:45 +00:00
cgraphunit.c cgraph.h (symtab_node): Add symver flag. 2019-11-30 21:03:25 +00:00
ChangeLog re PR tree-optimization/92645 (Hand written vector code is 450 times slower when compiled with GCC compared to Clang) 2019-12-03 11:59: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-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-2016
ChangeLog-2017
ChangeLog-2018
ChangeLog.dataflow
ChangeLog.gimple-classes
ChangeLog.graphite
ChangeLog.jit
ChangeLog.lib
ChangeLog.ptr
ChangeLog.tree-ssa
ChangeLog.tuples
cif-code.def Convert inliner to function specific param infrastructure 2019-11-23 13:11:25 +00:00
collect-utils.c
collect-utils.h
collect2-aix.c
collect2-aix.h
collect2.c
collect2.h
color-macros.h
combine-stack-adj.c
combine.c re PR rtl-optimization/92510 (ICE in native_encode_rtx, at simplify-rtx.c:6272) 2019-11-27 17:32:54 +01:00
common.md
common.opt PR85678: Change default to -fno-common 2019-11-20 16:29:23 +00:00
compare-elim.c
conditions.h
config.build
config.gcc Update the arm-*-vxworks* support 2019-11-14 16:11:30 +00:00
config.host
config.in
configure Switch gcc ftp URL's to https 2019-11-20 22:24:48 +02:00
configure.ac Switch gcc ftp URL's to https 2019-11-20 22:24:48 +02:00
context.c
context.h
convert.c
convert.h
COPYING
COPYING.LIB
COPYING3
COPYING3.LIB
coretypes.h
coverage.c
coverage.h
cppbuiltin.c
cppbuiltin.h
cppdefault.c
cppdefault.h
cprop.c
cse.c re PR rtl-optimization/92610 (ICE in calc_dfs_tree, at dominance.c:458 since r270940) 2019-11-23 11:05:31 +01:00
cselib.c
cselib.h
cstamp-h.in
data-streamer-in.c
data-streamer-out.c
data-streamer.c
data-streamer.h
DATESTAMP Daily bump. 2019-12-03 00:16:19 +00:00
dbgcnt.c Translate header for -fdbg-cnt-list. 2019-11-28 20:56:51 +00:00
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-core.c
df-problems.c
df-scan.c
df.h
dfp.c
dfp.h
diagnostic-color.c
diagnostic-color.h
diagnostic-core.h
diagnostic-format-json.cc
diagnostic-show-locus.c
diagnostic-url.h
diagnostic.c
diagnostic.def
diagnostic.h
dojump.c
dojump.h
dominance.c
dominance.h
domwalk.c
domwalk.h
double-int.c
double-int.h
dse.c
dump-context.h
dumpfile.c
dumpfile.h
dwarf2asm.c
dwarf2asm.h
dwarf2cfi.c
dwarf2out.c re PR debug/92664 (Wrong .debug_line section information when compiling stdin input with -g3) 2019-11-27 01:23:39 +01:00
dwarf2out.h
early-remat.c
edit-context.c
edit-context.h
emit-rtl.c
emit-rtl.h
errors.c
errors.h
escaped_string.h
et-forest.c
et-forest.h
except.c
except.h
exec-tool.in
explow.c
explow.h
expmed.c re PR middle-end/90840 (ICE in simplify_subreg, at simplify-rtx.c:6441) 2019-11-20 09:32:56 +01:00
expmed.h
expr.c Vectorise conversions between differently-sized integer vectors 2019-11-14 15:31:25 +00:00
expr.h
fibonacci_heap.c Add pool_allocator for fibonaci heaps. 2019-11-20 15:04:34 +00:00
fibonacci_heap.h Workaround bogus warning in fibonacci_heap<K,V>::consolidate. 2019-11-20 15:45:53 +00:00
file-find.c
file-find.h
file-prefix-map.c
file-prefix-map.h
final.c
fixed-value.c
fixed-value.h
flag-types.h
flags.h
fold-const-call.c PR 92463 - Cleanups due to minimum MPFR version bump to 3.1.0 2019-11-27 10:16:24 +01:00
fold-const-call.h
fold-const.c Tighten check for vector types in fold_convertible_p (PR 92741) 2019-12-02 17:51:08 +00:00
fold-const.h
fp-test.c
FSFChangeLog
FSFChangeLog.10
FSFChangeLog.11
function-abi.cc
function-abi.h
function-tests.c
function.c drop attempt to reuse cgraph callees for -fcallgraph-info 2019-11-20 20:54:31 +00:00
function.h drop attempt to reuse cgraph callees for -fcallgraph-info 2019-11-20 20:54:31 +00:00
fwprop.c
gcc-ar.c
gcc-main.c
gcc-plugin.h
gcc-rich-location.c
gcc-rich-location.h
gcc-symtab.h
gcc.c driver: Do not warn about ineffective `-x' option if no inputs were given 2019-11-30 11:10:50 +00:00
gcc.h
gcov-counter.def
gcov-dump.c
gcov-io.c
gcov-io.h
gcov-iov.c
gcov-tool.c
gcov.c
gcse-common.c
gcse-common.h
gcse.c
gcse.h
gdbasan.in
gdbhooks.py
gdbinit.in
gen-pass-instances.awk
genattr-common.c
genattr.c
genattrtab.c
genautomata.c
gencfn-macros.c
gencheck.c
genchecksum.c
gencodes.c
genconditions.c
genconfig.c
genconstants.c
genemit.c
genenums.c
generic-match-head.c
generic-match.h
genextract.c
genflags.c
gengenrtl.c
gengtype-lex.l
gengtype-parse.c
gengtype-state.c
gengtype.c
gengtype.h
genhooks.c
genmatch.c
genmddeps.c
genmddump.c
genmodes.c
genmultilib
genopinit.c
genoutput.c
genpeep.c
genpreds.c
genrecog.c
gensupport.c
gensupport.h
gentarget-def.c
ggc-common.c
ggc-internal.h
ggc-none.c
ggc-page.c Release memory-block-pool memory back to malloc. 2019-11-22 14:37:37 +00:00
ggc-tests.c
ggc.h
gimple-builder.c
gimple-builder.h
gimple-expr.c
gimple-expr.h
gimple-fold.c re PR tree-optimization/92645 (Hand written vector code is 450 times slower when compiled with GCC compared to Clang) 2019-12-03 11:59:13 +00:00
gimple-fold.h
gimple-iterator.c
gimple-iterator.h
gimple-laddress.c
gimple-loop-interchange.cc
gimple-loop-jam.c
gimple-loop-versioning.cc
gimple-low.c
gimple-low.h
gimple-match-head.c Fix ICE in re-simplification of VEC_COND_EXPR 2019-11-29 15:02:35 +00:00
gimple-match.h
gimple-predict.h
gimple-pretty-print.c
gimple-pretty-print.h
gimple-ssa-backprop.c
gimple-ssa-evrp-analyze.c
gimple-ssa-evrp-analyze.h
gimple-ssa-evrp.c
gimple-ssa-isolate-paths.c
gimple-ssa-nonnull-compare.c
gimple-ssa-split-paths.c
gimple-ssa-sprintf.c PR 92463 - Cleanups due to minimum MPFR version bump to 3.1.0 2019-11-27 10:16:24 +01:00
gimple-ssa-store-merging.c
gimple-ssa-strength-reduction.c
gimple-ssa-warn-alloca.c
gimple-ssa-warn-restrict.c
gimple-ssa-warn-restrict.h
gimple-ssa.h
gimple-streamer-in.c
gimple-streamer-out.c
gimple-streamer.h
gimple-walk.c
gimple-walk.h
gimple.c
gimple.def
gimple.h
gimplify-me.c
gimplify-me.h
gimplify.c Make more bad uses of fallthrough attribute into pedwarns. 2019-11-21 20:29:40 +00:00
gimplify.h
glimits.h
godump.c
graph.c
graph.h
graphds.c
graphds.h
graphite-dependences.c
graphite-isl-ast-to-gimple.c
graphite-optimize-isl.c
graphite-poly.c
graphite-scop-detection.c
graphite-sese-to-poly.c
graphite.c
graphite.h
gsstruct.def
gstab.h
gsyms.h
gsyslimits.h
gtm-builtins.def
haifa-sched.c
hard-reg-set.h
hash-map-tests.c
hash-map-traits.h
hash-map.h
hash-set-tests.c
hash-set.h
hash-table.c
hash-table.h
hash-traits.h
highlev-plugin-common.h
hooks.c
hooks.h
host-default.c
hosthooks-def.h
hosthooks.h
hsa-brig-format.h
hsa-brig.c
hsa-builtins.def
hsa-common.c
hsa-common.h
hsa-dump.c
hsa-gen.c
hsa-regalloc.c
hw-doloop.c
hw-doloop.h
hwint.c
hwint.h
ifcvt.c
ifcvt.h
inchash.c
inchash.h
incpath.c
incpath.h
init-regs.c
input.c
input.h
insn-addr.h
insn-notes.def
int-vector-builder.h
internal-fn.c re PR middle-end/91450 (__builtin_mul_overflow(A,B,R) wrong code if product < 0, *R is unsigned, and !(A&B)) 2019-11-19 10:15:53 +01:00
internal-fn.def Add optabs for accelerating RAW and WAR alias checks 2019-11-18 15:36:10 +00:00
internal-fn.h Add optabs for accelerating RAW and WAR alias checks 2019-11-18 15:36:10 +00:00
intl.c
intl.h
ipa-comdats.c Fix comments typo 2019-11-15 08:17:31 +00:00
ipa-cp.c Enable recursive function versioning 2019-12-02 06:37:30 +00:00
ipa-devirt.c Refactor IPA devirt a bit. 2019-12-02 11:18:31 +00:00
ipa-fnsummary.c cgraph.c (cgraph_node::dump): Dump unit_id and merged_extern_inline. 2019-11-30 16:56:45 +00:00
ipa-fnsummary.h cgraph.c (cgraph_node::dump): Dump unit_id and merged_extern_inline. 2019-11-30 16:56:45 +00:00
ipa-hsa.c
ipa-icf-gimple.c Verify NOP_EXPR LHS type in IPA ICF. 2019-11-18 11:51:05 +00:00
ipa-icf-gimple.h ipa-fnsummary.c: Fix comment typos. 2019-11-23 12:44:51 +01:00
ipa-icf.c Update dump message in IPA ICF. 2019-11-25 14:02:55 +00:00
ipa-icf.h ipa-fnsummary.c: Fix comment typos. 2019-11-23 12:44:51 +01:00
ipa-inline-analysis.c cgraph.c (cgraph_node::dump): Dump unit_id and merged_extern_inline. 2019-11-30 16:56:45 +00:00
ipa-inline-transform.c Prevent inconsistent profiles to be created in inlin_transform 2019-11-28 16:59:43 +00:00
ipa-inline.c ipa-inline.c (compute_max_insns): Return int64_t. 2019-11-30 23:19:58 +00:00
ipa-inline.h Avoid quadratic behaviour of early inliner. 2019-11-21 08:15:47 +00:00
ipa-param-manipulation.c
ipa-param-manipulation.h
ipa-polymorphic-call.c ipa-fnsummary.c: Fix comment typos. 2019-11-23 12:44:51 +01:00
ipa-predicate.c ipa-fnsummary.c: Fix comment typos. 2019-11-23 12:44:51 +01:00
ipa-predicate.h ipa-fnsummary.c: Fix comment typos. 2019-11-23 12:44:51 +01:00
ipa-profile.c Fix comments typo 2019-11-15 08:17:31 +00:00
ipa-prop.c re PR ipa/92528 (ICE in ipa_get_parm_lattices since r278219) 2019-11-15 15:03:24 +00:00
ipa-prop.h Enable recursive function versioning 2019-12-02 06:37:30 +00:00
ipa-pure-const.c
ipa-ref.c
ipa-ref.h ipa-fnsummary.c: Fix comment typos. 2019-11-23 12:44:51 +01:00
ipa-reference.c
ipa-reference.h
ipa-split.c ipa-fnsummary.c: Fix comment typos. 2019-11-23 12:44:51 +01:00
ipa-sra.c Make IPA-SRA follow comdat-local rules (PR 91956) 2019-11-25 11:09:42 +01:00
ipa-utils.c ipa-utils.c (ipa_merge_profiles): Be sure that all type transtions of counters are done same way. 2019-11-28 14:21:08 +00:00
ipa-utils.h Refactor IPA devirt a bit. 2019-12-02 11:18:31 +00:00
ipa-visibility.c
ipa.c ipa: Prevent materialization of clones with removed bodies (PR 92109) 2019-11-25 11:13:08 +01:00
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
is-a.h
json.cc
json.h
jump.c
langhooks-def.h
langhooks.c
langhooks.h
LANGUAGES
lcm.c
lcm.h
libfuncs.h
limitx.h
limity.h
lists.c
lock-and-run.sh
loop-doloop.c
loop-init.c
loop-invariant.c
loop-iv.c
loop-unroll.c
loop-unroll.h
lower-subreg.c
lower-subreg.h
lra-assigns.c
lra-coalesce.c
lra-constraints.c LRA: handle memory constraints that accept more than "m" 2019-11-18 15:26:07 +00:00
lra-eliminations.c
lra-int.h
lra-lives.c
lra-remat.c
lra-spills.c Check suitability of spill register for mode 2019-11-14 23:37:13 +00:00
lra.c re PR rtl-optimization/92283 (454.calculix miscomparison since r276645 with -O2 -march=znver2) 2019-11-29 22:04:21 +00:00
lra.h
lto-cgraph.c cgraph.h (symtab_node): Add symver flag. 2019-11-30 21:03:25 +00:00
lto-compress.c
lto-compress.h
lto-opts.c
lto-section-in.c
lto-section-names.h
lto-section-out.c
lto-streamer-in.c
lto-streamer-out.c lto-streamer-out.c (DFS::sccstack): Turn into auto-vec. 2019-11-20 14:10:41 +00:00
lto-streamer.c
lto-streamer.h cgraph.c (cgraph_node::dump): Dump unit_id and merged_extern_inline. 2019-11-30 16:56:45 +00:00
lto-wrapper.c
machmode.def
machmode.h Support vectorisation with mixed vector sizes 2019-11-14 15:12:58 +00:00
main.c
Makefile.in Makefile.in (SOURCES): Add doc/lto-dump.1. 2019-12-03 11:30:34 +00:00
match.pd re PR tree-optimization/92734 (Missing match.pd simplification done by fold_binary_loc on generic) 2019-12-03 10:20:43 +01:00
mcf.c
mem-stats-traits.h
mem-stats.h
memmodel.h
memory-block.cc Release memory-block-pool memory back to malloc. 2019-11-22 14:37:37 +00:00
memory-block.h Release memory-block-pool memory back to malloc. 2019-11-22 14:37:37 +00:00
mkconfig.sh
mode-classes.def
mode-switching.c
modulo-sched.c
multiple_target.c
omp-builtins.def
omp-expand.c
omp-expand.h
omp-general.c gimplify.c (gimplify_call_expr): Don't call omp_resolve_declare_variant after gimplification. 2019-11-15 09:32:36 +01:00
omp-general.h
omp-grid.c
omp-grid.h
omp-low.c re PR tree-optimization/92557 (ICE in omp_clause_aligned_alignment, at omp-low.c:4090) 2019-11-19 09:51:31 +01:00
omp-low.h
omp-offload.c
omp-offload.h
omp-simd-clone.c
omp-simd-clone.h
ONEWS
opt-functions.awk
opt-gather.awk
opt-include.awk
opt-problem.cc
opt-problem.h
opt-read.awk
opt-suggestions.c
opt-suggestions.h
optabs-libfuncs.c
optabs-libfuncs.h
optabs-query.c Replace autovectorize_vector_sizes with autovectorize_vector_modes 2019-11-14 15:03:17 +00:00
optabs-query.h
optabs-tree.c target.def (TARGET_VECTORIZE_BUILTIN_CONVERSION): Remove. 2019-11-27 12:22:02 +00:00
optabs-tree.h target.def (TARGET_VECTORIZE_BUILTIN_CONVERSION): Remove. 2019-11-27 12:22:02 +00:00
optabs.c Replace mode_for_int_vector with related_int_vector_mode 2019-11-14 14:39:57 +00:00
optabs.def Add optabs for accelerating RAW and WAR alias checks 2019-11-18 15:36:10 +00:00
optabs.h
optc-gen.awk
optc-save-gen.awk
opth-gen.awk
optinfo-emit-json.cc
optinfo-emit-json.h
optinfo.cc
optinfo.h
opts-common.c
opts-diagnostic.h
opts-global.c
opts.c Convert inliner to function specific param infrastructure 2019-11-23 13:11:25 +00:00
opts.h
output.h cgraph.h (symtab_node): Add symver flag. 2019-11-30 21:03:25 +00:00
params.opt Enable recursive function versioning 2019-12-02 06:37:30 +00:00
pass_manager.h
passes.c [mid-end][__RTL] Set global epilogue_completed in skip_pass 2019-11-15 12:10:56 +00:00
passes.def
plugin.c
plugin.def
plugin.h
poly-int-types.h
poly-int.h
postreload-gcse.c
postreload.c
predict.c profile-count.h (profile_count::operator<): Use IPA value for comparsion. 2019-12-01 15:12:52 +00:00
predict.def
predict.h
prefix.c
prefix.h
pretty-print.c
pretty-print.h
print-rtl-function.c
print-rtl.c
print-rtl.h
print-tree.c
print-tree.h
profile-count.c profile-count.c (profile_count::to_cgraph_frequency, [...]): Check for compaibility of counts. 2019-11-29 10:29:44 +00:00
profile-count.h profile-count.h (profile_count::operator<): Use IPA value for comparsion. 2019-12-01 15:12:52 +00:00
profile.c
profile.h
range-op.cc Change fold_range to return a boolean result. 2019-11-14 22:29:56 +00:00
range-op.h Change fold_range to return a boolean result. 2019-11-14 22:29:56 +00:00
range.cc Remove range_intersect, range_invert, and range_union. 2019-11-14 17:51:31 +00:00
range.h Remove range_intersect, range_invert, and range_union. 2019-11-14 17:51:31 +00:00
read-md.c
read-md.h
read-rtl-function.c [mid-end][__RTL] Account for column numbers in __RTL functions 2019-11-15 14:18:14 +00:00
read-rtl-function.h
read-rtl.c
README.Portability
real.c PR 92463 - Cleanups due to minimum MPFR version bump to 3.1.0 2019-11-27 10:16:24 +01:00
real.h
realmpfr.c PR 92463 - Cleanups due to minimum MPFR version bump to 3.1.0 2019-11-27 10:16:24 +01:00
realmpfr.h PR 92463 - Cleanups due to minimum MPFR version bump to 3.1.0 2019-11-27 10:16:24 +01:00
recog.c re PR rtl-optimization/90007 (ICE in extract_constrain_insn_cached, at recog.c:2223) 2019-11-27 14:24:47 +00:00
recog.h Convert m68k to not use cc0 2019-11-25 12:31:16 +00:00
ree.c
reg-notes.def
reg-stack.c
regcprop.c
regcprop.h
reginfo.c
regrename.c
regrename.h
regs.h
regset.h
regstat.c
reload.c
reload.h
reload1.c
reorg.c
resource.c
resource.h
rtl-error.c
rtl-error.h
rtl-iter.h
rtl-tests.c
rtl.c
rtl.def
rtl.h Convert m68k to not use cc0 2019-11-25 12:31:16 +00:00
rtlanal.c Convert m68k to not use cc0 2019-11-25 12:31:16 +00:00
rtlhash.c
rtlhash.h
rtlhooks-def.h
rtlhooks.c
rtx-vector-builder.c
rtx-vector-builder.h
run-rtl-passes.c [mid-end][__RTL] Clean state despite unspecified __RTL startwith passes 2019-11-18 11:16:46 +00:00
run-rtl-passes.h
sancov.c
sanitizer.def
sanopt.c
sbitmap.c
sbitmap.h
sched-deps.c
sched-ebb.c
sched-int.h
sched-rgn.c
sel-sched-dump.c
sel-sched-dump.h
sel-sched-ir.c
sel-sched-ir.h
sel-sched.c
sel-sched.h
selftest-diagnostic.c
selftest-diagnostic.h
selftest-rtl.c
selftest-rtl.h
selftest-run-tests.c
selftest.c
selftest.h Remove higher precision range tests because they are unused. 2019-11-14 07:55:04 +00:00
sese.c
sese.h
shrink-wrap.c
shrink-wrap.h
signop.h
simplify-rtx.c Revert r278441 2019-11-19 16:31:17 +00:00
sort.cc
sparseset.c
sparseset.h
spellcheck-tree.c
spellcheck-tree.h
spellcheck.c
spellcheck.h
sreal.c
sreal.h
ssa-iterators.h
ssa.h
stab.def
stack-ptr-mod.c
statistics.c
statistics.h
stmt.c
stmt.h
stor-layout.c Replace mode_for_int_vector with related_int_vector_mode 2019-11-14 14:39:57 +00:00
stor-layout.h
store-motion.c
streamer-hooks.c
streamer-hooks.h
stringpool.c
stringpool.h
substring-locations.c
substring-locations.h
symbol-summary.h
symtab.c cgraph.h (symtab_node): Add symver flag. 2019-11-30 21:03:25 +00:00
sync-builtins.def
system.h
target-def.h
target-globals.c
target-globals.h
target-hooks-macros.h
target-insns.def
target.def [C] Add a target hook that allows targets to verify type usage 2019-11-30 18:50:06 +00:00
target.h [C] Add a target hook that allows targets to verify type usage 2019-11-30 18:50:06 +00:00
targhooks.c target.def (TARGET_VECTORIZE_BUILTIN_CONVERSION): Remove. 2019-11-27 12:22:02 +00:00
targhooks.h target.def (TARGET_VECTORIZE_BUILTIN_CONVERSION): Remove. 2019-11-27 12:22:02 +00:00
timevar.c
timevar.def
timevar.h
toplev.c drop attempt to reuse cgraph callees for -fcallgraph-info 2019-11-20 20:54:31 +00:00
toplev.h
tracer.c Add pool_allocator for fibonaci heaps. 2019-11-20 15:04:34 +00:00
tracer.h
trans-mem.c
trans-mem.h
tree-affine.c
tree-affine.h
tree-call-cdce.c
tree-cfg.c Update max_bb_count in execute_fixup_cfg 2019-11-30 21:25:24 +00:00
tree-cfg.h
tree-cfgcleanup.c
tree-cfgcleanup.h
tree-chrec.c
tree-chrec.h
tree-complex.c
tree-core.h Remove unused decimal floating-point pointer types 2019-11-29 00:58:35 +00:00
tree-data-ref.c Add optabs for accelerating RAW and WAR alias checks 2019-11-18 15:36:10 +00:00
tree-data-ref.h Record whether a dr_with_seg_len contains mixed steps 2019-11-16 11:41:16 +00:00
tree-dfa.c
tree-dfa.h
tree-diagnostic.c
tree-diagnostic.h
tree-dump.c
tree-dump.h
tree-eh.c
tree-eh.h
tree-emutls.c
tree-hash-traits.h re PR c++/92458 (Constraints do not work with precompiled headers) 2019-11-22 22:38:44 +01:00
tree-hasher.h
tree-if-conv.c re PR tree-optimization/92704 (ICE: Segmentation fault (in process_bb)) 2019-11-29 08:05:03 +00:00
tree-if-conv.h
tree-inline.c re PR tree-optimization/92645 (Hand written vector code is 450 times slower when compiled with GCC compared to Clang) 2019-11-28 12:26:50 +00:00
tree-inline.h
tree-into-ssa.c cfgloop.h (loop_iterator::~loop_iterator): Remove. 2019-11-21 13:46:18 +00:00
tree-into-ssa.h
tree-iterator.c
tree-iterator.h
tree-loop-distribution.c Refactor tree-loop-distribution.c for thread safety 2019-11-18 20:05:16 +00:00
tree-nested.c
tree-nested.h
tree-nrv.c
tree-object-size.c
tree-object-size.h
tree-outof-ssa.c
tree-outof-ssa.h
tree-parloops.c
tree-parloops.h
tree-pass.h
tree-phinodes.c
tree-phinodes.h
tree-predcom.c
tree-pretty-print.c
tree-pretty-print.h
tree-profile.c Fix comments typo 2019-11-15 08:17:31 +00:00
tree-scalar-evolution.c
tree-scalar-evolution.h
tree-sra.c
tree-sra.h
tree-ssa-address.c
tree-ssa-address.h
tree-ssa-alias.c
tree-ssa-alias.h
tree-ssa-ccp.c re PR c/90898 (ICE in insert_clobber_before_stack_restore, at tree-ssa-ccp.c:2112) 2019-11-20 09:29:35 +01:00
tree-ssa-ccp.h
tree-ssa-coalesce.c
tree-ssa-coalesce.h
tree-ssa-copy.c
tree-ssa-dce.c
tree-ssa-dce.h
tree-ssa-dom.c
tree-ssa-dom.h
tree-ssa-dse.c
tree-ssa-dse.h
tree-ssa-forwprop.c re PR tree-optimization/92715 (error: position plus size exceeds size of referenced object in ‘bit_field_ref’) 2019-11-29 09:18:48 +00:00
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-ivcanon.c cfgloop.h (get_loop_exit_edges): Add extra parameter denoting loop body, defaulted to NULL. 2019-11-25 07:51:38 +00:00
tree-ssa-loop-ivopts.c cfgloop.h (get_loop_exit_edges): Add extra parameter denoting loop body, defaulted to NULL. 2019-11-25 07:51:38 +00:00
tree-ssa-loop-ivopts.h
tree-ssa-loop-manip.c
tree-ssa-loop-manip.h
tree-ssa-loop-niter.c cfgloop.h (get_loop_exit_edges): Add extra parameter denoting loop body, defaulted to NULL. 2019-11-25 07:51:38 +00:00
tree-ssa-loop-niter.h cfgloop.h (get_loop_exit_edges): Add extra parameter denoting loop body, defaulted to NULL. 2019-11-25 07:51:38 +00:00
tree-ssa-loop-prefetch.c
tree-ssa-loop-split.c
tree-ssa-loop-unswitch.c Use safe_dyn_cast instead of dyn_cast in find_loop_guard to fix PR92608. 2019-11-21 20:20:36 +00:00
tree-ssa-loop.c
tree-ssa-loop.h
tree-ssa-math-opts.c
tree-ssa-operands.c
tree-ssa-operands.h
tree-ssa-phiopt.c re PR tree-optimization/92644 (ICE in wide_int_to_tree_1, at tree.c:1530) 2019-11-26 09:43:27 +01:00
tree-ssa-phiprop.c
tree-ssa-pre.c
tree-ssa-propagate.c
tree-ssa-propagate.h
tree-ssa-reassoc.c re PR tree-optimization/92618 (error: type mismatch in binary expression in reassoc since r273490) 2019-11-22 19:17:04 +01:00
tree-ssa-sccvn.c re PR tree-optimization/92751 (VN partial def support confused about clobbers) 2019-12-03 10:46:52 +00:00
tree-ssa-sccvn.h
tree-ssa-scopedtables.c
tree-ssa-scopedtables.h
tree-ssa-sink.c re PR tree-optimization/91355 (optimized code does not call destructor while unwinding after exception) 2019-11-21 11:59:27 +01:00
tree-ssa-strlen.c re PR tree-optimization/92691 (ICE in strlen_dom_walker::before_dom_children at gcc/tree-ssa-strlen.c:5177 since r274933) 2019-11-28 09:36:06 +01:00
tree-ssa-strlen.h
tree-ssa-structalias.c cfganal.c (pre_and_rev_post_order_compute_fn): Use an auto_bb_flag instead of an sbitmap for visited handling. 2019-11-21 08:39:53 +00:00
tree-ssa-tail-merge.c
tree-ssa-ter.c
tree-ssa-ter.h
tree-ssa-threadbackward.c
tree-ssa-threadedge.c
tree-ssa-threadedge.h
tree-ssa-threadupdate.c
tree-ssa-threadupdate.h
tree-ssa-uncprop.c
tree-ssa-uninit.c
tree-ssa.c re PR tree-optimization/92645 (Hand written vector code is 450 times slower when compiled with GCC compared to Clang) 2019-12-03 07:36:14 +00:00
tree-ssa.h
tree-ssanames.c
tree-ssanames.h
tree-stdarg.c
tree-stdarg.h
tree-streamer-in.c
tree-streamer-out.c
tree-streamer.c
tree-streamer.h
tree-switch-conversion.c Remove dead code in switch conv pass. 2019-11-14 12:04:45 +00:00
tree-switch-conversion.h Remove dead code in switch conv pass. 2019-11-14 12:04:45 +00:00
tree-tailcall.c
tree-vect-data-refs.c Reject versioning for alignment with different masks (PR 92526) 2019-11-21 17:45:36 +00:00
tree-vect-generic.c target.def (TARGET_VECTORIZE_BUILTIN_CONVERSION): Remove. 2019-11-27 12:22:02 +00:00
tree-vect-loop-manip.c Replace vec_info::vector_size with vec_info::vector_mode 2019-11-14 15:05:37 +00:00
tree-vect-loop.c re PR tree-optimization/92742 (ICE in info_for_reduction, at tree-vect-loop.c:4367) 2019-12-02 10:50:45 +00:00
tree-vect-patterns.c Record the vector mask precision in stmt_vec_info 2019-11-29 14:47:39 +00:00
tree-vect-slp.c re PR fortran/91003 (ICE when compiling LAPACK (CGEGV) with optimization) 2019-11-29 19:54:25 +00:00
tree-vect-stmts.c Don't defer choice of vector type for bools (PR 92596) 2019-11-29 14:47:44 +00:00
tree-vector-builder.c
tree-vector-builder.h
tree-vectorizer.c Support vectorisation with mixed vector sizes 2019-11-14 15:12:58 +00:00
tree-vectorizer.h Record the vector mask precision in stmt_vec_info 2019-11-29 14:47:39 +00:00
tree-vrp.c Change fold_range to return a boolean result. 2019-11-14 22:29:56 +00:00
tree-vrp.h
tree.c Fix bugs relating to flexibly-sized objects in nios2 backend. 2019-12-01 22:52:15 -05:00
tree.def
tree.h Fix bugs relating to flexibly-sized objects in nios2 backend. 2019-12-01 22:52:15 -05:00
treestruct.def
tsan.c
tsan.h
tsystem.h
typeclass.h
typed-splay-tree.c
typed-splay-tree.h
ubsan.c PR 92463 - Cleanups due to minimum MPFR version bump to 3.1.0 2019-11-27 10:16:24 +01:00
ubsan.h
unique-ptr-tests.cc
valtrack.c
valtrack.h
value-prof.c
value-prof.h
value-range.cc
value-range.h Remove higher precision range tests because they are unused. 2019-11-14 07:55:04 +00:00
var-tracking.c
varasm.c cgraph.h (symtab_node): Add symver flag. 2019-11-30 21:03:25 +00:00
varasm.h
varpool.c cgraph.h (symtab_node): Add symver flag. 2019-11-30 21:03:25 +00:00
vec-perm-indices.c
vec-perm-indices.h
vec.c
vec.h cfgloop.h (loop_iterator::~loop_iterator): Remove. 2019-11-21 13:46:18 +00:00
vector-builder.h
version.c
version.h
vmsdbg.h
vmsdbgout.c
vr-values.c
vr-values.h
vtable-verify.c
vtable-verify.h
web.c
wide-int-bitmask.h
wide-int-print.cc
wide-int-print.h
wide-int.cc
wide-int.h
xcoff.h
xcoffout.c
xcoffout.h

Copyright (C) 2000-2019 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 now 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
---------------

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.


Avoid unnecessary test before free
----------------------------------

Since SunOS 4 stopped being a reasonable portability target,
(which happened around 2007) there has been no need to guard
against "free (NULL)".  Thus, any guard like the following
constitutes a redundant test:

  if (P)
    free (P);

It is better to avoid the test.[*]
Instead, simply free P, regardless of whether it is NULL.

[*] However, if your profiling exposes a test like this in a
performance-critical loop, say where P is nearly always NULL, and
the cost of calling free on a NULL pointer would be prohibitively
high, consider using __builtin_expect, e.g., like this:

  if (__builtin_expect (ptr != NULL, 0))
    free (ptr);



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.