If there is an error constructing the backend type, the GCC backend
will report that the size is 1. That will then cause construction of
the ptrmask to crash. Avoid that case by just generating an empty
ptrmask.
Noticed while compiling a broken package. The policy I've been
following is to not commit a test case for a compiler crash on invalid
code, so no test case.
Reviewed-on: https://go-review.googlesource.com/45775
From-SVN: r249208
XCHAL_* macros from the xtensa-config.h are used in a number of places
that require them to be preprocessor constants. Rewrite these places so
that non-constant XCHAL_* definitions could be used there.
2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
gcc/
* config/xtensa/xtensa.c (xtensa_option_override): Append
MASK_CONST16 to target_flags in the absence of TARGET_L32R.
(hwloop_optimize, hwloop_fail, hwloop_pattern_reg,
xtensa_doloop_hooks): Define unconditionally.
(xtensa_reorg_loops): Only call reorg_loops in the presence of
TARGET_LOOPS.
* config/xtensa/xtensa.h (TARGET_L32R): New definition.
(TARGET_DEFAULT): Remove XCHAL_HAVE_L32R condition and account
for it in xtensa_option_override.
(HARD_FRAME_POINTER_IS_FRAME_POINTER,
HARD_FRAME_POINTER_IS_ARG_POINTER): New definitions.
From-SVN: r249202
Sometimes it is useful to generate pre-processed output to a file and
the dependency information to stdout for further analysis/processing.
For example:
g++ -E -MD -fdirectives-only -o test.ii test.cxx
This will generate the dependency information to test.d (as per the
documentation). While changing this behavior is probably unwise, one
traditional (e.g., supported by -o) way to handle this is to recognize
the special '-' file name as an instruction to write to stdout:
g++ -E -MD -fdirectives-only -o test.ii -MF - test.cxx
Currently this will create a file named '-'. The included patch
changes this behavior to write to stdout.
Note also that Clang has supported this from at least version 3.5.
gcc:
2017-06-14 Boris Kolpackov <boris@codesynthesis.com>
* doc/cppopts.texi: Document '-' special value to -MF.
gcc/c-family:
2017-06-14 Boris Kolpackov <boris@codesynthesis.com>
* c-opts.c (c_common_finish): Handle '-' special value to -MF.
From-SVN: r249201
The Cortex-A53 scheduler model of FMAC bypass is not quite right
for FMAC to FMAC forwarding. Experiments also show the latencies of
FP operations are too high as well. Rather than adding more bypasses,
adjust the latencies of FP instructions to get a better schedule on
average. As a result SPECFP2006 is 1.1% faster.
gcc/
* config/arm/cortex-a53.md (cortex_a53_fpalu) Adjust latency.
(cortex_a53_fconst): Likewise.
(cortex_a53_fpmul): Likewise.
(cortex_a53_f_load_64): Likewise.
(cortex_a53_f_load_many): Likewise.
(cortex_a53_advsimd_alu): Likewise.
(cortex_a53_advsimd_alu_q): Likewise.
(cortex_a53_advsimd_mul): Likewise.
(cortex_a53_advsimd_mul_q): Likewise.
(fpmac bypass): Add new bypass for fpmac-fpmac case.
Add missing fmul, r2f_cvt and fconst cases.
From-SVN: r249200
The go tool will pass -I objdir as one of the flags, where objdir is
the temporary build directory. Remove that from _cgo_flags: we don't
need it, and it will be different each time.
Sort the flags to avoid the unpredictable map iteration order.
This matters for gccgo because for a package that uses cgo, the go
tool when building for gccgo will store the _cgo_flags file in the
archive. That means that we want to generate identical _cgo_flags for
every run.
The test for this is the cmd/go testsuite, to follow in a future CL.
Reviewed-on: https://go-review.googlesource.com/45692
From-SVN: r249199
Pass the -fdebug-prefix-map and -gno-record-gcc-switches compiler
options to gccgo to generate consistent results.
Fix the vendoring code to look for /vendor/, not just /vendor, to
avoid being confused by something like vendor/vendor.org.
Tested by the cmd/go tests in a followup CL.
Reviewed-on: https://go-review.googlesource.com/45695
From-SVN: r249198
These tests fail for various reasons, most commonly because gccgo
doesn't really have GOROOT, so things like `go build errors` fail.
Reviewed-on: https://go-review.googlesource.com/45696
From-SVN: r249197
Add the environment variable GCCGOTOOLDIR to permit overriding the default
directory where tools like cgo are found when building with gccgo.
This will be used by the cmd/go tests in a future CL.
Reviewed-on: https://go-review.googlesource.com/45694
From-SVN: r249196
If GO_TESTING_GOTOOLS is set in the environment, permit tests using
gccgo to run the go tool. Like GO_BUILDER_NAME, this should not be set
normally. But it is needed when testing the go tool itself, and will
be set by the gotools Makefile in a future CL.
Reviewed-on: https://go-review.googlesource.com/45693
From-SVN: r249195
Otherwise if DIR does not exist, the path does not work. This matches
what the gc cmd/compile tool does, because it calls path.Join.
The test for this is the cmd/go tests, to be added in a follow-up CL.
Reviewed-on: https://go-review.googlesource.com/45691
From-SVN: r249194
2017-06-14 Richard Biener <rguenther@suse.de>
PR middle-end/81088
* fold-const.c (split_tree): Drop TREE_OVERFLOW flag from
literal constants.
(fold_binary_loc): When associating do not treat pre-existing
TREE_OVERFLOW on literal constants as a reason to allow
TREE_OVERFLOW on associated literal constants.
* c-c++-common/ubsan/pr81088.c: New testcase.
From-SVN: r249192
* config/sparc/sparc.h (MASK_ISA): Add MASK_LEON and MASK_LEON3.
(MASK_FEATURES): New macro.
* config/sparc/sparc.c (sparc_option_override): Remove the special
handling of -mfpu and generalize it to all MASK_FEATURES switches.
From-SVN: r249189
2017-06-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/81083
* tree-ssa-sccvn.c (vn_reference_lookup_3): Do not use abnormals
as values.
* gcc.dg/torture/pr81083.c: New testcase.
From-SVN: r249182
PR c++/80973
* cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
argument even if it has REFERENCE_TYPE.
* g++.dg/ubsan/pr80973.C: New test.
From-SVN: r249174
* config/rs6000/rs6000.c (SPE_CONST_OFFSET_OK): Delete.
(rs6000_legitimate_offset_address_p): Return false for anything in
V2SImode or V2SFmode.
From-SVN: r249163
This removes the vector modes that were only used by SPE. It also
rearranges things so it is easier to see what is there, and for what.
* config/rs6000/rs6000-modes.def: Remove all 8-byte vector modes
except V2SF and V2SI. Rearrange the vector modes, and add comments.
* config/rs6000/rs6000.c (rs6000_debug_reg_global): Remove V8QImode
and V4HImode.
(reg_offset_addressing_ok_p): Remove V4HImode and V1DImode.
(rs6000_legitimate_offset_address_p): Ditto.
(rs6000_emit_move): Ditto.
(rs6000_init_builtins): Remove V4HI_type_node.
From-SVN: r249162
Fix buglet in Gogo::write_globals-- in a couple of places the
wrong Bfunction was being used for the containing (not target)
function when creating calls for init functions.
Reviewed-on: https://go-review.googlesource.com/45510
From-SVN: r249159
After r249013, die () and dump_stack () are both in cold section. This makes
the compiler generate bl instruction for the function call, instead of
honoring the -mlong-calls option.
This patch changes the dump_stack function call conditional, which fixes the
regression.
gcc/testsuite/
* gcc.target/arm/cold-lc.c: Update coding style, call dump_stack
conditionally.
From-SVN: r249157
If there is no function name, the traceback is generally
uninformative. In earlier versions we did not show such frames.
Restore that behavior. These frames can be seen with GOTRACEBACK=system.
Reviewed-on: https://go-review.googlesource.com/45431
From-SVN: r249156
2017-06-13 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/80803
PR tree-optimization/81063
* tree-sra.c (subtree_mark_written_and_enqueue): Move up in the file.
(propagate_subaccesses_across_link): Enqueue subtree whneve necessary
instead of relying on the caller.
testsuite/
gcc.dg/tree-ssa/pr80803.c: New test.
gcc.dg/tree-ssa/pr81063.c: Likewise.
From-SVN: r249154
2017-06-13 Martin Jambor <mjambor@suse.cz>
* tree-sra.c (add_access_to_work_queue): Only enqueue accesses
that have a first_link.
(sort_and_splice_var_accesses): Do not check first_link before
enquing.
(subtree_mark_written_and_enqueue): Likewise.
(propagate_all_subaccesses): Likewise and do not stop at first
parent with a first_link.
From-SVN: r249153
2017-06-13 Yury Gribov <tetra2005@gmail.com>
gcc/
* tree-vrp.c (is_masked_range_test): New function.
(register_edge_assert_for): Determine ranges for
some bit tests.
From-SVN: r249150