gcc/gcc
Ian Lance Taylor 3d6d2a63b2 re PR go/67101 (mprof.goc:408:5: error: calling ‘__builtin_frame_address’ with a nonzero argument is unsafe [-Werror=frame-address])
PR go/67101

    runtime: Remove call to __builtin_frame_address.
    
    __builtin_frame_address was only supposed to use nonzero arguments
    for debugging purposes.  Calling it with nonzero arguments can have
    unpredictable results and uses are now marked unsafe when
    -Wframe-address is enabled.
    
    Reviewed-on: https://go-review.googlesource.com/13063

From-SVN: r226525
2015-08-03 17:54:50 +00:00
..
ada re PR other/66259 (Combined gcc and binutils build from git-master fails, with gas/as-new not existing) 2015-07-24 12:20:44 -06:00
c re PR c/67088 (Incorrect location of error on invalid type used in bit-field declaration) 2015-08-03 13:55:28 +00:00
c-family c.opt (-Wframe-address): New warning option. 2015-08-02 17:14:18 -06:00
common
config re PR target/67060 (FAIL: gcc.dg/pr56228.c (test for excess errors)) 2015-08-03 17:26:19 +00:00
cp Refactor entry point to -Wmisleading-indentation 2015-08-02 17:31:55 +00:00
doc vector.md (VEC_L): Add KFmode and TFmode. 2015-08-03 17:06:24 +00:00
fortran re PR fortran/66942 (trans-expr.c:5701 runtime error: member call on null pointer of type 'struct vec') 2015-08-03 16:56:39 +00:00
ginclude
go re PR go/67101 (mprof.goc:408:5: error: calling ‘__builtin_frame_address’ with a nonzero argument is unsafe [-Werror=frame-address]) 2015-08-03 17:54:50 +00:00
java opth-gen.awk: Check for UNKNOWN_LOCATION rather than GCC_TM_H, don't include input.h. 2015-07-15 19:50:23 +00:00
jit jit: supply MULTILIB_DEFAULTS as arguments when invoking driver 2015-07-23 21:19:07 +00:00
lto gimple-pretty-print.h: Don't include pretty-print.h. 2015-07-15 19:57:03 +00:00
objc
objcp
po * sv.po: Update. 2015-07-31 01:49:18 +01:00
testsuite Add a testcase for PR tree-optimization/67077 2015-08-03 09:58:03 -07:00
ABOUT-GCC-NLS
acinclude.m4 re PR other/66259 (Combined gcc and binutils build from git-master fails, with gas/as-new not existing) 2015-07-24 12:20:44 -06:00
aclocal.m4
addresses.h
alias.c Revert: 2015-07-24 21:28:21 -04:00
alias.h
alloc-pool.c
alloc-pool.h Add new object_allocator and clean-up allocator usage. 2015-07-16 11:26:05 +00:00
asan.c Add new object_allocator and clean-up allocator usage. 2015-07-16 11:26:05 +00:00
asan.h
attribs.c
attribs.h
auto-inc-dec.c
auto-profile.c
auto-profile.h
backend.h
BASE-VER
basic-block.h
bb-reorder.c
bb-reorder.h
bitmap.c
bitmap.h
bt-load.c
builtin-attrs.def
builtin-types.def
builtins.c c.opt (-Wframe-address): New warning option. 2015-08-02 17:14:18 -06:00
builtins.def
builtins.h
caller-save.c
calls.c re PR rtl-optimization/66891 (ICE in expand_call, at calls.c:3407) 2015-07-17 08:32:58 +02:00
calls.h
ccmp.c
ccmp.h
cfg-flags.def
cfg.c Add new object_allocator and clean-up allocator usage. 2015-07-16 11:26:05 +00:00
cfg.h
cfganal.c
cfganal.h
cfgbuild.c
cfgbuild.h
cfgcleanup.c
cfgcleanup.h
cfgexpand.c Use lowpart_subreg instead of simplify_gen_subreg 2015-07-31 00:25:29 +03:00
cfgexpand.h Revert: 2015-07-24 21:28:21 -04:00
cfghooks.c
cfghooks.h
cfgloop.c
cfgloop.h
cfgloopanal.c
cfgloopmanip.c
cfgloopmanip.h
cfgrtl.c
cfgrtl.h
cgraph.c
cgraph.h
cgraphbuild.c
cgraphclones.c
cgraphunit.c
ChangeLog re PR target/67060 (FAIL: gcc.dg/pr56228.c (test for excess errors)) 2015-08-03 17:26:19 +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.dataflow
ChangeLog.gimple-classes
ChangeLog.graphite
ChangeLog.jit
ChangeLog.lib
ChangeLog.ptr
ChangeLog.tree-ssa
ChangeLog.tuples
chkp-builtins.def
cif-code.def
cilk-builtins.def
cilk-common.c
cilk.h
cilkplus.def
collect2-aix.c
collect2-aix.h
collect2.c
collect2.h
collect-utils.c
collect-utils.h
combine-stack-adj.c
combine.c Use lowpart_subreg instead of simplify_gen_subreg 2015-07-31 00:25:29 +03:00
common.md
common.opt Revert: 2015-07-24 21:28:21 -04:00
compare-elim.c
conditions.h
config.build
config.gcc
config.host S390: Clean up cross-compile for S390. 2015-07-25 18:34:15 +00:00
config.in remove tree-browser 2015-07-25 09:29:11 +00:00
configure configure.ac: Set aliasing_flags to -fno-strict-aliasing if... 2015-08-03 11:48:57 +00:00
configure.ac configure.ac: Set aliasing_flags to -fno-strict-aliasing if... 2015-08-03 11:48:57 +00:00
context.c
context.h
convert.c
convert.h
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
coretypes.h
coverage.c
coverage.h
cppbuiltin.c
cppbuiltin.h
cppdefault.c
cppdefault.h
cprop.c
cse.c [obvious] Use std::swap instead of manually swapping in a few more places 2015-07-24 16:46:04 +00:00
cselib.c Add new object_allocator and clean-up allocator usage. 2015-07-16 11:26:05 +00:00
cselib.h Add new object_allocator and clean-up allocator usage. 2015-07-16 11:26:05 +00:00
cstamp-h.in
data-streamer-in.c
data-streamer-out.c
data-streamer.c
data-streamer.h
DATESTAMP Daily bump. 2015-08-03 00:16:11 +00:00
dbgcnt.c
dbgcnt.def
dbgcnt.h
dbxout.c
dbxout.h
dce.c
dce.h
ddg.c
ddg.h
debug.c
debug.h
defaults.h
DEV-PHASE
df-core.c
df-problems.c Add new object_allocator and clean-up allocator usage. 2015-07-16 11:26:05 +00:00
df-scan.c Add new object_allocator and clean-up allocator usage. 2015-07-16 11:26:05 +00:00
df.h Add new object_allocator and clean-up allocator usage. 2015-07-16 11:26:05 +00:00
dfp.c
dfp.h
diagnostic-color.c
diagnostic-color.h
diagnostic-core.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 Add new object_allocator and clean-up allocator usage. 2015-07-16 11:26:05 +00:00
dumpfile.c
dumpfile.h
dwarf2asm.c
dwarf2asm.h
dwarf2cfi.c
dwarf2out.c re PR lto/66468 (ICE in in check_die, at dwarf2out.c:5719) 2015-07-27 12:57:15 -04:00
dwarf2out.h
emit-rtl.c Use lowpart_subreg instead of simplify_gen_subreg 2015-07-31 00:25:29 +03:00
emit-rtl.h
errors.c
errors.h
et-forest.c Add new object_allocator and clean-up allocator usage. 2015-07-16 11:26:05 +00:00
et-forest.h Add new object_allocator and clean-up allocator usage. 2015-07-16 11:26:05 +00:00
except.c target-insns.def (eh_return): New targetm instruction pattern. 2015-07-28 19:54:06 +00:00
except.h
exec-tool.in
explow.c Revert: 2015-07-24 21:28:21 -04:00
explow.h Revert: 2015-07-24 21:28:21 -04:00
expmed.c arm.c (neon_element_bits, [...]): Call GET_MODE_INNER unconditionally. 2015-07-28 20:31:17 +00:00
expmed.h
expr.c Use lowpart_subreg instead of simplify_gen_subreg 2015-07-31 00:25:29 +03:00
expr.h
fibonacci_heap.h
file-find.c
file-find.h
final.c
fixed-value.c
fixed-value.h
flag-types.h
flags.h
fold-const.c fold-const.c (fold_binary_loc): Remove X ^ C1 == C2 -> X == (C1 ^ C2) which is already implemented in match.pd. 2015-07-31 10:36:56 +00:00
fold-const.h
fp-test.c
FSFChangeLog
FSFChangeLog.10
FSFChangeLog.11
function.c target-insns.def (eh_return): New targetm instruction pattern. 2015-07-28 19:54:06 +00:00
function.h
fwprop.c
gcc-ar.c
gcc-main.c
gcc-plugin.h
gcc-symtab.h
gcc.c
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 read-md.h (message_with_line, [...]): Delete. 2015-07-16 13:52:22 +00:00
genattr.c read-md.h (message_with_line, [...]): Delete. 2015-07-16 13:52:22 +00:00
genattrtab.c genattrtab.c (make_canonical): Add a file_location parameter. 2015-07-16 13:55:50 +00:00
genautomata.c read-md.h (message_with_line, [...]): Delete. 2015-07-16 13:52:22 +00:00
gencheck.c
genchecksum.c
gencodes.c read-md.h (message_with_line, [...]): Delete. 2015-07-16 13:52:22 +00:00
genconditions.c read-md.h (message_with_line, [...]): Delete. 2015-07-16 13:52:22 +00:00
genconfig.c read-md.h (message_with_line, [...]): Delete. 2015-07-16 13:52:22 +00:00
genconstants.c
genemit.c genemit.c (print_code, [...]): Remove declarations. 2015-07-20 15:57:19 +00:00
genenums.c
generic-match-head.c generic-match-head.c: Include cgraph.h. 2015-07-23 14:31:44 +00:00
generic-match.h
genextract.c read-md.h (message_with_line, [...]): Delete. 2015-07-16 13:52:22 +00:00
genflags.c read-md.h (message_with_line, [...]): Delete. 2015-07-16 13:52:22 +00:00
gengenrtl.c
gengtype-lex.l
gengtype-parse.c
gengtype-state.c
gengtype.c
gengtype.h
genhooks.c
genmatch.c genmatch.c (simplify::for_subst_vec): New member. 2015-08-03 13:28:46 +00:00
genmddeps.c
genmddump.c read-md.h (message_with_line, [...]): Delete. 2015-07-16 13:52:22 +00:00
genmodes.c arm.c (neon_element_bits, [...]): Call GET_MODE_INNER unconditionally. 2015-07-28 20:31:17 +00:00
genmultilib
genopinit.c read-md.h (message_with_line, [...]): Delete. 2015-07-16 13:52:22 +00:00
genoutput.c read-md.h (message_with_line, [...]): Delete. 2015-07-16 13:52:22 +00:00
genpeep.c read-md.h (message_with_line, [...]): Delete. 2015-07-16 13:52:22 +00:00
genpreds.c read-md.h (message_with_line, [...]): Delete. 2015-07-16 13:52:22 +00:00
genrecog.c read-md.h (message_with_line, [...]): Delete. 2015-07-16 13:52:22 +00:00
gensupport.c read-md.h (message_with_line, [...]): Delete. 2015-07-16 13:52:22 +00:00
gensupport.h read-md.h (message_with_line, [...]): Delete. 2015-07-16 13:52:22 +00:00
gentarget-def.c read-md.h (message_with_line, [...]): Delete. 2015-07-16 13:52:22 +00:00
ggc-common.c
ggc-internal.h
ggc-none.c
ggc-page.c
ggc.h
gimple-builder.c
gimple-builder.h
gimple-expr.c Revert: 2015-07-24 21:28:21 -04:00
gimple-expr.h Revert: 2015-07-24 21:28:21 -04:00
gimple-fold.c gimple-fold.c (fold_gimple_assign): Remove folding of the comparison in COND_EXPRs. 2015-08-03 07:28:11 +00:00
gimple-fold.h
gimple-iterator.c
gimple-iterator.h
gimple-laddress.c
gimple-low.c
gimple-low.h
gimple-match-head.c gimple-match-head.c (gimple_simplify): For [VEC_]COND_EXPRs on the rhs of assignments first simplify the embedded... 2015-08-03 07:27:40 +00:00
gimple-match.h
gimple-predict.h
gimple-pretty-print.c
gimple-pretty-print.h gimple-pretty-print.h: Don't include pretty-print.h. 2015-07-15 19:57:03 +00:00
gimple-ssa-isolate-paths.c
gimple-ssa-strength-reduction.c
gimple-ssa.h
gimple-streamer-in.c gimple-pretty-print.h: Don't include pretty-print.h. 2015-07-15 19:57:03 +00:00
gimple-streamer-out.c gimple-pretty-print.h: Don't include pretty-print.h. 2015-07-15 19:57:03 +00:00
gimple-streamer.h gimple-pretty-print.h: Don't include pretty-print.h. 2015-07-15 19:57:03 +00:00
gimple-walk.c
gimple-walk.h
gimple.c
gimple.def
gimple.h gimple.h (gimple_cond_make_false): Use 0 != 0. 2015-07-23 07:22:06 +00:00
gimplify-me.c
gimplify-me.h
gimplify.c gimplify.c (omp_default_clause): New function. 2015-07-24 16:13:04 +00:00
gimplify.h
glimits.h
godump.c
graph.c
graph.h
graphds.c
graphds.h
graphite-blocking.c configure.ac: Add check for new options in isl-0.15. 2015-07-21 12:33:35 -06:00
graphite-dependences.c configure.ac: Add check for new options in isl-0.15. 2015-07-21 12:33:35 -06:00
graphite-interchange.c configure.ac: Add check for new options in isl-0.15. 2015-07-21 12:33:35 -06:00
graphite-isl-ast-to-gimple.c configure.ac: Add check for new options in isl-0.15. 2015-07-21 12:33:35 -06:00
graphite-isl-ast-to-gimple.h
graphite-optimize-isl.c configure.ac: Add check for new options in isl-0.15. 2015-07-21 12:33:35 -06:00
graphite-poly.c configure.ac: Add check for new options in isl-0.15. 2015-07-21 12:33:35 -06:00
graphite-poly.h configure.ac: Add check for new options in isl-0.15. 2015-07-21 12:33:35 -06:00
graphite-scop-detection.c dump reasons why graphite failed to detect a scop 2015-07-25 09:22:29 +00:00
graphite-scop-detection.h [graphite] fix pr61929 2015-07-17 16:34:21 +00:00
graphite-sese-to-poly.c Allow non-overflow ops in reductions 2015-08-01 08:29:29 +00:00
graphite-sese-to-poly.h
graphite.c configure.ac: Add check for new options in isl-0.15. 2015-07-21 12:33:35 -06:00
gsstruct.def
gstab.h
gsyms.h
gsyslimits.h
gtm-builtins.def
haifa-sched.c
hard-reg-set.h
hash-map-traits.h
hash-map.h
hash-set.h hash_set: add iterator and remove method. 2015-07-16 14:11:52 +00:00
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
hw-doloop.c
hw-doloop.h
hwint.c
hwint.h
ifcvt.c [RTL-ifcvt] Improve conditional select ops on immediates 2015-08-03 08:14:42 +00:00
ifcvt.h
inchash.c
inchash.h
incpath.c
incpath.h
init-regs.c
input.c
input.h
insn-addr.h
insn-notes.def
internal-fn.c
internal-fn.def
internal-fn.h
intl.c
intl.h
ipa-chkp.c
ipa-chkp.h
ipa-comdats.c
ipa-cp.c Add new object_allocator and clean-up allocator usage. 2015-07-16 11:26:05 +00:00
ipa-devirt.c * ipa-devirt.c (types_same_for_odr): Fix typo. 2015-07-27 19:36:40 +00:00
ipa-icf-gimple.c
ipa-icf-gimple.h
ipa-icf.c gimple-pretty-print.h: Don't include pretty-print.h. 2015-07-15 19:57:03 +00:00
ipa-icf.h
ipa-inline-analysis.c re PR ipa/66566 ([CHKP] ICE in early_inliner: internal compiler error: in operator[], at vec.h:714) 2015-07-24 13:15:49 +00:00
ipa-inline-transform.c
ipa-inline.c
ipa-inline.h
ipa-polymorphic-call.c gimple-pretty-print.h: Don't include pretty-print.h. 2015-07-15 19:57:03 +00:00
ipa-profile.c Add new object_allocator and clean-up allocator usage. 2015-07-16 11:26:05 +00:00
ipa-prop.c re PR ipa/66896 (ipa-prop.c:2479 runtime error: member call on null pointer of type 'struct ipa_polymorphic_call_context') 2015-07-16 14:48:18 +00:00
ipa-prop.h Add new object_allocator and clean-up allocator usage. 2015-07-16 11:26:05 +00:00
ipa-pure-const.c gimple-pretty-print.h: Don't include pretty-print.h. 2015-07-15 19:57:03 +00:00
ipa-ref.c
ipa-ref.h
ipa-reference.c
ipa-reference.h
ipa-split.c
ipa-utils.c
ipa-utils.h
ipa-visibility.c
ipa.c
ira-build.c Add new object_allocator and clean-up allocator usage. 2015-07-16 11:26:05 +00:00
ira-color.c re PR rtl-optimization/66626 (gcc.dg/torture/stackalign/non-local-goto-5.c segfaults w/ -mregparm=3 or -miamcu) 2015-07-16 15:26:35 +00:00
ira-conflicts.c
ira-costs.c re PR rtl-optimization/66626 (gcc.dg/torture/stackalign/non-local-goto-5.c segfaults w/ -mregparm=3 or -miamcu) 2015-07-16 15:26:35 +00:00
ira-emit.c
ira-int.h
ira-lives.c
ira.c
ira.h re PR rtl-optimization/66626 (gcc.dg/torture/stackalign/non-local-goto-5.c segfaults w/ -mregparm=3 or -miamcu) 2015-07-16 15:26:35 +00:00
is-a.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 Use lowpart_subreg instead of simplify_gen_subreg 2015-07-31 00:25:29 +03:00
loop-unroll.c
loop-unroll.h
lower-subreg.c
lower-subreg.h
lra-assigns.c re PR rtl-optimization/66626 (gcc.dg/torture/stackalign/non-local-goto-5.c segfaults w/ -mregparm=3 or -miamcu) 2015-07-16 15:26:35 +00:00
lra-coalesce.c
lra-constraints.c re PR rtl-optimization/66626 (gcc.dg/torture/stackalign/non-local-goto-5.c segfaults w/ -mregparm=3 or -miamcu) 2015-07-16 15:26:35 +00:00
lra-eliminations.c [obvious] Use std::swap instead of manually swapping in a few more places 2015-07-24 16:46:04 +00:00
lra-int.h Add new object_allocator and clean-up allocator usage. 2015-07-16 11:26:05 +00:00
lra-lives.c Add new object_allocator and clean-up allocator usage. 2015-07-16 11:26:05 +00:00
lra-remat.c re PR ipa/66424 (wrong code at -O2 and -O3 on x86_64-linux-gnu in 32-bit mode) 2015-07-21 19:54:23 +00:00
lra-spills.c
lra.c Add new object_allocator and clean-up allocator usage. 2015-07-16 11:26:05 +00:00
lra.h
lto-cgraph.c gimple-pretty-print.h: Don't include pretty-print.h. 2015-07-15 19:57:03 +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 gimple-pretty-print.h: Don't include pretty-print.h. 2015-07-15 19:57:03 +00:00
lto-streamer-out.c arm.c (neon_element_bits, [...]): Call GET_MODE_INNER unconditionally. 2015-07-28 20:31:17 +00:00
lto-streamer.c gimple-pretty-print.h: Don't include pretty-print.h. 2015-07-15 19:57:03 +00:00
lto-streamer.h
lto-wrapper.c
machmode.def
machmode.h arm.c (neon_element_bits, [...]): Call GET_MODE_INNER unconditionally. 2015-07-28 20:31:17 +00:00
main.c
Makefile.in * Makefile.in (OBJS): Put gimple-match.o and generic-match.o first. 2015-08-03 17:33:45 +02:00
match.pd genmatch.c (simplify::for_subst_vec): New member. 2015-08-03 13:45:22 +00:00
mcf.c
mem-stats-traits.h
mem-stats.h
mkconfig.sh
mode-classes.def
mode-switching.c
modulo-sched.c
omp-builtins.def
omp-low.c Don't cancel loop tree in parloops 2015-07-31 06:26:44 +00:00
omp-low.h
ONEWS
opt-functions.awk
opt-gather.awk
opt-include.awk
opt-read.awk
optabs.c target-insns.def (atomic_test_and_set): New targetm instruction pattern. 2015-07-28 20:03:22 +00:00
optabs.def
optabs.h
optc-gen.awk
optc-save-gen.awk
opth-gen.awk opth-gen.awk: Check for UNKNOWN_LOCATION rather than GCC_TM_H, don't include input.h. 2015-07-15 19:50:23 +00:00
opts-common.c Honour DriverOnly for enum values in error messages 2015-07-28 05:51:01 +00:00
opts-diagnostic.h
opts-global.c
opts.c Revert: 2015-07-24 21:28:21 -04:00
opts.h
output.h
params.c
params.def [graphite] reduce the number of params in a scop to 3 2015-07-29 21:28:27 +00:00
params.h
pass_manager.h
passes.c
passes.def Revert: 2015-07-24 21:28:21 -04:00
plugin.c
plugin.def
plugin.h
postreload-gcse.c
postreload.c
predict.c
predict.def
predict.h
prefix.c
prefix.h
pretty-print.c
pretty-print.h
print-rtl.c
print-rtl.h
print-tree.c
print-tree.h
profile.c
profile.h
read-md.c read-md.h (message_with_line, [...]): Delete. 2015-07-16 13:52:22 +00:00
read-md.h read-md.h (message_with_line, [...]): Delete. 2015-07-16 13:52:22 +00:00
read-rtl.c remove some usage of expr_list from read_rtx 2015-07-15 14:38:13 +00:00
README.Portability
real.c
real.h
realmpfr.c
realmpfr.h
recog.c
recog.h
ree.c
reg-notes.def
reg-stack.c
regcprop.c Add new object_allocator and clean-up allocator usage. 2015-07-16 11:26:05 +00:00
regcprop.h
reginfo.c
regrename.c
regrename.h
regs.h
regset.h
regstat.c
reload1.c target-insns.def (reload_load_address): New targetm instruction pattern. 2015-07-28 20:06:57 +00:00
reload.c
reload.h
reorg.c
resource.c
resource.h
rtl-chkp.c
rtl-chkp.h
rtl-error.c
rtl-error.h
rtl-iter.h
rtl.c
rtl.def
rtl.h Use lowpart_subreg instead of simplify_gen_subreg 2015-07-31 00:25:29 +03:00
rtlanal.c arm.c (neon_element_bits, [...]): Call GET_MODE_INNER unconditionally. 2015-07-28 20:31:17 +00:00
rtlhash.c
rtlhash.h
rtlhooks-def.h
rtlhooks.c
sanitizer.def
sanopt.c
sbitmap.c
sbitmap.h
sched-deps.c Add new object_allocator and clean-up allocator usage. 2015-07-16 11:26:05 +00:00
sched-ebb.c
sched-int.h
sched-rgn.c
sched-vis.c
sdbout.c
sdbout.h
sel-sched-dump.c
sel-sched-dump.h
sel-sched-ir.c Add new object_allocator and clean-up allocator usage. 2015-07-16 11:26:05 +00:00
sel-sched-ir.h Add new object_allocator and clean-up allocator usage. 2015-07-16 11:26:05 +00:00
sel-sched.c
sel-sched.h
sese.c
sese.h
shrink-wrap.c
shrink-wrap.h
signop.h
simplify-rtx.c Use lowpart_subreg instead of simplify_gen_subreg 2015-07-31 00:25:29 +03:00
sparseset.c
sparseset.h
sreal.c
sreal.h
ssa-iterators.h ssa-iterators.h (has_zero_uses, [...]): Implement as straight loops. 2015-07-21 19:15:13 +00:00
ssa.h
stab.def
stack-ptr-mod.c
statistics.c
statistics.h
stmt.c Add new object_allocator and clean-up allocator usage. 2015-07-16 11:26:05 +00:00
stmt.h
stor-layout.c arm.c (neon_element_bits, [...]): Call GET_MODE_INNER unconditionally. 2015-07-28 20:31:17 +00:00
stor-layout.h
store-motion.c
streamer-hooks.c
streamer-hooks.h
stringpool.c
stringpool.h
symbol-summary.h
symtab.c
sync-builtins.def
system.h
target-def.h
target-globals.c
target-globals.h
target-hooks-macros.h
target-insns.def target-insns.def (reload_load_address): New targetm instruction pattern. 2015-07-28 20:06:57 +00:00
target.def
target.h
targhooks.c
targhooks.h
timevar.c
timevar.def
timevar.h
tlink.c
toplev.c re PR c++/64079 (%+D in diagnostics breaks pragma GCC diagnostic) 2015-07-24 20:20:13 +00:00
toplev.h
tracer.c
trans-mem.c
trans-mem.h
tree-affine.c
tree-affine.h
tree-call-cdce.c
tree-cfg.c re PR libgomp/66714 (ICE in loc_list_from_tree with -g) 2015-07-24 07:38:43 -07:00
tree-cfg.h gimple-fold.c (fold_gimple_cond): Do not require folding results to pass valid_gimple_rhs_p. 2015-07-23 13:33:43 +00:00
tree-cfgcleanup.c
tree-cfgcleanup.h
tree-chkp-opt.c
tree-chkp.c
tree-chkp.h
tree-chrec.c
tree-chrec.h
tree-complex.c
tree-core.h
tree-data-ref.c fix pr46851 and pr60340: remove unmaintained omega dependence test 2015-07-18 01:11:05 +00:00
tree-data-ref.h fix pr46851 and pr60340: remove unmaintained omega dependence test 2015-07-18 01:11:05 +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
tree-hasher.h
tree-if-conv.c
tree-inline.c gimple-fold.c (fold_gimple_cond): Do not require folding results to pass valid_gimple_rhs_p. 2015-07-23 13:33:43 +00:00
tree-inline.h
tree-into-ssa.c
tree-into-ssa.h
tree-iterator.c
tree-iterator.h
tree-loop-distribution.c
tree-nested.c
tree-nested.h
tree-nrv.c
tree-object-size.c
tree-object-size.h
tree-outof-ssa.c Revert: 2015-07-24 21:28:21 -04:00
tree-outof-ssa.h
tree-parloops.c Don't cancel loop tree in parloops 2015-07-31 06:26:44 +00:00
tree-parloops.h
tree-pass.h tree-pass.h (get_current_pass_name): Removed. 2015-07-23 19:01:03 +00:00
tree-phinodes.c
tree-phinodes.h
tree-predcom.c
tree-pretty-print.c
tree-pretty-print.h
tree-profile.c
tree-scalar-evolution.c
tree-scalar-evolution.h
tree-sra.c Add new object_allocator and clean-up allocator usage. 2015-07-16 11:26:05 +00:00
tree-ssa-address.c
tree-ssa-address.h
tree-ssa-alias.c
tree-ssa-alias.h
tree-ssa-ccp.c
tree-ssa-coalesce.c Revert: 2015-07-24 21:28:21 -04:00
tree-ssa-coalesce.h Revert: 2015-07-24 21:28:21 -04:00
tree-ssa-copy.c
tree-ssa-copyrename.c Revert: 2015-07-24 21:28:21 -04:00
tree-ssa-dce.c
tree-ssa-dom.c tree-ssa-dom.c (dom_valueize): New function. 2015-07-16 07:19:24 +00:00
tree-ssa-dom.h
tree-ssa-dse.c
tree-ssa-forwprop.c
tree-ssa-ifcombine.c re PR tree-optimization/66952 (wrong code at -O2 and -O3 on x86_64-linux-gnu) 2015-07-22 11:31:50 +00:00
tree-ssa-live.c Revert: 2015-07-24 21:28:21 -04:00
tree-ssa-live.h Revert: 2015-07-24 21:28:21 -04:00
tree-ssa-loop-ch.c
tree-ssa-loop-im.c
tree-ssa-loop-ivcanon.c
tree-ssa-loop-ivopts.c tree-ssa-loop-ivopts.c (add_candidate): Remove call to add_autoinc_candidates. 2015-07-16 05:49:47 +00:00
tree-ssa-loop-ivopts.h
tree-ssa-loop-manip.c
tree-ssa-loop-manip.h
tree-ssa-loop-niter.c
tree-ssa-loop-niter.h
tree-ssa-loop-prefetch.c
tree-ssa-loop-unswitch.c
tree-ssa-loop.c fix pr46851 and pr60340: remove unmaintained omega dependence test 2015-07-18 01:11:05 +00:00
tree-ssa-loop.h
tree-ssa-math-opts.c re PR tree-optimization/66828 (gcc/tree-ssa-math-opts.c:2182:38: runtime error: left shift of 72057594037927936 by 8 places cannot be represented in type 'long int') 2015-07-28 06:54:50 +00:00
tree-ssa-operands.c ssa-iterators.h (has_zero_uses, [...]): Implement as straight loops. 2015-07-21 19:15:13 +00:00
tree-ssa-operands.h
tree-ssa-phiopt.c fix pr46851 and pr60340: remove unmaintained omega dependence test 2015-07-18 01:11:05 +00:00
tree-ssa-phiprop.c
tree-ssa-pre.c Add new object_allocator and clean-up allocator usage. 2015-07-16 11:26:05 +00:00
tree-ssa-propagate.c re PR middle-end/66945 (ICE in generic_simplify (generic-match.c:24790)) 2015-07-23 07:23:23 +00:00
tree-ssa-propagate.h
tree-ssa-reassoc.c Add new object_allocator and clean-up allocator usage. 2015-07-16 11:26:05 +00:00
tree-ssa-sccvn.c generic-match-head.c: Include cgraph.h. 2015-07-23 14:31:44 +00:00
tree-ssa-sccvn.h
tree-ssa-scopedtables.c
tree-ssa-scopedtables.h
tree-ssa-sink.c
tree-ssa-strlen.c Add new object_allocator and clean-up allocator usage. 2015-07-16 11:26:05 +00:00
tree-ssa-structalias.c Add new object_allocator and clean-up allocator usage. 2015-07-16 11:26:05 +00:00
tree-ssa-tail-merge.c
tree-ssa-ter.c
tree-ssa-ter.h
tree-ssa-threadedge.c revert: re PR lto/66752 (spec2000 255.vortex performance compiled with GCC is ~20% lower than with CLANG) 2015-07-24 23:45:42 -06:00
tree-ssa-threadedge.h
tree-ssa-threadupdate.c re PR middle-end/66314 (ice in verify_loop_structure) 2015-08-03 10:26:13 -06:00
tree-ssa-threadupdate.h
tree-ssa-uncprop.c Revert: 2015-07-24 21:28:21 -04:00
tree-ssa-uninit.c Avoid recomputing the defining predicate chains for the same PHI 2015-08-03 14:57:25 +00:00
tree-ssa.c
tree-ssa.h
tree-ssanames.c re PR tree-optimization/66952 (wrong code at -O2 and -O3 on x86_64-linux-gnu) 2015-07-22 11:31:50 +00:00
tree-ssanames.h re PR tree-optimization/66952 (wrong code at -O2 and -O3 on x86_64-linux-gnu) 2015-07-22 11:31:50 +00:00
tree-stdarg.c
tree-stdarg.h
tree-streamer-in.c gimple-pretty-print.h: Don't include pretty-print.h. 2015-07-15 19:57:03 +00:00
tree-streamer-out.c gimple-pretty-print.h: Don't include pretty-print.h. 2015-07-15 19:57:03 +00:00
tree-streamer.c gimple-pretty-print.h: Don't include pretty-print.h. 2015-07-15 19:57:03 +00:00
tree-streamer.h gimple-pretty-print.h: Don't include pretty-print.h. 2015-07-15 19:57:03 +00:00
tree-switch-conversion.c
tree-tailcall.c
tree-vect-data-refs.c re PR tree-optimization/66917 (ARM: NEON: memcpy compiles to vst1 with incorrect alignment) 2015-08-03 07:13:36 +00:00
tree-vect-generic.c
tree-vect-loop-manip.c PR tree-optimization/66926,66951 2015-07-23 11:13:00 +00:00
tree-vect-loop.c Allow non-overflow ops in reductions 2015-08-01 08:29:29 +00:00
tree-vect-patterns.c
tree-vect-slp.c fix pr46851 and pr60340: remove unmaintained omega dependence test 2015-07-18 01:11:05 +00:00
tree-vect-stmts.c re PR tree-optimization/66917 (ARM: NEON: memcpy compiles to vst1 with incorrect alignment) 2015-08-03 07:13:36 +00:00
tree-vectorizer.c
tree-vectorizer.h re PR tree-optimization/66917 (ARM: NEON: memcpy compiles to vst1 with incorrect alignment) 2015-08-03 07:13:36 +00:00
tree-vrp.c re PR tree-optimization/66894 (wrong code at -Os and above on x86_64-linux-gnu) 2015-07-16 11:27:34 +00:00
tree.c Allow non-overflow ops in reductions 2015-08-01 08:29:29 +00:00
tree.def
tree.h Allow non-overflow ops in reductions 2015-08-01 08:29:29 +00:00
treestruct.def
tsan.c
tsan.h
tsystem.h
typeclass.h
typed-splay-tree.h
ubsan.c
ubsan.h
valtrack.c
valtrack.h
value-prof.c
value-prof.h
var-tracking.c Revert: 2015-07-24 21:28:21 -04:00
varasm.c
varasm.h
varpool.c
vec.c
vec.h
version.c
version.h
vmsdbg.h
vmsdbgout.c fix compilation of vmsdbgout.c 2015-07-18 21:09:04 +00:00
vtable-verify.c re PR bootstrap/66521 (xgcc: cc1plus segfaults when compiling libstdc++-v3/src/c++11/ostream-inst.cc) 2015-08-01 18:17:39 -07:00
vtable-verify.h re PR bootstrap/66521 (xgcc: cc1plus segfaults when compiling libstdc++-v3/src/c++11/ostream-inst.cc) 2015-08-01 18:17:39 -07:00
web.c
wide-int-print.cc
wide-int-print.h
wide-int.cc
wide-int.h Fix partial specialization syntax of wide int traits. 2015-07-20 05:30:12 +00:00
xcoff.h
xcoffout.c
xcoffout.h

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

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.


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.