1. 26 Jan, 2018 13 commits
    • re PR c/83989 (-Wrestrict false positive with malloc-style functions) · 79fbdeb8
      	PR c/83989
      	* gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref): Don't
      	use SSA_NAME_VAR as base for SSA_NAMEs with non-NULL SSA_NAME_VAR.
      
      	* c-c++-common/Wrestrict-3.c: New test.
      
      From-SVN: r257086
      Jakub Jelinek committed
    • [ARC] Add ARCv2 core3 tune option. · 62f26645
      ARCv2 Core3 cpus are comming with dbnz support. Add this feature on
      the tune option.
      
      gcc/
      2018-01-26  Claudiu Zissulescu  <claziss@synopsys.com>
      
              * config/arc/arc-arch.h (arc_tune_attr): Add ARC_TUNE_CORE_3.
              * config/arc/arc.c (arc_sched_issue_rate): Use ARC_TUNE_... .
              (arc_init): Likewise.
              (arc_override_options): Likewise.
              (arc_file_start): Choose Tag_ARC_CPU_variation based on arc_tune
              value.
              (hwloop_fail): Use TARGET_DBNZ when we want to check for dbnz insn
              support.
              * config/arc/arc.h (TARGET_DBNZ): Define.
              * config/arc/arc.md (attr tune): Add core_3, use ARC_TUNE_... to
              properly set the tune attribute.
              (dbnz): Use TARGET_DBNZ guard.
              * config/arc/arc.opt (mtune): Add core3 option.
      
      From-SVN: r257085
      Claudiu Zissulescu committed
    • [ARC] Rework delegitimate_address hook · 20565692
      Delegitimize address is used to undo the obfuscating effect of PIC
      addresses, returning the address in a way which is understood by the
      compiler.  The old version of the hook was outdated, not beeing able
      to recognize the current addresses generated by the ARC backend.
      
      gcc/
      2018-01-26  Claudiu Zissulescu  <claziss@synopsys.com>
      
      	* config/arc/arc.c (arc_delegitimize_address_0): Refactored to
      	recognize new pic like addresses.
      	(arc_delegitimize_address): Clean up.
      
      testsuite/
      2018-01-26  Claudiu Zissulescu  <claziss@synopsys.com>
      
      	* testsuite/gcc.target/arc/tdelegitimize_addr.c: New test.
      
      From-SVN: r257084
      Claudiu Zissulescu committed
    • [ARC] Add support for reduced register file set · 048c6a9a
      gcc/
      2018-01-26  Claudiu Zissulescu  <claziss@synopsys.com>
      
              * config/arc/arc-arches.def: Option mrf16 valid for all
              architectures.
              * config/arc/arc-c.def (__ARC_RF16__): New predefined macro.
              * config/arc/arc-cpus.def (em_mini): New cpu with rf16 on.
              * config/arc/arc-options.def (FL_RF16): Add mrf16 option.
              * config/arc/arc-tables.opt: Regenerate.
              * config/arc/arc.c (arc_conditional_register_usage): Handle
              reduced register file case.
              (arc_file_start): Set must have build attributes.
              * config/arc/arc.h (MAX_ARC_PARM_REGS): Conditional define using
              mrf16 option value.
              * config/arc/arc.opt (mrf16): Add new option.
              * config/arc/elf.h (ATTRIBUTE_PCS): Define.
              * config/arc/genmultilib.awk: Handle new mrf16 option.
              * config/arc/linux.h (ATTRIBUTE_PCS): Define.
              * config/arc/t-multilib: Regenerate.
              * doc/invoke.texi (ARC Options): Document mrf16 option.
      
      libgcc/
      2018-01-26  Claudiu Zissulescu  <claziss@synopsys.com>
      
              * config/arc/lib1funcs.S (__udivmodsi4): Use safe version for RF16
              option.
              (__divsi3): Use RF16 safe registers.
              (__modsi3): Likewise.
      
      From-SVN: r257083
      Claudiu Zissulescu committed
    • [ARC] Add SJLI support. · 7778a1ad
      gcc/
      2018-01-26  Claudiu Zissulescu  <claziss@synopsys.com>
      
              * config/arc/arc-protos.h: Add arc_is_secure_call_p proto.
              * config/arc/arc.c (arc_handle_secure_attribute): New function.
              (arc_attribute_table): Add 'secure_call' attribute.
              (arc_print_operand): Print secure call operand.
              (arc_function_ok_for_sibcall): Don't optimize tail calls when
              secure.
              (arc_is_secure_call_p): New function.
              * config/arc/arc.md (call_i): Add support for sjli instruction.
              (call_value_i): Likewise.
              * config/arc/constraints.md (Csc): New constraint.
      
      From-SVN: r257082
      Claudiu Zissulescu committed
    • [ARC] Add JLI support. · 6b55f8c9
      The ARCv2 ISA provides the JLI instruction, which is two-byte instructions
      that can be used to reduce code size in an application. To make use of it,
      we provide two new function attributes 'jli_always' and 'jli_fixed' which
      will force the compiler to call the indicated function using a jli_s
      instruction. The compiler also generates the entries in the JLI table for
      the case when we use 'jli_always' attribute. In the case of 'jli_fixed'
      the compiler assumes a fixed position of the function into JLI
      table. Thus, the user needs to provide an assembly file with the JLI table
      for the final link. This is usefully when we want to have a table in ROM
      and a second table in the RAM memory.
      
      The jli instruction usage can be also forced without the need to annotate
      the source code via '-mjli-always' command.
      
      gcc/
      2018-01-26  Claudiu Zissulescu  <claziss@synopsys.com>
                  John Eric Martin <John.Martin@emmicro-us.com>
      
              * config/arc/arc-protos.h: Add arc_is_jli_call_p proto.
              * config/arc/arc.c (_arc_jli_section): New struct.
              (arc_jli_section): New type.
              (rc_jli_sections): New static variable.
              (arc_handle_jli_attribute): New function.
              (arc_attribute_table): Add jli_always and jli_fixed attribute.
              (arc_file_end): New function.
              (TARGET_ASM_FILE_END): Define.
              (arc_print_operand): Reuse 'S' letter for JLI output instruction.
              (arc_add_jli_section): New function.
              (jli_call_scan): Likewise.
              (arc_reorg): Call jli_call_scan.
              (arc_output_addsi): Remove 'S' from printing asm operand.
              (arc_is_jli_call_p): New function.
              * config/arc/arc.md (movqi_insn): Remove 'S' from printing asm
              operand.
              (movhi_insn): Likewise.
              (movsi_insn): Likewise.
              (movsi_set_cc_insn): Likewise.
              (loadqi_update): Likewise.
              (load_zeroextendqisi_update): Likewise.
              (load_signextendqisi_update): Likewise.
              (loadhi_update): Likewise.
              (load_zeroextendhisi_update): Likewise.
              (load_signextendhisi_update): Likewise.
              (loadsi_update): Likewise.
              (loadsf_update): Likewise.
              (movsicc_insn): Likewise.
              (bset_insn): Likewise.
              (bxor_insn): Likewise.
              (bclr_insn): Likewise.
              (bmsk_insn): Likewise.
              (bicsi3_insn): Likewise.
              (cmpsi_cc_c_insn): Likewise.
              (movsi_ne): Likewise.
              (movsi_cond_exec): Likewise.
              (clrsbsi2): Likewise.
              (norm_f): Likewise.
              (normw): Likewise.
              (swap): Likewise.
              (divaw): Likewise.
              (flag): Likewise.
              (sr): Likewise.
              (kflag): Likewise.
              (ffs): Likewise.
              (ffs_f): Likewise.
              (fls): Likewise.
              (call_i): Remove 'S' asm letter, add jli instruction.
              (call_value_i): Likewise.
              * config/arc/arc.op (mjli-always): New option.
              * config/arc/constraints.md (Cji): New constraint.
              * config/arc/fpx.md (addsf3_fpx): Remove 'S' from printing asm
              operand.
              (subsf3_fpx): Likewise.
              (mulsf3_fpx): Likewise.
              * config/arc/simdext.md (vendrec_insn): Remove 'S' from printing
              asm operand.
              * doc/extend.texi (ARC): Document 'jli-always' and 'jli-fixed'
              function attrbutes.
              * doc/invoke.texi (ARC): Document mjli-always option.
      
      gcc/testsuite
      2018-01-26  Claudiu Zissulescu  <claziss@synopsys.com>
      
              * gcc.target/arc/jli-1.c: New file.
              * gcc.target/arc/jli-2.c: Likewise.
      
      Co-Authored-By: John Eric Martin <John.Martin@emmicro-us.com>
      
      From-SVN: r257081
      Claudiu Zissulescu committed
    • Corrected date in changelog · c921c45f
      From-SVN: r257080
      Sebastian Perta committed
    • rl78.c: if operand 2 is const avoid addition with 0 and use incw and decw where possible · b0679a78
      2018-01-25  Sebastian Perta  <sebastian.perta@renesas.com>
      
      	* config/rl78/rl78.c: if operand 2 is const avoid addition with 0
      	and use incw and decw where possible
      	* testsuite/gcc.target/rl78/test_addsi3_internal.c: new file
      
      From-SVN: r257079
      Sebastian Perta committed
    • Fix gcc.target/aarch64/sve/peel_ind_1.c for -mcmodel=tiny · 05471739
      gcc/testsuite/ChangeLog:
      
      2018-01-26  Szabolcs Nagy  <szabolcs.nagy@arm.com>
      
      	* gcc.target/aarch64/sve/peel_ind_1.c: Match (adrp|adr) in scan-assembler.
      	* gcc.target/aarch64/sve/peel_ind_2.c: Likewise.
      	* gcc.target/aarch64/sve/peel_ind_3.c: Likewise.
      
      From-SVN: r257078
      Szabolcs Nagy committed
    • re PR tree-optimization/81082 (Failure to vectorise after reassociating index computation) · 5b55e6e3
      2018-01-26  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/81082
      	* fold-const.c (fold_plusminus_mult_expr): Do not perform the
      	association if it requires casting to unsigned.
      	* match.pd ((A * C) +- (B * C) -> (A+-B)): New patterns derived
      	from fold_plusminus_mult_expr to catch important cases late when
      	range info is available.
      
      	* gcc.dg/vect/pr81082.c: New testcase.
      	* gcc.dg/tree-ssa/loop-15.c: XFAIL the (int)((unsigned)n + -1U) * n + n
      	simplification to n * n.
      
      From-SVN: r257077
      Richard Biener committed
    • Configure USE_HIDDEN_LINKONCE on Solaris/x86 · af2e3244
      	gcc/testsuite:
      	* gcc.target/i386/mcount_pic.c: Only xfail get_pc_thunk scan on
      	Solaris 10.
      	* gcc.target/i386/pr63620.c: Likewise.
      
      	gcc:
      	* config/i386/sol2.h (USE_HIDDEN_LINKONCE): Remove.
      	* configure.ac (hidden_linkonce): New test.
      	* configure: Regenerate.
      	* config.in: Regenerate.
      
      From-SVN: r257076
      Rainer Orth committed
    • Fix various x86 avx512{bitalg, vpopcntdq, vbmi2} issues (PR target/83488) · aad36c56
      gcc/
      	* config/i386/avx512bitalgintrin.h (_mm512_bitshuffle_epi64_mask,
      	_mm512_mask_bitshuffle_epi64_mask, _mm256_bitshuffle_epi64_mask,
      	_mm256_mask_bitshuffle_epi64_mask, _mm_bitshuffle_epi64_mask,
      	_mm_mask_bitshuffle_epi64_mask): Fix type.
      	* config/i386/i386-builtin-types.def (UHI_FTYPE_V2DI_V2DI_UHI,
      	USI_FTYPE_V4DI_V4DI_USI): Remove.
      	* config/i386/i386-builtin.def (__builtin_ia32_vpshufbitqmb512_mask,
      	__builtin_ia32_vpshufbitqmb256_mask,
      	__builtin_ia32_vpshufbitqmb128_mask): Fix types.
      	* config/i386/i386.c (ix86_expand_args_builtin): Remove old types.
      	* config/i386/sse.md (VI1_AVX512VLBW): Change types.
      
      gcc/testsuite/
      	* gcc.target/i386/avx512bitalg-vpshufbitqmb-1.c: Add -mavx512f -mavx512bw.
      	* gcc.target/i386/avx512bitalgvl-vpshufbitqmb-1.c: Add -mavx512bw.
      	* gcc.target/i386/i386.exp: Fix types.
      
      From-SVN: r257075
      Julia Koval committed
    • Daily bump. · 09e2984f
      From-SVN: r257073
      GCC Administrator committed
  2. 25 Jan, 2018 24 commits
  3. 24 Jan, 2018 3 commits
    • compiler: rationalize external symbol names · 4880b994
          
          Encode all external symbol names using only ASCII alphanumeric
          characters, underscore, and dot.  Use a scheme that can be reliably
          demangled to a somewhat readable version as described in the long
          comment in names.cc.
          
          A minor cleanup discovered during this was that we were treating
          function types as different if one had a NULL parameters_ field and
          another has a non-NULL parameters_ field that has no parameters.  This
          worked because we mangled them slightly differently.  We now mangle
          them the same, so we treat them as equal, as we should anyhow.
          
          Reviewed-on: https://go-review.googlesource.com/89555
      
      	* go.go-torture/execute/names-1.go: New test.
      
      From-SVN: r257033
      Ian Lance Taylor committed
    • Fix m68k-linux-gnu libgcc build for ColdFire (PR target/68467). · d3719ee2
      PR target/68467 is libgcc failing to build for m68k-linux-gnu
      configured for ColdFire.
      
      Jeff has an analysis in the PR identifying the problem as resulting
      from the callers of libcalls with 1-byte or 2-byte arguments wanting
      to push just 1 or 2 bytes on the stack, while the libcall
      implementations have the normal C ABI and expect 4-byte arguments.
      For normal C functions, I believe the TARGET_PROMOTE_PROTOTYPES
      definition would ensure such arguments get passed as 4-byte, but that
      does not apply for libcalls.
      
      This patch fixes the issue by defining TARGET_PROMOTE_FUNCTION_MODE
      for m68k.  The definition is conservative, only applying promotions in
      the case of arguments to libcalls; otherwise it returns the unpromoted
      type, which I believe matches what the default implementation of the
      hook would have done on m68k.
      
      I have tested that this fixes the libgcc build for ColdFire, and, in
      conjunction with one glibc patch, this enables glibc to build cleanly
      for ColdFire and to pass the compilation parts of the glibc testsuite
      except for one test unrelated to this patch (while glibc and the
      compilation parts of the testsuite continue to build OK for
      non-ColdFire m68k, as expected).  I have *not* run any GCC tests for
      this patch, or any execution tests for m68k.
      
      	PR target/68467
      	* config/m68k/m68k.c (m68k_promote_function_mode): New function.
      	(TARGET_PROMOTE_FUNCTION_MODE): New macro.
      
      From-SVN: r257032
      Joseph Myers committed
    • re PR target/83994 (%ebx is clobbered by stack-clash probing for regparm-3 function in PIC mode) · 5e77d9b1
      	PR target/83994
      	* i386.c (get_probe_interval): Move to earlier point.
      	(ix86_compute_frame_layout): If -fstack-clash-protection and
      	the frame is larger than the probe interval, then use pushes
      	to save registers rather than reg->mem moves.
      	(ix86_expand_prologue): Remove conditional for int_registers_saved
      	assertion.
      
      	PR target/83994
      	* gcc.target/i386/pr83994.c: New test.
      
      From-SVN: r257031
      Jeff Law committed