Eric Botcazou [Mon, 22 Jul 2019 13:56:50 +0000 (13:56 +0000)]
[Ada] Fix spurious loop warning for function with Out parameter
The compiler gives a spurious warning about a possible infinite while
loop whose condition contains a call to a function that takes an Out or
In/Out parameter and whose actual is a variable that is not modified in
the loop, because it still thinks that functions can only have In
parameters.
2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* sem_warn.adb (Find_Var): Bail out for a function call with an
Out or In/Out parameter.
Nicolas Roche [Mon, 22 Jul 2019 13:56:45 +0000 (13:56 +0000)]
[Ada] Ensure Ctrl-C is not emited on terminated processes
Due to the reuse policy of PID on Windows. Sending a Ctrl-C to a dead
process might result in a Ctrl-C sent to the wrong process. The check is
also implemented on Unix platforms and avoid unecessary waits.
2019-07-22 Nicolas Roche <roche@adacore.com>
gcc/ada/
* terminals.c (__gnat_tty_waitpid): Support both blocking and
not blocking mode.
* libgnat/g-exptty.ads (Is_Process_Running): New function.
* libgnat/g-exptty.adb (Close): Don't try to interrupt/terminate
a process if it is already dead.
----
with Text_IO; use Text_IO;
procedure Conv is
V_P : constant := 10.0 ** (-6);
M_V : constant := 9000.0;
N_V : constant := -9000.0;
type V_T is delta V_P range N_V .. M_V with Small => V_P;
subtype S_T is V_T range 0.0 .. M_V;
function Convert (Input : in S_T) return Long_Float is
begin
Put_Line (Input'Img);
Put_Line (Long_Float'Image (Long_Float (Input)));
return Long_Float (Input);
end Convert;
* freeze.adb (Freeze_Fixed_Point_Type): When freezing a
fixed-point subtype, check whether the parent type declarastion
includes an aspect specification for the 'Small type attribute,
and inherit the specified value.
Javier Miranda [Mon, 22 Jul 2019 13:56:36 +0000 (13:56 +0000)]
[Ada] Crash in C++ constructor without external and link name
The compiler blows up processing the declaration of a tagged type
variable that has a C++ constructor without external or link name. After
this patch the frontend reports an error.
2019-07-22 Javier Miranda <miranda@adacore.com>
gcc/ada/
* freeze.adb (Freeze_Subprogram): Check that C++ constructors
must have external or link name.
Ed Schonberg [Mon, 22 Jul 2019 13:56:31 +0000 (13:56 +0000)]
[Ada] Spurious warning about a useless assignment
This patch removes a spurious warning about a useless assignment, when a
composite object is the target of an assignment and is an actual for an
out parameter in a subsewuent call, and there is an intervening use of
the object as the prefix of a selected component in an intervening
operation.
2019-07-22 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* sem_res.adb (Resolve_Selected_Component): If the prefix has a
deferred reference, generate the correct reference now, to
indicate that the previous assignment is used. This prevents
spurious warnings on useless assignments when compiling with all
warnings enabled. when there is a subsequent call in the same
stqtement list, in which the prefix of the selected component is
the actual for an out parameter.
Eric Botcazou [Mon, 22 Jul 2019 13:56:26 +0000 (13:56 +0000)]
[Ada] Fix internal error on array slice in loop and Loop_Invariant
This fixes an internal error caused by the presence of an Itype in a
wrong scope. This Itype is created for an array slice present in the
condition of a while loop whose body also contains a pragma
Loop_Invariant, initially in the correct scope but then relocated into a
function created for the pragma.
2019-07-22 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* exp_attr.adb (Expand_Loop_Entry_Attribute): Copy the condition
of a while loop instead of simply relocating it.
gcc/testsuite/
* gnat.dg/loop_invariant1.adb, gnat.dg/loop_invariant1.ads: New
testcase.
Richard Biener [Mon, 22 Jul 2019 11:18:55 +0000 (11:18 +0000)]
re PR tree-optimization/91221 (ICE in get_int_cst_ext_nunits, at tree.c:1299 since r273548)
2019-07-22 Richard Biener <rguenther@suse.de>
PR tree-optimization/91221
* tree-ssa-sccvn.c (vn_reference_lookup_3): Appropriately
restrict partial-def handling of empty constructors and
memset to refs with known offset.
Jan Beulich [Mon, 22 Jul 2019 08:07:29 +0000 (08:07 +0000)]
x86/AVX512: improve generated code for bit-wise negation of vectors of integers
NOT on vectors of integers does not require loading a constant vector of
all ones into a register - VPTERNLOG can be used here (and could/should
be further used to carry out other binary and ternary logical operations
which don't have a special purpose instruction).
gcc/
2019-07-22 Jan Beulich <jbeulich@suse.com>
* config/i386/sse.md (ternlogsuffix): New.
(one_cmpl<mode>2): Don't force CONSTM1_RTX into a register when
AVX512F is in use.
(<mask_codefor>one_cmpl<mode>2<mask_name>): New.
Martin Liska [Mon, 22 Jul 2019 07:34:32 +0000 (09:34 +0200)]
Simplify LTO section format.
2019-07-22 Martin Liska <mliska@suse.cz>
* lto-section-in.c (lto_get_section_data):
Use new function get_compression.
* lto-streamer-out.c (produce_lto_section): Use
set_compression to encode compression algorithm.
* lto-streamer.h (struct lto_section): Do not
use bitfields in the format.
Martin Liska [Mon, 22 Jul 2019 07:34:10 +0000 (09:34 +0200)]
Make a warning for -Werror=wrong-language (PR driver/91172).
2019-07-22 Martin Liska <mliska@suse.cz>
PR driver/91172
* opts-common.c (decode_cmdline_option): Decode
argument of -Werror and check it for a wrong language.
* opts-global.c (complain_wrong_lang): Remove such case.
2019-07-22 Martin Liska <mliska@suse.cz>
The force_reg in or1k_expand_compare is hard coded for SImode, which is fine as
this used to only be used on SI expands. However, with FP support this will
cause issues. In general we should only force the right hand operand to a
register if its an immediate. This patch adds an condition to check for that.
gcc/ChangeLog:
* config/or1k/or1k.c (or1k_expand_compare): Check for int before
force_reg.
This adds support for OpenRISC hardware floating point instructions.
This is enabled with the -mhard-float option.
Double-prevision floating point operations work using register pairing as
specified in: https://openrisc.io/proposals/orfpx64a32. This has just been
added in the OpenRISC architecture specification 1.3.
This is enabled with the -mdouble-float option.
Not all architectures support unordered comparisons so an option,
-munordered-float is added.
Currently OpenRISC does not support sf/df or df/sf conversions, but this has
also just been added in architecture specification 1.3.
gcc/ChangeLog:
* config.gcc (or1k*-*-*): Add mhard-float, mdouble-float, msoft-float
and munordered-float validations.
* config/or1k/constraints.md (d): New register constraint.
* config/or1k/predicates.md (fp_comparison_operator): New.
* config/or1k/or1k.c (or1k_print_operand): Add support for printing 'd'
operands.
(or1k_expand_compare): Normalize unordered comparisons.
* config/or1k/or1k.h (reg_class): Define DOUBLE_REGS.
(REG_CLASS_NAMES): Add "DOUBLE_REGS".
(REG_CLASS_CONTENTS): Add contents for DOUBLE_REGS.
* config/or1k/or1k.md (type): Add fpu.
(fpu): New instruction reservation.
(F, f, fr, fi, FI, FOP, fop): New.
(<fop><F:mode>3): New ALU instruction definition.
(float<fi><F:mode>2): New conversion instruction definition.
(fix_trunc<F:mode><fi>2): New conversion instruction definition.
(fpcmpcc): New code iterator.
(*sf_fp_insn): New instruction definition.
(cstore<F:mode>4): New expand definition.
(cbranch<F:mode>4): New expand definition.
* config/or1k/or1k.opt (msoft-float, mhard-float, mdouble-float,
munordered-float): New options.
* doc/invoke.texi: Document msoft-float, mhard-float, mdouble-float and
munordered-float.
* config.gcc (or1k*-*-*): Add mrori and mror to validation.
* doc/invoke.texi (OpenRISC Options): Add mrori option, rewrite all
documenation to be more clear.
* config/or1k/elf.opt (mboard=, mnewlib): Rewrite documentation to be
more clear.
* config/or1k/or1k.opt (mrori): New option.
(mhard-div, msoft-div, mhard-mul, msoft-mul, mcmov, mror, msext,
msfimm, mshftimm): Rewrite documentation to be more clear.
* config/or1k/or1k.md (insn_support): Add ror and rori.
(enabled): Add conditions for ror and rori.
(rotrsi3): Replace condition for shftimm with ror and rori.
gcc/testsuite/ChangeLog:
* gcc.target/or1k/ror-4.c: New file.
* gcc.target/or1k/shftimm-1.c: Update test from rotate to shift
as the shftimm option no longer controls rotate.
Fixes bad assembly logic with software divide as reported by Richard Selvaggi.
Also, add a basic test to verify the soft math works when enabled.
gcc/testsuite/ChangeLog:
PR target/90362
* gcc.target/or1k/div-mul-3.c: New test.
libgcc/ChangeLog:
PR target/90362
* config/or1k/lib1funcs.S (__udivsi3): Change l.sfeqi
to l.sfeq and l.sfltsi to l.sflts equivalents as the immediate
instructions are not available on every processor. Change a
l.bnf to l.bf to fix logic issue.
Volatile memory does not match the memory_operand predicate. This
causes extra extend/mask instructions instructions when reading
from volatile memory. On OpenRISC loading volatile memory can be
treated the same as regular memory loads which supports combined
sign/zero extends. Fixing this eliminates the need for extra
extend/mask instructions.
This also adds a test provided by Richard Selvaggi which uncovered the
issue while we were looking into another issue.
The recent change to move code into the new rs6000-call.c file is missing a
default value for the TARGET_NO_PROTOTYPE value (which only affects targets
that don’t include svr4.h). Fixed by moving the fallback setting from
rs6000.c (which has no uses now) to rs6000-call.c.
2019-07-21 Iain Sandoe <iain@sandoe.co.uk>
* config/rs6000/rs6000.c (TARGET_NO_PROTOTYPE): Move from here...
* config/rs6000/rs6000-call.c: ... to here.
PR libfortran/91030
* io/unix.c (BUFFER_SIZE): Delete.
(BUFFER_FORMATTED_SIZE_DEFAULT): New variable.
(BUFFER_UNFORMATTED_SIZE_DEFAULT): New variable.
(unix_stream): Add buffer_size.
(buf_read): Use s->buffer_size instead of BUFFER_SIZE.
(buf_write): Likewise.
(buf_init): Add argument unformatted. Handle block sizes
for unformatted vs. formatted, using defaults if provided.
(fd_to_stream): Add argument unformatted in call to buf_init.
* libgfortran.h (options_t): Add buffer_size_formatted and
buffer_size_unformatted.
* runtime/environ.c (variable_table): Add
GFORTRAN_UNFORMATTED_BUFFER_SIZE and
GFORTRAN_FORMATTED_BUFFER_SIZE.
Jason Merrill [Sat, 20 Jul 2019 14:43:49 +0000 (10:43 -0400)]
Fix ICE on class template argument deduction with inherited ctor.
In general, when we see a dependent using-declaration we don't know whether
it names a function or not, so it doesn't get an OVERLOAD unless we see
overloads of the same name in the current class. In the case of an
inherited constructor we could figure that out from the name, but it's
simpler to handle USING_DECL properly.
* cp-tree.h (ovl_iterator::using_p): A USING_DECL by itself was also
introduced by a using-declaration.
Jason Merrill [Sat, 20 Jul 2019 13:48:38 +0000 (09:48 -0400)]
Reduce memory consumption for push/pop_access_scope.
I was seeing memory consumption issues on the concepts-cxx2a
branch. push_scope was, surprisingly, at the top of -fmem-report, and
push_access_scope was pretty high. Fixing them was pretty simple.
* name-lookup.c (leave_scope): Do add class levels other than
previous_class_level to free_binding_level.
(invalidate_class_lookup_cache): Move from class.c, add to
free_binding_level.
* pt.c (saved_access_scope): Change from list to vec.
Ian Lance Taylor [Fri, 19 Jul 2019 23:10:55 +0000 (23:10 +0000)]
compiler: don't export bodies for functions marked "go:noinline"
The current Mark_inline_candidates helper looks only at budget when
deciding to mark a function or method as inline (with the proviso that
IR constructs not yet supported by the inliner are given artificially
high cost). This patch changes the helper to also look at whether a
function has the "go:noinline" pragma; if it does have the pragma
there is no point putting it into the export data (it will just make
the export data bigger).
This strips out a few driver specs that are only specifying a default state.
Also warn on an option now ignored, and add some comments to the driver specs
section.
2019-07-19 Iain Sandoe <iain@sandoe.co.uk>
* config/darwin.h (DRIVER_SELF_SPECS): Ignore X and Mach specs which
refer to default conditions. Warn for the 'y' spec which is ignored
by current linkers.
Bill Seurer [Fri, 19 Jul 2019 18:33:59 +0000 (18:33 +0000)]
[PATCH, rs6000] Split up rs6000.c.
The source file rs6000.c has grown to unreasonable size and is being
split up into several smaller source files. This should improve
compilation speed for building gcc.
This is the second of several patches to do this and moves most of the
function call and builtin code to a new source file.
Bootstrapped and tested on powerpc64le-unknown-linux-gnu and
powerpc64-unknown-linux-gnu with no regressions. Is this ok for trunk?
2019-07-17 Bill Seurer <seurer@linux.vnet.ibm.com>
After some discussion, we've decided to rename the +bitperm feature
flag to +sve2-bitperm, so that it's consistent with the other SVE2
feature flags. The associated macro was already
__ARM_FEATURE_SVE2_BITPERM, so only the feature flag itself
needs to change.
2019-07-19 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* doc/invoke.texi: Rename the AArch64 +bitperm extension flag
to +sve-bitperm.
* config/aarch64/aarch64-option-extensions.def: Likewise.
Richard Biener [Fri, 19 Jul 2019 08:47:41 +0000 (08:47 +0000)]
re PR tree-optimization/91207 (Wrong code with -O3)
2019-07-19 Richard Biener <rguenther@suse.de>
PR tree-optimization/91207
Revert
2019-07-17 Richard Biener <rguenther@suse.de>
PR tree-optimization/91178
* tree-vect-stmts.c (get_group_load_store_type): For SLP
loads with a gap larger than the vector size always use
VMAT_STRIDED_SLP.
(vectorizable_load): For VMAT_STRIDED_SLP with a permutation
avoid loading vectors that are only contained in the gap
and thus are not needed.
Jason Merrill [Fri, 19 Jul 2019 06:52:47 +0000 (02:52 -0400)]
PR c++/90098 - partial specialization and class non-type parms.
A non-type template parameter of class type used in an expression has
const-qualified type; the pt.c hunks deal with this difference from the
unqualified type of the parameter declaration. WAhen we use such a
parameter as an argument to another template, we don't want to confuse
things by copying it, we should pass it straight through. And we might as
well skip copying other classes in constant evaluation context in a
template, too; we'll get the copy semantics at instantiation time.
Michael Meissner [Thu, 18 Jul 2019 19:07:13 +0000 (19:07 +0000)]
Rename function.
2019-07-18 Michael Meissner <meissner@linux.ibm.com>
* config/rs6000/predicates.md (prefixed_mem_operand): Call
rs6000_prefixed_address_mode_p instead of rs6000_prefixed_address.
* config/rs6000/rs6000-protos.h (rs6000_prefixed_address_mode_p):
Rename function from rs6000_prefixed_address.
* config/rs6000/rs6000.c (rs6000_prefixed_address_mode_p): Rename
function from rs6000_prefixed_address.
Michael Meissner [Thu, 18 Jul 2019 18:16:43 +0000 (18:16 +0000)]
Update PowerPC compiler for pc-relative support.
2019-07-18 Michael Meissner <meissner@linux.ibm.com>
* config/rs6000/aix.h (TARGET_HAS_TOC): Rename TARGET_TOC to
TARGET_HAS_TOC.
(TARGET_TOC): Likewise.
(TARGET_NO_TOC): Delete here, define TARGET_NO_TOC_OR_PCREL in
rs6000.h.
* config/rs6000/darwin.h (TARGET_HAS_TOC): Rename TARGET_TOC to
TARGET_HAS_TOC.
(TARGET_TOC): Likewise.
(TARGET_NO_TOC): Delete here, define TARGET_NO_TOC_OR_PCREL in
rs6000.h.
* config/rs6000/linux64.h (TARGET_HAS_TOC): Rename TARGET_TOC to
TARGET_HAS_TOC.
(TARGET_TOC): Likewise.
* config/rs6000/rs6000.c (rs6000_option_override_internal): Add
check to require -mcmodel=medium for pc-relative addressing.
(create_TOC_reference): Add assertion for TARGET_TOC.
(rs6000_legitimize_address): Use TARGET_NO_TOC_OR_PCREL instead of
TARGET_NO_TOC.
(rs6000_emit_move): Likewise.
(TOC_alias_set): Rename TOC alias set static variable from 'set'
to 'TOC_alias_set'.
(get_TOC_alias_set): Likewise.
(output_toc): Use TARGET_NO_TOC_OR_PCREL instead of
TARGET_NO_TOC.
(rs6000_can_eliminate): Likewise.
* config/rs6000/rs6000.h (TARGET_TOC): Define in terms of
TARGET_HAS_TOC and not pc-relative.
(TARGET_NO_TOC_OR_PCREL): New macro to replace TARGET_NO_TOC.
* config/rs6000/sysv4.h (TARGET_HAS_TOC): Rename TARGET_TOC to
TARGET_HAS_TOC.
(TARGET_TOC): Likewise.
(TARGET_NO_TOC): Delete here, define TARGET_NO_TOC_OR_PCREL in
rs6000.h.
re PR target/91188 (strict_low_part operations do not work)
PR target/91188
* config/i386/i386.md (*addqi_1_slp): Use register_operand predicate
for operand 0. Do not use (match_dup) to match operand 1 with
operand 0. Add check in insn constraint that either input operand
matches operand 0. Use SWI12 mode iterator to also handle
HImode operands.
(*and<mode>_1_slp): Ditto.
(*<code>qi_1_slp): Ditto.
(*sub<mode>_1_slp): Use register_operand predicate for operand 0.
Do not use (match_dup) to match operand 1 with operand 0. Add
check in insn constraint that operand 1 matches operand 0.
Use SWI12 mode iterator to also handle HImode operands.
(*ashl<mode>3_1_slp): Ditto.
(*<shift_insn><mode>3_1_slp): Ditto.
(*<rotate_insn><mode>3_1_slp): Ditto.
Ian Lance Taylor [Thu, 18 Jul 2019 16:51:00 +0000 (16:51 +0000)]
compiler: fix bug in importing blocks from inline functions
This patch fixes a buglet in the function body importer. Add hooks for
keeping a stack of blocks corresponding to the block nesting in the
imported function. This ensures that local variables and temps wind up
correctly scoped and don't introduce collisions.
Makefile.rtl, [...]: Introduce a "STANDALONE" mode where C runtime files do not have any dependency...
* Makefile.rtl, expect.c, env.c, aux-io.c, mkdir.c, initialize.c,
cstreams.c, raise.c, tracebak.c, adadecode.c, init.c, raise-gcc.c,
argv.c, adaint.c, adaint.h, ctrl_c.c, sysdep.c, rtinit.c, cio.c,
seh_init.c, exit.c, targext.c: Introduce a "STANDALONE" mode where C
runtime files do not have any dependency on GCC include files.
Remove unnecessary includes.
Remove remaining references to VMS in runtime C file.
* runtime.h: new File.
Sylvia Taylor [Thu, 18 Jul 2019 16:02:05 +0000 (16:02 +0000)]
[patch2/2][arm]: remove builtin expand for sha1
This patch removes the builtin expand handling for sha1h/c/m/p and
replaces it with expand patterns. This should make it more consistent
with how we handle intrinsic implementations and cleans up the custom
sha1 code in the arm_expand builtins for unop and ternop.
2019-07-18 Sylvia Taylor <sylvia.taylor@arm.com>
* config/arm/arm-builtins.c
(arm_expand_ternop_builtin): Remove explicit sha1 builtin handling.
(arm_expand_unop_builtin): Likewise.
* config/arm/crypto.md
(crypto_sha1h): Convert from define_insn to define_expand.
(crypto_<crypto_pattern>): Likewise.
(crypto_sha1h_lb): New define_insn.
(crypto_<crypto_pattern>_lb): Likewise.
Sylvia Taylor [Thu, 18 Jul 2019 15:42:13 +0000 (15:42 +0000)]
[patch1/2][arm][PR90317]: fix sha1 patterns
This patch fixes:
1) Ice message thrown when using the crypto_sha1h intrinsic due to
incompatible mode used for zero_extend. Removed zero extend as it is
not a good choice for vector modes and using an equivalent single
mode like TI (128bits) instead of V4SI produces extra instructions
making it inefficient.
This affects gcc version 8 and above.
2) Incorrect combine optimizations made due to vec_select usage
in the sha1 patterns on arm. The patterns should only combine
a vec select within a sha1h<op> instruction when the lane is 0.
This affects gcc version 5 and above.
- Fixed by explicitly declaring the valid const int for such
optimizations. For cases when the lane is not 0, the vector
lane selection now occurs in a e.g. vmov instruction prior
to sha1h<op>.
- Updated the sha1h testcases on arm to check for additional
cases with custom vector lane selection.
The intrinsic functions for the sha1 patterns have also been
simplified which seems to eliminate extra vmovs like:
- vmov.i32 q8, #0.
demangle.h (rust_is_mangled): Move to libiberty/rust-demangle.h.
include/
* demangle.h (rust_is_mangled): Move to libiberty/rust-demangle.h.
(rust_demangle_sym): Move to libiberty/rust-demangle.h.
libiberty/
* cplus-dem.c: Include rust-demangle.h.
* rust-demangle.c: Include rust-demangle.h.
* rust-demangle.h: New file.
Richard Earnshaw [Thu, 18 Jul 2019 13:56:52 +0000 (13:56 +0000)]
[arm] Fix incorrect modes with 'borrow' operations
Looking through the arm backend I noticed that the modes used to pass
comparison types into subtract-with-carry operations were being
incorrectly set. The result is that the compiler is not truly
self-consistent. To clean this up I've introduced a new predicate,
arm_borrow_operation (borrowed from the AArch64 backend) which can
match the comparison type with the required mode and then fixed all
the patterns to use this. The split patterns that were generating
incorrect modes have all obviously been fixed as well.
The basic rule for the use of a borrow is:
- if the condition code was set by a 'subtract-like' operation (subs, cmp),
then use CCmode and LTU.
- if the condition code was by unsigned overflow of addition (adds), then
use CC_Cmode and GEU.
* config/arm/predicates.md (arm_borrow_operation): New predicate.
* config/arm/arm.c (subdi3_compare1): Use CCmode for the split.
(arm_subdi3, subdi_di_zesidi, subdi_di_sesidi): Likewise.
(subdi_zesidi_zesidi): Likewise.
(negdi2_compare, negdi2_insn): Likewise.
(negdi_extensidi): Likewise.
(negdi_zero_extendsidi): Likewise.
(arm_cmpdi_insn): Likewise.
(subsi3_carryin): Use arm_borrow_operation.
(subsi3_carryin_const): Likewise.
(subsi3_carryin_const0): Likewise.
(subsi3_carryin_compare): Likewise.
(subsi3_carryin_compare_const): Likewise.
(subsi3_carryin_compare_const0): Likewise.
(subsi3_carryin_shift): Likewise.
(rsbsi3_carryin_shift): Likewise.
(negsi2_carryin_compare): Likewise.
Jan Hubicka [Thu, 18 Jul 2019 13:08:34 +0000 (15:08 +0200)]
lto-common.c (gimple_register_canonical_type_1): Do not look for non-ODR conflicts of types in anonymous namespaces.
* lto-common.c (gimple_register_canonical_type_1): Do not look for
non-ODR conflicts of types in anonymous namespaces.
(unify_scc): Do not merge anonymous namespace types.
* g++.dg/lto/alias-5_0.C: New testcase.
* g++.dg/lto/alias-5_1.C: New.
* g++.dg/lto/alias-5_2.c: New.
Bin Cheng [Thu, 18 Jul 2019 08:38:09 +0000 (08:38 +0000)]
re PR tree-optimization/91137 (Wrong code with -O3)
PR tree-optimization/91137
* tree-ssa-loop-ivopts.c (struct ivopts_data): New field.
(tree_ssa_iv_optimize_init, alloc_iv, tree_ssa_iv_optimize_finalize):
Init, use and fini the above new field.
(determine_base_object_1): New function.
(determine_base_object): Reimplement using walk_tree.
gcc/testsuite
PR tree-optimization/91137
* gcc.c-torture/execute/pr91137.c: New test.
This change is needed to avoid a regression in gcc.dg/ifcvt-3.c
for a later patch. Without it, we enter CSE with a dead comparison left
by if-conversion and then eliminate the second (live) comparison in
favour of the dead one. That's functionally correct in itself, but it
meant that we'd combine the subtraction and comparison into a SUBS
before we have a chance to fold away the subtraction.
2019-07-18 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* basic-block.h (CLEANUP_FORCE_FAST_DCE): New macro.
* cfgcleanup.c (cleanup_cfg): Call run_fast_dce if
CLEANUP_FORCE_FAST_DCE is set.
* ifcvt.c (rest_of_handle_if_conversion): Pass
CLEANUP_FORCE_FAST_DCE to the final cleanup_cfg call if
if-conversion succeeded.
Ian Lance Taylor [Thu, 18 Jul 2019 05:05:20 +0000 (05:05 +0000)]
compiler: fix bug in handling of unordered set during exporting
In CL 183850 a change was made to combine tracking/discovery of
exported types and imported packages during export data generation. As
a result of this refactoring a bug was introduced: the new code can
potentially insert items into the exports set (an unordered_set) while
iterating through the same set, which is illegal according to the spec
for std::unordered_set.
This patch fixes the problem by changing the type discovery phase to
iterate through a separate list of sorted exports, as opposed to
iterating through the main unordered set. Also included is a change
to fix the code that looks for variables that are referenced from
inlined routine bodies (this code wasn't scanning all of the function
that it needed to scan).
-Wmissing-attributes: check that we avoid duplicates and false positives
The initial patch for PR 81824 fixed various possibilities of
-Wmissing-attributes reporting duplicates and false positives. The
test that avoided them was a little obscure, though, so this patch
rewrites it into a more self-evident form.
The patch also adds a testcase that already passed, but that
explicitly covers some of the possibilities of reporting duplicates
and false positives that preexisting tests did not cover.
for gcc/ChangeLog
PR middle-end/81824
* attribs.c (decls_mismatched_attributes): Simplify the logic
that avoids duplicates and false positives.
for gcc/testsuite/ChangeLog
PR middle-end/81824
* g++.dg/Wmissing-attributes-1.C: New. Some of its fragments
are from Martin Sebor.
pa.c (pa_som_asm_init_sections): Don't force all constant data into data section when generating PIC code.
* config/pa/pa.c (pa_som_asm_init_sections): Don't force all constant
data into data section when generating PIC code.
(pa_select_section): Use pa_reloc_rw_mask() to qualify relocs.
(pa_reloc_rw_mask): Return 3 when generating PIC code and when
generating code for SOM targets earlier than HP-UX 11. Otherwise,
return 2 for SOM and 0 for other targets.
Richard Biener [Wed, 17 Jul 2019 11:21:49 +0000 (11:21 +0000)]
re PR tree-optimization/91178 (Infinite recursion in split_constant_offset in slp after r260289)
2019-07-17 Richard Biener <rguenther@suse.de>
PR tree-optimization/91178
* tree-ssa.c (release_defs_bitset): Iterate from higher to
lower SSA names to avoid quadratic behavior in the common case.
* tree-data-ref.c (split_constant_offset): Add limit argument
and pass it down. Initialize it from PARAM_SSA_NAME_DEF_CHAIN_LIMIT.
(split_constant_offset_1): Add limit argument and use it to
limit SSA def walking. Optimize the common plus/minus case.
Richard Biener [Wed, 17 Jul 2019 10:26:25 +0000 (10:26 +0000)]
re PR tree-optimization/91178 (Infinite recursion in split_constant_offset in slp after r260289)
2019-07-17 Richard Biener <rguenther@suse.de>
PR tree-optimization/91178
* tree-vect-stmts.c (get_group_load_store_type): For SLP
loads with a gap larger than the vector size always use
VMAT_STRIDED_SLP.
(vectorizable_load): For VMAT_STRIDED_SLP with a permutation
avoid loading vectors that are only contained in the gap
and thus are not needed.
Jakub Jelinek [Wed, 17 Jul 2019 07:15:30 +0000 (09:15 +0200)]
re PR tree-optimization/91157 (ICE: verify_gimple failed (error: position plus size exceeds size of referenced object in 'bit_field_ref'))
PR tree-optimization/91157
* tree-vect-generic.c (expand_vector_comparison): Handle lhs being
a vector boolean with scalar mode.
(expand_vector_condition): Handle first operand being a vector boolean
with scalar mode.
(expand_vector_operations_1): For comparisons, don't bail out early
if the return type is vector boolean with scalar mode, but comparison
operand type is not.
* gcc.target/i386/avx512f-pr91157.c: New test.
* gcc.target/i386/avx512bw-pr91157.c: New test.
Jakub Jelinek [Wed, 17 Jul 2019 07:13:17 +0000 (09:13 +0200)]
re PR tree-optimization/91157 (ICE: verify_gimple failed (error: position plus size exceeds size of referenced object in 'bit_field_ref'))
PR tree-optimization/91157
* tree-vect-generic.c (expand_vector_comparison): Handle lhs being
a vector boolean with scalar mode.
(expand_vector_condition): Handle first operand being a vector boolean
with scalar mode.
(expand_vector_operations_1): For comparisons, don't bail out early
if the return type is vector boolean with scalar mode, but comparison
operand type is not.
* gcc.target/i386/avx512f-pr91157.c: New test.
* gcc.target/i386/avx512bw-pr91157.c: New test.
i386.md (*testdi_1): Match CCZmode for constants that might have the SImode sign bit set.
* config/i386/i386.md (*testdi_1): Match CCZmode for
constants that might have the SImode sign bit set.
(*testqi_1_maybe_si): Remove "!" constraint modifier.
Use correct constraints for pentium pairing.
(*test<mode>_1): Ditto.
Jeff Law [Tue, 16 Jul 2019 14:44:44 +0000 (08:44 -0600)]
re PR rtl-optimization/91173 (ICE: in int_mode_for_mode, at stor-layout.c:403)
PR rtl-optimization/91173
* tree-ssa-address.c (addr_for_mem_ref): If the base is an
SSA_NAME with a constant value, fold its value into the offset
and clear the base before calling gen_addr_rtx.
Jan Hubicka [Tue, 16 Jul 2019 09:29:17 +0000 (11:29 +0200)]
alias-1_0.C: Use -O3.
* g++.dg/lto/alias-1_0.C: Use -O3.
* g++.dg/lto/alias-2_0.C: Use -O3.
* g++.dg/lto/alias-3_0.C: Add loop to enable inlining with
-fno-use-linker-plugin.
* g++.dg/lto/alias-3_1.C: Remove dg-lto-do and dg-lto-options.
Jason Merrill [Tue, 16 Jul 2019 08:57:03 +0000 (04:57 -0400)]
Simplify range location creation in C++ parser.
Many places in the parser follow the same pattern of capturing the location
of the last lexed token, either before or after lexing it, and then using
that as the end of a location range; this can be simplified by passing the
lexer to make_location and grabbing the token location there.
* parser.c (make_location): Add overload taking cp_lexer* as last
parameter.
Jason Merrill [Tue, 16 Jul 2019 08:50:16 +0000 (04:50 -0400)]
Simplify type-specifier parsing.
Previously, the tentative parses for optional type-specifier and to support
class template argument deduction were combined awkwardly. This
reorganization was motivated by the new concepts branch.
* parser.c (cp_parser_simple_type_specifier): Separate tentative
parses for optional type-spec and CTAD.
Jason Merrill [Tue, 16 Jul 2019 08:49:04 +0000 (04:49 -0400)]
Fix g++.dg/template/pr84789.C on new concepts branch.
On the concepts branch I ran into trouble where a pre-parsed dependent
nested-name-specifier got replaced on a subsequent parse with is_declaration
by one with typenames resolved, which was then used wrongly on a further
parse with !is_declaration.
* parser.c (cp_parser_nested_name_specifier_opt): If the token is
already CPP_NESTED_NAME_SPECIFIER, leave it alone.
This patch reports an error if the .md file has an unscoped
attribute that maps to more than one possible value.
2019-07-16 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* read-md.h (md_reader::record_potential_iterator_use): Add a
file_location parameter.
* read-rtl.c (attribute_use::loc): New field.
(map_attr_string): Take a file_location parameter. Report cases
in which attributes map to multiple distinct values.
(apply_attribute_uses): Update call accordingly.
(md_reader::handle_overloaded_name): Likewise.
(md_reader::apply_iterator_to_string): Likewise. Skip empty
nonnull strings.
(record_attribute_use): Take a file_location parameter.
Initialize attribute_use::loc.
(md_reader::record_potential_iterator_use): Take a file_location
parameter. Update call to record_attribute_use.
(rtx_reader::rtx_alloc_for_name): Update call accordingly.
(rtx_reader::read_rtx_code): Likewise.
(rtx_reader::read_rtx_operand): Likewise. Record a location
for implicitly-expanded empty strings.