PR sanitizer/81094
* ubsan.c (instrument_null): Add T argument, use it instead
of computing it based on IS_LHS.
(instrument_object_size): Likewise.
(pass_ubsan::execute): Adjust instrument_null and
instrument_object_size callers to pass gimple_get_lhs or
gimple_assign_rhs1 result to it. Use instrument_null instead of
calling get_base_address and instrument_mem_ref. Handle
aggregate call arguments for object-size sanitization.
* c-c++-common/ubsan/object-size-11.c: New test.
From-SVN: r249239
2017-06-15 Janus Weil <janus@gcc.gnu.org>
PR fortran/80983
* trans-expr.c (gfc_conv_procedure_call): Deallocate the result of
scalar allocatable procedure-pointer components.
2017-06-15 Janus Weil <janus@gcc.gnu.org>
PR fortran/80983
* gfortran.dg/proc_ptr_comp_51.f90: New test.
From-SVN: r249227
crtl->is_leaf has a comment above it referring to "Local Register
Allocation". However this is set by IRA and not LRA since the meaning
of Local Register Allocator in GCC has changed quite drastically since
1999 when this comment was introduced above the variable
current_function_is_leaf. From memory gcc in those days had "local"
and "global" register allocation - however all of this has changed
quite a bit drastically since.
This patch merely updates the comment as I did some head scratching
this morning about how this could be set before Local Register
Allocator especially given the comment in ira.c as below.
/* Determine if the current function is a leaf before running IRA
since this can impact optimizations done by the prologue and
epilogue thus changing register elimination offsets. */
crtl->is_leaf = leaf_function_p ();
From-SVN: r249223
PR target/78818
gcc * config/msp430/msp430.c (msp430_data_attr): Check that it's possible
for a variable to have a section before checking if the section has a
name.
Set section to.persistent if persistent attribute is set.
Warn if .persistent attribute is used on an automatic variable.
tests * gcc.target/msp430/pr78818-real.c: New template for tests.
* gcc.target/msp430/pr78818-auto.c: New test.
* gcc.target/msp430/pr78818-data-region.c: New test.
* gcc.target/msp430/pr78818-data-sec.c: New test.
* gcc.target/msp430/pr78818-auto-warn.c: New test.
From-SVN: r249222
2017-06-15 Thomas Preud'homme <thomas.preudhomme@arm.com>
gcc/testsuite/
* gcc.target/arm/its.c: Check that no IT blocks has more than 2
instructions in it rather than the number of IT blocks being 2.
Transfer scan directive arm_thumb2 restriction to the whole
testcase and restrict further to Thumb-only targets.
From-SVN: r249215
The argument could be a subreg of reg instead, which means we have to
use reg_or_subregno instead of REGNO.
* config/rs6000/rs6000.md (add<mode>3): Use reg_or_subregno instead
of REGNO.
From-SVN: r249213
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