PR preprocessor/83708
* macro.c (vaopt_state): Reorder m_last_was_paste before m_state.
(vaopt_state::vaopt_state): Adjust.
(vaopt_state::update_flags): Add BEGIN and END.
(vaopt_state::update): Return them.
(copy_paste_flag): Factor out of replace_args.
(last_token_is): New.
(replace_args): Handle BEGIN and END. Avoid padding there.
(tokens_buff_last_token_ptr): Return NULL if no tokens.
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r257696
PR tree-optimization/84383
* tree-ssa-strlen.c (maybe_diag_stxncpy_trunc): Don't look at
dstoff nor call operand_equal_p if dstbase is NULL.
* gcc.c-torture/compile/pr84383.c: New test.
From-SVN: r257684
PR tree-optimization/84334
* match.pd ((A +- CST1) +- CST2 -> A + CST3): If A is
also a CONSTANT_CLASS_P, punt.
* gcc.dg/pr84334.c: New test.
From-SVN: r257683
gcc/
* config/riscv/riscv.c (riscv_first_stack_step): Move locals after
first SMALL_OPERAND check. New local min_second_step. Move assert
to where locals are set. Add TARGET_RVC support.
* config/riscv/riscv.h (C_SxSP_BITS, SWSP_REACH, SDSP_REACH): New.
From-SVN: r257681
gcc/ChangeLog:
PR tree-optimization/83698
* gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref): For
arrays constrain the offset range to their bounds.
(builtin_access::strcat_overlap): Adjust the bounds of overlap offset.
(builtin_access::overlap): Avoid setting the size of overlap if it's
already been set.
(maybe_diag_overlap): Also consider arrays when deciding what values
of offsets to include in diagnostics.
gcc/testsuite/ChangeLog:
PR tree-optimization/83698
* gcc.dg/Wrestrict-7.c: New test.
* c-c++-common/Wrestrict.c: Adjust expected values for strcat.
* gcc.target/i386/chkp-stropt-17.c: Same.
From-SVN: r257676
2018-02-14 Carl Love <cel@us.ibm.com>
* gcc.target/powerpc/builtins-4-int128-runnable.c
(dg-require-effective-target): Change vsx_hw to p8vector_hw.
(dg-options): Change -maltivec -mvsx to -mpower8-vector.
From-SVN: r257675
gcc/ChangeLog:
PR c/84108
* attribs.c (diag_attr_exclusions): Consider the exclusion(s)
that correspond to the kind of a declaration.
gcc/testsuite/ChangeLog:
PR c/84108
* gcc.dg/Wattributes-8.c: New test.
From-SVN: r257674
Introduce a couple of new CET intrinsics for reading and updating a
shadow stack pointer (_get_ssp and _inc_ssp). They replace the existing
_rdssp[d|q] and _incssp[d|q] instrinsics.
PR target/84239
* gcc/config/i386/cetintrin.h: Remove _rdssp[d|q] and
add _get_ssp intrinsics. Remove argument from
__builtin_ia32_rdssp[d|q].
* gcc/config/i386/i386-builtin-types.def: Add UINT_FTYPE_VOID.
* gcc/config/i386/i386-builtin.def: Remove argument from
__builtin_ia32_rdssp[d|q].
* gcc/config/i386/i386.c: Use UINT_FTYPE_VOID. Use
ix86_expand_special_args_builtin for _rdssp[d|q].
* gcc/config/i386/i386.md: Remove argument from rdssp[si|di] insn.
Clear register before usage.
* doc/extend.texi: Remove argument from __builtin_ia32_rdssp[d|q].
Add documentation for new _get_ssp and _inc_ssp intrinsics.
* testsuite/gcc.target/i386/cet-intrin-3.c: Use new _get_ssp and
_inc_ssp intrinsics.
* testsuite/gcc.target/i386/cet-intrin-4.c: Likewise.
* testsuite/gcc.target/i386/cet-rdssp-1.c: Remove argument from
__builtin_ia32_rdssp[d|q].
* libgcc/config/i386/shadow-stack-unwind.hi (_Unwind_Frames_Extra):
Use new _get_ssp and _inc_ssp intrinsics.
From-SVN: r257660
PR other/82368
* elf.c (EM_PPC64, EF_PPC64_ABI): Undefine and define.
(struct elf_ppc64_opd_data): New type.
(elf_initialize_syminfo): Add opd argument, handle symbols
pointing into the PowerPC64 ELFv1 .opd section.
(elf_add): Read .opd section on PowerPC64 ELFv1, pass pointer
to structure with .opd data to elf_initialize_syminfo.
From-SVN: r257658
object_address_invariant_in_loop_p ignored ARRAY_REF indices on
the basis that:
/* Index of the ARRAY_REF was zeroed in analyze_indices, thus we only
need to check the stride and the lower bound of the reference. */
That was true back in 2007 when the code was added:
static void
dr_analyze_indices (struct data_reference *dr, struct loop *nest)
{
[...]
while (handled_component_p (aref))
{
if (TREE_CODE (aref) == ARRAY_REF)
{
op = TREE_OPERAND (aref, 1);
access_fn = analyze_scalar_evolution (loop, op);
access_fn = resolve_mixers (nest, access_fn);
VEC_safe_push (tree, heap, access_fns, access_fn);
TREE_OPERAND (aref, 1) = build_int_cst (TREE_TYPE (op), 0);
}
aref = TREE_OPERAND (aref, 0);
}
but the assignment was removed a few years ago. We were therefore
treating "two->arr[i]" and "three->arr[i]" as loop invariant.
2018-02-14 Richard Sandiford <richard.sandiford@linaro.org>
gcc/
PR tree-optimization/84357
* tree-data-ref.c (object_address_invariant_in_loop_p): Check
operand 1 of an ARRAY_REF too.
gcc/testsuite/
PR tree-optimization/84357
* gcc.dg/vect/pr84357.c: New test.
From-SVN: r257657
gcc/
PR target/83831
* config/rx/rx-protos.h (rx_reg_dead_or_unused_after_insn,
rx_copy_reg_dead_or_unused_notes, rx_fuse_in_memory_bitop): New
declarations.
(set_of_reg): New struct.
(rx_find_set_of_reg, rx_find_use_of_reg): New functions.
* config/rx/rx.c (rx_reg_dead_or_unused_after_insn,
rx_copy_reg_dead_or_unused_notes, rx_fuse_in_memory_bitop): New
functions.
* config/rx/rx.md (andsi3, iorsi3, xorsi3): Convert to insn_and_split.
Split into bitclr, bitset, bitinvert patterns if appropriate.
(*bitset, *bitinvert, *bitclr): Convert to named insn_and_split and
use rx_fuse_in_memory_bitop.
(*bitset_in_memory, *bitinvert_in_memory, *bitclr_in_memory): Convert
to named insn, correct maximum insn length.
gcc/testsuite/
PR target/83831
* gcc.target/rx/pr83831.c: New tests.
From-SVN: r257655
If there is a LOG_LINK between two insns, this means those two insns
can be combined, as far as dataflow is concerned. There never should
be a LOG_LINK between two unrelated insns. If there is one, combine
will try to combine the insns without doing all the needed checks if
the earlier destination is used before the later insn, etc.
Unfortunately we do not update the LOG_LINKs correctly in some cases.
This patch fixes at least some of those cases.
PR rtl-optimization/84169
* combine.c (try_combine): New variable split_i2i3. Set it to true if
we generated a parallel as new i3 and we split that to new i2 and i3
instructions. Handle split_i2i3 similar to swap_i2i3: scan the
LOG_LINKs of i3 to see which of those need to link to i2 now. Link
those to i2, not i1. Partially rewrite this scan code.
gcc/testsuite/
PR rtl-optimization/84169
* gcc.c-torture/execute/pr84169.c: New.
From-SVN: r257644
PR c++/84364
* typeck.c (check_return_expr): Don't emit -Weffc++ warning
about return other than *this in assignment operators if
retval is type dependent expression.
* g++.dg/warn/effc4.C: New test.
From-SVN: r257640
They aren't needed, and could potentially cause unlikely symbol name
collisions. Also, the runtime package's reference to main could cause
the runtime package to define main.main..f, which could also be
defined in the main package if it does something like fmt.Print(main).
That will normally work but will fail with a multiple symbol
definition error when using -static-libgo.
Reviewed-on: https://go-review.googlesource.com/93656
From-SVN: r257637
PR c/82210
* stor-layout.c (place_field): For variable length fields, adjust
offset_align afterwards not just based on the field's alignment,
but also on the size.
* gcc.c-torture/execute/pr82210.c: New test.
From-SVN: r257635
PR middle-end/84309
* match.pd (pow(C,x) -> exp(log(C)*x)): Use exp2s and log2s instead
of exps and logs in the use_exp2 case.
* gcc.dg/pr84309-2.c: New test.
From-SVN: r257634