]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
7 years ago[ARM] Fix PR85261: ICE with FPSCR setter builtin
Thomas Preud'homme [Wed, 18 Apr 2018 13:17:30 +0000 (13:17 +0000)] 
[ARM] Fix PR85261: ICE with FPSCR setter builtin

Instruction pattern for setting the FPSCR expects the input value to be
in a register. However, __builtin_arm_set_fpscr expander does not ensure
that this is the case and as a result GCC ICEs when the builtin is
called with a constant literal.

This commit fixes the builtin to force the input value into a register.
It also remove the unneeded volatile in the existing fpscr test and
fixes the function prototype.

2018-04-18  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    Backport from mainline
    2018-04-11  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    gcc/
    PR target/85261
    * config/arm/arm-builtins.c (arm_expand_builtin): Force input operand
    into register.

    gcc/testsuite/
    PR target/85261
    * gcc.target/arm/fpscr.c: Add call to __builtin_arm_set_fpscr with
    literal value.  Expect 2 MCR instruction.  Fix function prototype.
    Remove volatile keyword.

From-SVN: r259469

7 years agoDaily bump.
GCC Administrator [Wed, 18 Apr 2018 00:16:05 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r259453

7 years agoDaily bump.
GCC Administrator [Tue, 17 Apr 2018 00:16:05 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r259424

7 years agoi386: Don't generate alias for function return thunk
H.J. Lu [Mon, 16 Apr 2018 19:11:13 +0000 (19:11 +0000)] 
i386: Don't generate alias for function return thunk

Function return thunks shouldn't be aliased to indirect branch thunks
since indirect branch thunks are placed in COMDAT section and a COMDAT
section with indirect branch may not have function return thunk.  This
patch generates function return thunks directly.

gcc/

Backport from mainline
PR target/84574
* config/i386/i386.c (indirect_thunk_needed): Update comments.
(indirect_thunk_bnd_needed): Likewise.
(indirect_thunks_used): Likewise.
(indirect_thunks_bnd_used): Likewise.
(indirect_return_needed): New.
(indirect_return_bnd_needed): Likewise.
(output_indirect_thunk_function): Add a bool argument for
function return.
(output_indirect_thunk_function): Don't generate alias for
function return thunk.
(ix86_code_end): Call output_indirect_thunk_function to generate
function return thunks.
(ix86_output_function_return): Set indirect_return_bnd_needed
and indirect_return_needed instead of indirect_thunk_bnd_needed
and indirect_thunk_needed.

gcc/testsuite/

Backport from mainline
PR target/84574
* gcc.target/i386/ret-thunk-9.c: Expect __x86_return_thunk
label instead of __x86_indirect_thunk label.

From-SVN: r259422

7 years agoi386: Add TARGET_INDIRECT_BRANCH_REGISTER
H.J. Lu [Mon, 16 Apr 2018 19:08:14 +0000 (19:08 +0000)] 
i386: Add TARGET_INDIRECT_BRANCH_REGISTER

For

---
struct C {
  virtual ~C();
  virtual void f();
};

void
f (C *p)
{
  p->f();
  p->f();
}
---

-mindirect-branch=thunk-extern -O2 on x86-64 GNU/Linux generates:

_Z1fP1C:
.LFB0:
        .cfi_startproc
        pushq   %rbx
        .cfi_def_cfa_offset 16
        .cfi_offset 3, -16
        movq    (%rdi), %rax
        movq    %rdi, %rbx
        jmp     .LIND1
.LIND0:
        pushq   16(%rax)
        jmp     __x86_indirect_thunk
.LIND1:
        call    .LIND0
        movq    (%rbx), %rax
        movq    %rbx, %rdi
        popq    %rbx
        .cfi_def_cfa_offset 8
        movq    16(%rax), %rax
        jmp     __x86_indirect_thunk_rax
        .cfi_endproc

x86-64 is supposed to have asynchronous unwind tables by default, but
there is nothing that reflects the change in the (relative) frame
address after .LIND0.  That region really has to be moved outside of
the .cfi_startproc/.cfi_endproc bracket.

This patch adds TARGET_INDIRECT_BRANCH_REGISTER to force indirect
branch via register whenever -mindirect-branch= is used.  Now,
-mindirect-branch=thunk-extern -O2 on x86-64 GNU/Linux generates:

_Z1fP1C:
.LFB0:
.cfi_startproc
pushq %rbx
.cfi_def_cfa_offset 16
.cfi_offset 3, -16
movq (%rdi), %rax
movq %rdi, %rbx
movq 16(%rax), %rax
call __x86_indirect_thunk_rax
movq (%rbx), %rax
movq %rbx, %rdi
popq %rbx
.cfi_def_cfa_offset 8
movq 16(%rax), %rax
jmp __x86_indirect_thunk_rax
.cfi_endproc

so that "-mindirect-branch=thunk-extern" is equivalent to
"-mindirect-branch=thunk-extern -mindirect-branch-register", which is
used by Linux kernel.

gcc/

Backport from mainline
2018-02-26  H.J. Lu  <hongjiu.lu@intel.com>

PR target/84039
* config/i386/constraints.md (Bs): Replace
ix86_indirect_branch_register with
TARGET_INDIRECT_BRANCH_REGISTER.
(Bw): Likewise.
* config/i386/i386.md (indirect_jump): Likewise.
(tablejump): Likewise.
(*sibcall_memory): Likewise.
(*sibcall_value_memory): Likewise.
Peepholes of indirect call and jump via memory: Likewise.
(*sibcall_GOT_32): Disallowed for TARGET_INDIRECT_BRANCH_REGISTER.
(*sibcall_value_GOT_32): Likewise.
* config/i386/predicates.md (indirect_branch_operand): Likewise.
(GOT_memory_operand): Likewise.
(call_insn_operand): Likewise.
(sibcall_insn_operand): Likewise.
(GOT32_symbol_operand): Likewise.
* config/i386/i386.h (TARGET_INDIRECT_BRANCH_REGISTER): New.

gcc/testsuite/

Backport from mainline
2018-02-26  H.J. Lu  <hongjiu.lu@intel.com>

PR target/84039
* gcc.target/i386/indirect-thunk-1.c: Updated.
* gcc.target/i386/indirect-thunk-2.c: Likewise.
* gcc.target/i386/indirect-thunk-3.c: Likewise.
* gcc.target/i386/indirect-thunk-4.c: Likewise.
* gcc.target/i386/indirect-thunk-5.c: Likewise.
* gcc.target/i386/indirect-thunk-6.c: Likewise.
* gcc.target/i386/indirect-thunk-7.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-1.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-2.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-3.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-4.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-5.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-6.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-7.c: Likewise.
* gcc.target/i386/indirect-thunk-bnd-1.c: Likewise.
* gcc.target/i386/indirect-thunk-bnd-2.c: Likewise.
* gcc.target/i386/indirect-thunk-bnd-3.c: Likewise.
* gcc.target/i386/indirect-thunk-bnd-4.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-1.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-2.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-3.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-4.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-5.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-6.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-7.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-1.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-2.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-3.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-4.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-5.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-6.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-7.c: Likewise.
* gcc.target/i386/ret-thunk-9.c: Likewise.
* gcc.target/i386/ret-thunk-10.c: Likewise.
* gcc.target/i386/ret-thunk-11.c: Likewise.
* gcc.target/i386/ret-thunk-12.c: Likewise.
* gcc.target/i386/ret-thunk-13.c: Likewise.
* gcc.target/i386/ret-thunk-14.c: Likewise.
* gcc.target/i386/ret-thunk-15.c: Likewise.

From-SVN: r259421

7 years agoi386: Update -mfunction-return= for return with pop
H.J. Lu [Mon, 16 Apr 2018 19:06:32 +0000 (19:06 +0000)] 
i386: Update -mfunction-return= for return with pop

When -mfunction-return= is used, simple_return_pop_internal should pop
return address into ECX register, adjust stack by bytes to pop from stack
and jump to the return thunk via ECX register.

Revision 257992 removed the bool argument from ix86_output_indirect_jmp.
Update comments to reflect it.

Tested on i686 and x86-64.

gcc/

Backport from mainline
2018-02-26  H.J. Lu  <hongjiu.lu@intel.com>

* config/i386/i386.c (ix86_output_indirect_jmp): Update comments.

2018-02-26  H.J. Lu  <hongjiu.lu@intel.com>

PR target/84530
* config/i386/i386-protos.h (ix86_output_indirect_jmp): Remove
the bool argument.
(ix86_output_indirect_function_return): New prototype.
(ix86_split_simple_return_pop_internal): Likewise.
* config/i386/i386.c (indirect_return_via_cx): New.
(indirect_return_via_cx_bnd): Likewise.
(indirect_thunk_name): Handle return va CX_REG.
(output_indirect_thunk_function): Create alias for
__x86_return_thunk_[re]cx and __x86_return_thunk_[re]cx_bnd.
(ix86_output_indirect_jmp): Remove the bool argument.
(ix86_output_indirect_function_return): New function.
(ix86_split_simple_return_pop_internal): Likewise.
* config/i386/i386.md (*indirect_jump): Don't pass false
to ix86_output_indirect_jmp.
(*tablejump_1): Likewise.
(simple_return_pop_internal): Change it to define_insn_and_split.
Call ix86_split_simple_return_pop_internal to split it for
-mfunction-return=.
(simple_return_indirect_internal): Call
ix86_output_indirect_function_return instead of
ix86_output_indirect_jmp.

gcc/testsuite/

Backport from mainline
2018-02-26  H.J. Lu  <hongjiu.lu@intel.com>

PR target/84530
* gcc.target/i386/ret-thunk-22.c: New test.
* gcc.target/i386/ret-thunk-23.c: Likewise.
* gcc.target/i386/ret-thunk-24.c: Likewise.
* gcc.target/i386/ret-thunk-25.c: Likewise.
* gcc.target/i386/ret-thunk-26.c: Likewise.

From-SVN: r259420

7 years agoi386: Pass INVALID_REGNUM as invalid register number
H.J. Lu [Mon, 16 Apr 2018 19:05:09 +0000 (19:05 +0000)] 
i386: Pass INVALID_REGNUM as invalid register number

Backport from mainline
* config/i386/i386.c (ix86_output_function_return): Pass
INVALID_REGNUM, instead of -1, as invalid register number to
indirect_thunk_name and output_indirect_thunk.

From-SVN: r259419

7 years agoUse INVALID_REGNUM in indirect thunk processing
H.J. Lu [Mon, 16 Apr 2018 19:03:51 +0000 (19:03 +0000)] 
Use INVALID_REGNUM in indirect thunk processing

Backport from mainline
2018-01-17  Uros Bizjak  <ubizjak@gmail.com>

* config/i386/i386.c (indirect_thunk_name): Declare regno
as unsigned int.  Compare regno with INVALID_REGNUM.
(output_indirect_thunk): Ditto.
(output_indirect_thunk_function): Ditto.
(ix86_code_end): Declare regno as unsigned int.  Use INVALID_REGNUM
in the call to output_indirect_thunk_function.

From-SVN: r259418

7 years agox86: Disallow -mindirect-branch=/-mfunction-return= with -mcmodel=large
H.J. Lu [Mon, 16 Apr 2018 19:03:00 +0000 (19:03 +0000)] 
x86: Disallow -mindirect-branch=/-mfunction-return= with -mcmodel=large

Since the thunk function may not be reachable in large code model,
-mcmodel=large is incompatible with -mindirect-branch=thunk,
-mindirect-branch=thunk-extern, -mfunction-return=thunk and
-mfunction-return=thunk-extern.  Issue an error when they are used with
-mcmodel=large.

gcc/

Backport from mainline
2018-01-14  H.J. Lu  <hongjiu.lu@intel.com>

* config/i386/i386.c (ix86_set_indirect_branch_type): Disallow
-mcmodel=large with -mindirect-branch=thunk,
-mindirect-branch=thunk-extern, -mfunction-return=thunk and
-mfunction-return=thunk-extern.
* doc/invoke.texi: Document -mcmodel=large is incompatible with
-mindirect-branch=thunk, -mindirect-branch=thunk-extern,
-mfunction-return=thunk and -mfunction-return=thunk-extern.

gcc/testsuite/

Backport from mainline
2018-01-14  H.J. Lu  <hongjiu.lu@intel.com>

* gcc.target/i386/indirect-thunk-10.c: New test.
* gcc.target/i386/indirect-thunk-8.c: Likewise.
* gcc.target/i386/indirect-thunk-9.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-10.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-11.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-9.c: Likewise.
* gcc.target/i386/ret-thunk-17.c: Likewise.
* gcc.target/i386/ret-thunk-18.c: Likewise.
* gcc.target/i386/ret-thunk-19.c: Likewise.
* gcc.target/i386/ret-thunk-20.c: Likewise.
* gcc.target/i386/ret-thunk-21.c: Likewise.

From-SVN: r259417

7 years agox86: Add 'V' register operand modifier
H.J. Lu [Mon, 16 Apr 2018 19:00:53 +0000 (19:00 +0000)] 
x86: Add 'V' register operand modifier

Add 'V', a special modifier which prints the name of the full integer
register without '%'.  For

extern void (*func_p) (void);

void
foo (void)
{
  asm ("call __x86_indirect_thunk_%V0" : : "a" (func_p));
}

it generates:

foo:
movq func_p(%rip), %rax
call __x86_indirect_thunk_rax
ret

gcc/

Backport from mainline
2018-01-14  H.J. Lu  <hongjiu.lu@intel.com>

* config/i386/i386.c (print_reg): Print the name of the full
integer register without '%'.
(ix86_print_operand): Handle 'V'.
 * doc/extend.texi: Document 'V' modifier.

gcc/testsuite/

Backport from mainline
2018-01-14  H.J. Lu  <hongjiu.lu@intel.com>

* gcc.target/i386/indirect-thunk-register-4.c: New test.

From-SVN: r259416

7 years agox86: Add -mindirect-branch-register
H.J. Lu [Mon, 16 Apr 2018 18:59:22 +0000 (18:59 +0000)] 
x86: Add -mindirect-branch-register

Add -mindirect-branch-register to force indirect branch via register.
This is implemented by disabling patterns of indirect branch via memory,
similar to TARGET_X32.

-mindirect-branch= and -mfunction-return= tests are updated with
-mno-indirect-branch-register to avoid false test failures when
-mindirect-branch-register is added to RUNTESTFLAGS for "make check".

gcc/

Backport from mainline
2018-01-14  H.J. Lu  <hongjiu.lu@intel.com>

* config/i386/constraints.md (Bs): Disallow memory operand for
-mindirect-branch-register.
(Bw): Likewise.
* config/i386/predicates.md (indirect_branch_operand): Likewise.
(GOT_memory_operand): Likewise.
(call_insn_operand): Likewise.
(sibcall_insn_operand): Likewise.
(GOT32_symbol_operand): Likewise.
* config/i386/i386.md (indirect_jump): Call convert_memory_address
for -mindirect-branch-register.
(tablejump): Likewise.
(*sibcall_memory): Likewise.
(*sibcall_value_memory): Likewise.
Disallow peepholes of indirect call and jump via memory for
-mindirect-branch-register.
(*call_pop): Replace m with Bw.
(*call_value_pop): Likewise.
(*sibcall_pop_memory): Replace m with Bs.
* config/i386/i386.opt (mindirect-branch-register): New option.
* doc/invoke.texi: Document -mindirect-branch-register option.

gcc/testsuite/

Backport from mainline
2018-01-14  H.J. Lu  <hongjiu.lu@intel.com>

* gcc.target/i386/indirect-thunk-1.c (dg-options): Add
-mno-indirect-branch-register.
* gcc.target/i386/indirect-thunk-2.c: Likewise.
* gcc.target/i386/indirect-thunk-3.c: Likewise.
* gcc.target/i386/indirect-thunk-4.c: Likewise.
* gcc.target/i386/indirect-thunk-5.c: Likewise.
* gcc.target/i386/indirect-thunk-6.c: Likewise.
* gcc.target/i386/indirect-thunk-7.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-1.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-2.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-3.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-4.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-5.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-6.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-7.c: Likewise.
* gcc.target/i386/indirect-thunk-bnd-1.c: Likewise.
* gcc.target/i386/indirect-thunk-bnd-2.c: Likewise.
* gcc.target/i386/indirect-thunk-bnd-3.c: Likewise.
* gcc.target/i386/indirect-thunk-bnd-4.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-1.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-2.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-3.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-4.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-5.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-6.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-7.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-1.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-2.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-3.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-4.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-5.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-6.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-7.c: Likewise.
* gcc.target/i386/ret-thunk-10.c: Likewise.
* gcc.target/i386/ret-thunk-11.c: Likewise.
* gcc.target/i386/ret-thunk-12.c: Likewise.
* gcc.target/i386/ret-thunk-13.c: Likewise.
* gcc.target/i386/ret-thunk-14.c: Likewise.
* gcc.target/i386/ret-thunk-15.c: Likewise.
* gcc.target/i386/ret-thunk-9.c: Likewise.
* gcc.target/i386/indirect-thunk-register-1.c: New test.
* gcc.target/i386/indirect-thunk-register-2.c: Likewise.
* gcc.target/i386/indirect-thunk-register-3.c: Likewise.

i386: Rename to ix86_indirect_branch_register

Rename the variable for -mindirect-branch-register to
ix86_indirect_branch_register to match the command-line option name.

Backport from mainline
2018-01-15  H.J. Lu  <hongjiu.lu@intel.com>

* config/i386/constraints.md (Bs): Replace
ix86_indirect_branch_thunk_register with
ix86_indirect_branch_register.
(Bw): Likewise.
* config/i386/i386.md (indirect_jump): Likewise.
(tablejump): Likewise.
(*sibcall_memory): Likewise.
(*sibcall_value_memory): Likewise.
Peepholes of indirect call and jump via memory: Likewise.
* config/i386/i386.opt: Likewise.
* config/i386/predicates.md (indirect_branch_operand): Likewise.
(GOT_memory_operand): Likewise.
(call_insn_operand): Likewise.
(sibcall_insn_operand): Likewise.
(GOT32_symbol_operand): Likewise.

x86: Rewrite ix86_indirect_branch_register logic

Rewrite ix86_indirect_branch_register logic with

(and (not (match_test "ix86_indirect_branch_register"))
     (original condition before r256662))

Backport from mainline
2018-01-15  H.J. Lu  <hongjiu.lu@intel.com>

* config/i386/predicates.md (constant_call_address_operand):
Rewrite ix86_indirect_branch_register logic.
(sibcall_insn_operand): Likewise.

Don't check ix86_indirect_branch_register for GOT operand

Since GOT_memory_operand and GOT32_symbol_operand are simple pattern
matches, don't check ix86_indirect_branch_register here.  If needed,
-mindirect-branch= will convert indirect branch via GOT slot to a call
and return thunk.

Backport from mainline
2018-01-15  H.J. Lu  <hongjiu.lu@intel.com>

* config/i386/constraints.md (Bs): Update
ix86_indirect_branch_register check.  Don't check
ix86_indirect_branch_register with GOT_memory_operand.
(Bw): Likewise.
* config/i386/predicates.md (GOT_memory_operand): Don't check
ix86_indirect_branch_register here.
(GOT32_symbol_operand): Likewise.

i386: Rewrite indirect_branch_operand logic

Backport from mainline
2018-01-15  H.J. Lu  <hongjiu.lu@intel.com>

* config/i386/predicates.md (indirect_branch_operand): Rewrite
ix86_indirect_branch_register logic.

From-SVN: r259415

7 years agox86: Add -mfunction-return=
H.J. Lu [Mon, 16 Apr 2018 18:55:04 +0000 (18:55 +0000)] 
x86: Add -mfunction-return=

Add -mfunction-return= option to convert function return to call and
return thunks.  The default is 'keep', which keeps function return
unmodified.  'thunk' converts function return to call and return thunk.
'thunk-inline' converts function return to inlined call and return thunk.
'thunk-extern' converts function return to external call and return
thunk provided in a separate object file.  You can control this behavior
for a specific function by using the function attribute function_return.

Function return thunk is the same as memory thunk for -mindirect-branch=
where the return address is at the top of the stack:

__x86_return_thunk:
call L2
L1:
pause
lfence
jmp L1
L2:
lea 8(%rsp), %rsp|lea 4(%esp), %esp
ret

and function return becomes

jmp __x86_return_thunk

-mindirect-branch= tests are updated with -mfunction-return=keep to
avoid false test failures when -mfunction-return=thunk is added to
RUNTESTFLAGS for "make check".

gcc/

Backport from mainline
2018-01-14  H.J. Lu  <hongjiu.lu@intel.com>

* config/i386/i386-protos.h (ix86_output_function_return): New.
* config/i386/i386.c (ix86_set_indirect_branch_type): Also
set function_return_type.
(indirect_thunk_name): Add ret_p to indicate thunk for function
return.
(output_indirect_thunk_function): Pass false to
indirect_thunk_name.
(ix86_output_indirect_branch_via_reg): Likewise.
(ix86_output_indirect_branch_via_push): Likewise.
(output_indirect_thunk_function): Create alias for function
return thunk if regno < 0.
(ix86_output_function_return): New function.
(ix86_handle_fndecl_attribute): Handle function_return.
(ix86_attribute_table): Add function_return.
* config/i386/i386.h (machine_function): Add
function_return_type.
* config/i386/i386.md (simple_return_internal): Use
ix86_output_function_return.
(simple_return_internal_long): Likewise.
* config/i386/i386.opt (mfunction-return=): New option.
(indirect_branch): Mention -mfunction-return=.
* doc/extend.texi: Document function_return function attribute.
* doc/invoke.texi: Document -mfunction-return= option.

gcc/testsuite/

Backport from mainline
2018-01-14  H.J. Lu  <hongjiu.lu@intel.com>

* gcc.target/i386/indirect-thunk-1.c (dg-options): Add
-mfunction-return=keep.
* gcc.target/i386/indirect-thunk-2.c: Likewise.
* gcc.target/i386/indirect-thunk-3.c: Likewise.
* gcc.target/i386/indirect-thunk-4.c: Likewise.
* gcc.target/i386/indirect-thunk-5.c: Likewise.
* gcc.target/i386/indirect-thunk-6.c: Likewise.
* gcc.target/i386/indirect-thunk-7.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-1.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-2.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-3.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-4.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-5.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-6.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-7.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-8.c: Likewise.
* gcc.target/i386/indirect-thunk-bnd-1.c: Likewise.
* gcc.target/i386/indirect-thunk-bnd-2.c: Likewise.
* gcc.target/i386/indirect-thunk-bnd-3.c: Likewise.
* gcc.target/i386/indirect-thunk-bnd-4.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-1.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-2.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-3.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-4.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-5.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-6.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-7.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-1.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-2.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-3.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-4.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-5.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-6.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-7.c: Likewise.
* gcc.target/i386/ret-thunk-1.c: New test.
* gcc.target/i386/ret-thunk-10.c: Likewise.
* gcc.target/i386/ret-thunk-11.c: Likewise.
* gcc.target/i386/ret-thunk-12.c: Likewise.
* gcc.target/i386/ret-thunk-13.c: Likewise.
* gcc.target/i386/ret-thunk-14.c: Likewise.
* gcc.target/i386/ret-thunk-15.c: Likewise.
* gcc.target/i386/ret-thunk-16.c: Likewise.
* gcc.target/i386/ret-thunk-2.c: Likewise.
* gcc.target/i386/ret-thunk-3.c: Likewise.
* gcc.target/i386/ret-thunk-4.c: Likewise.
* gcc.target/i386/ret-thunk-5.c: Likewise.
* gcc.target/i386/ret-thunk-6.c: Likewise.
* gcc.target/i386/ret-thunk-7.c: Likewise.
* gcc.target/i386/ret-thunk-8.c: Likewise.
* gcc.target/i386/ret-thunk-9.c: Likewise.

i386: Don't use ASM_OUTPUT_DEF for TARGET_MACHO

ASM_OUTPUT_DEF isn't defined for TARGET_MACHO.  Use ASM_OUTPUT_LABEL to
generate the __x86_return_thunk label, instead of the set directive.
Update testcase to remove the __x86_return_thunk label check.  Since
-fno-pic is ignored on Darwin, update testcases to sscan or "push"
only on Linux.

gcc/

Backport from mainline
2018-01-15  H.J. Lu  <hongjiu.lu@intel.com>

PR target/83839
* config/i386/i386.c (output_indirect_thunk_function): Use
ASM_OUTPUT_LABEL, instead of ASM_OUTPUT_DEF, for TARGET_MACHO
for  __x86.return_thunk.

gcc/testsuite/

Backport from mainline
2018-01-15  H.J. Lu  <hongjiu.lu@intel.com>

PR target/83839
* gcc.target/i386/indirect-thunk-1.c: Scan for "push" only on
Linux.
* gcc.target/i386/indirect-thunk-2.c: Likewise.
* gcc.target/i386/indirect-thunk-3.c: Likewise.
* gcc.target/i386/indirect-thunk-4.c: Likewise.
* gcc.target/i386/indirect-thunk-7.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-1.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-2.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-5.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-6.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-7.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-1.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-2.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-3.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-4.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-7.c: Likewise.
* gcc.target/i386/indirect-thunk-register-1.c: Likewise.
* gcc.target/i386/indirect-thunk-register-3.c: Likewise.
* gcc.target/i386/indirect-thunk-register-4.c: Likewise.
* gcc.target/i386/ret-thunk-10.c: Likewise.
* gcc.target/i386/ret-thunk-11.c: Likewise.
* gcc.target/i386/ret-thunk-12.c: Likewise.
* gcc.target/i386/ret-thunk-13.c: Likewise.
* gcc.target/i386/ret-thunk-14.c: Likewise.
* gcc.target/i386/ret-thunk-15.c: Likewise.
* gcc.target/i386/ret-thunk-9.c: Don't check the
__x86_return_thunk label.
Scan for "push" only for Linux.

From-SVN: r259414

7 years agox86: Add -mindirect-branch=
H.J. Lu [Mon, 16 Apr 2018 18:50:52 +0000 (18:50 +0000)] 
x86: Add -mindirect-branch=

Add -mindirect-branch= option to convert indirect call and jump to call
and return thunks.  The default is 'keep', which keeps indirect call and
jump unmodified.  'thunk' converts indirect call and jump to call and
return thunk.  'thunk-inline' converts indirect call and jump to inlined
call and return thunk.  'thunk-extern' converts indirect call and jump to
external call and return thunk provided in a separate object file.  You
can control this behavior for a specific function by using the function
attribute indirect_branch.

2 kinds of thunks are geneated.  Memory thunk where the function address
is at the top of the stack:

__x86_indirect_thunk:
call L2
L1:
pause
lfence
jmp L1
L2:
lea 8(%rsp), %rsp|lea 4(%esp), %esp
ret

Indirect jmp via memory, "jmp mem", is converted to

push memory
jmp __x86_indirect_thunk

Indirect call via memory, "call mem", is converted to

jmp L2
L1:
push [mem]
jmp __x86_indirect_thunk
L2:
call L1

Register thunk where the function address is in a register, reg:

__x86_indirect_thunk_reg:
call L2
L1:
pause
lfence
jmp L1
L2:
movq %reg, (%rsp)|movl    %reg, (%esp)
ret

where reg is one of (r|e)ax, (r|e)dx, (r|e)cx, (r|e)bx, (r|e)si, (r|e)di,
(r|e)bp, r8, r9, r10, r11, r12, r13, r14 and r15.

Indirect jmp via register, "jmp reg", is converted to

jmp __x86_indirect_thunk_reg

Indirect call via register, "call reg", is converted to

call __x86_indirect_thunk_reg

gcc/

Backport from mainline
2018-01-14  H.J. Lu  <hongjiu.lu@intel.com>

* config/i386/i386-opts.h (indirect_branch): New.
* config/i386/i386-protos.h (ix86_output_indirect_jmp): Likewise.
* config/i386/i386.c (ix86_using_red_zone): Disallow red-zone
with local indirect jump when converting indirect call and jump.
(ix86_set_indirect_branch_type): New.
(ix86_set_current_function): Call ix86_set_indirect_branch_type.
(indirectlabelno): New.
(indirect_thunk_needed): Likewise.
(indirect_thunk_bnd_needed): Likewise.
(indirect_thunks_used): Likewise.
(indirect_thunks_bnd_used): Likewise.
(INDIRECT_LABEL): Likewise.
(indirect_thunk_name): Likewise.
(output_indirect_thunk): Likewise.
(output_indirect_thunk_function): Likewise.
(ix86_output_indirect_branch_via_reg): Likewise.
(ix86_output_indirect_branch_via_push): Likewise.
(ix86_output_indirect_branch): Likewise.
(ix86_output_indirect_jmp): Likewise.
(ix86_code_end): Call output_indirect_thunk_function if needed.
(ix86_output_call_insn): Call ix86_output_indirect_branch if
needed.
(ix86_handle_fndecl_attribute): Handle indirect_branch.
(ix86_attribute_table): Add indirect_branch.
* config/i386/i386.h (machine_function): Add indirect_branch_type
and has_local_indirect_jump.
* config/i386/i386.md (indirect_jump): Set has_local_indirect_jump
to true.
(tablejump): Likewise.
(*indirect_jump): Use ix86_output_indirect_jmp.
(*tablejump_1): Likewise.
(simple_return_indirect_internal): Likewise.
* config/i386/i386.opt (mindirect-branch=): New option.
(indirect_branch): New.
(keep): Likewise.
(thunk): Likewise.
(thunk-inline): Likewise.
(thunk-extern): Likewise.
* doc/extend.texi: Document indirect_branch function attribute.
* doc/invoke.texi: Document -mindirect-branch= option.

gcc/testsuite/

Backport from mainline
2018-01-14  H.J. Lu  <hongjiu.lu@intel.com>

* gcc.target/i386/indirect-thunk-1.c: New test.
* gcc.target/i386/indirect-thunk-2.c: Likewise.
* gcc.target/i386/indirect-thunk-3.c: Likewise.
* gcc.target/i386/indirect-thunk-4.c: Likewise.
* gcc.target/i386/indirect-thunk-5.c: Likewise.
* gcc.target/i386/indirect-thunk-6.c: Likewise.
* gcc.target/i386/indirect-thunk-7.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-1.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-2.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-3.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-4.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-5.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-6.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-7.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-8.c: Likewise.
* gcc.target/i386/indirect-thunk-bnd-1.c: Likewise.
* gcc.target/i386/indirect-thunk-bnd-2.c: Likewise.
* gcc.target/i386/indirect-thunk-bnd-3.c: Likewise.
* gcc.target/i386/indirect-thunk-bnd-4.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-1.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-2.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-3.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-4.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-5.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-6.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-7.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-1.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-2.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-3.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-4.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-5.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-6.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-7.c: Likewise.

From-SVN: r259413

7 years agoCheck in the missing change
H.J. Lu [Mon, 16 Apr 2018 18:47:16 +0000 (11:47 -0700)] 
Check in the missing change

From-SVN: r259412

7 years agoi386: Use const reference of struct ix86_frame to avoid copy
H.J. Lu [Mon, 16 Apr 2018 18:44:43 +0000 (11:44 -0700)] 
i386: Use const reference of struct ix86_frame to avoid copy

We can use const reference of struct ix86_frame to avoid making a local
copy of ix86_frame.  ix86_expand_epilogue makes a local copy of struct
ix86_frame and uses the reg_save_offset field as a local variable.  This
patch uses a separate local variable for reg_save_offset.

Tested on x86-64 with ada.

Backport from mainline
PR target/83905
* config/i386/i386.c (ix86_expand_prologue): Use cost reference
of struct ix86_frame.
(ix86_expand_epilogue): Likewise.  Add a local variable for
the reg_save_offset field in struct ix86_frame.

From-SVN: r259411

7 years agoi386: Use reference of struct ix86_frame to avoid copy
H.J. Lu [Mon, 16 Apr 2018 18:43:57 +0000 (18:43 +0000)] 
i386: Use reference of struct ix86_frame to avoid copy

When there is no need to make a copy of ix86_frame, we can use reference
of struct ix86_frame to avoid copy.

Backport from mainline
2017-11-06  H.J. Lu  <hongjiu.lu@intel.com>

* config/i386/i386.c (ix86_can_use_return_insn_p): Use reference
of struct ix86_frame.
(ix86_initial_elimination_offset): Likewise.
(ix86_expand_split_stack_prologue): Likewise.

From-SVN: r259410

7 years agoi386: Move struct ix86_frame to machine_function
H.J. Lu [Mon, 16 Apr 2018 18:42:57 +0000 (18:42 +0000)] 
i386: Move struct ix86_frame to machine_function

Make ix86_frame available to i386 code generation.  This is needed to
backport the patch set of -mindirect-branch= to mitigate variant #2 of
the speculative execution vulnerabilities on x86 processors identified
by CVE-2017-5715, aka Spectre.

Backport from mainline
2017-10-13  H.J. Lu  <hongjiu.lu@intel.com>

PR target/82499
* config/i386/i386.h (ix86_red_zone_size): New.

2017-06-01  Bernd Edlinger  <bernd.edlinger@hotmail.de>

* config/i386/i386.c (ix86_frame): Moved to ...
* config/i386/i386.h (ix86_frame): Here.
(machine_function): Add frame.
* config/i386/i386.c (ix86_compute_frame_layout): Repace the
frame argument with &cfun->machine->frame.
(ix86_can_use_return_insn_p): Don't pass &frame to
ix86_compute_frame_layout.  Copy frame from cfun->machine->frame.
(ix86_can_eliminate): Likewise.
(ix86_expand_prologue): Likewise.
(ix86_expand_epilogue): Likewise.
(ix86_expand_split_stack_prologue): Likewise.

From-SVN: r259408

7 years agoDaily bump.
GCC Administrator [Mon, 16 Apr 2018 00:16:06 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r259390

7 years agoDaily bump.
GCC Administrator [Sun, 15 Apr 2018 00:16:05 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r259387

7 years agoDaily bump.
GCC Administrator [Sat, 14 Apr 2018 00:16:05 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r259381

7 years agoDaily bump.
GCC Administrator [Fri, 13 Apr 2018 00:16:06 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r259361

7 years agoIBM Z: Spectre: Prevent thunk cfi to be emitted with -fno-dwarf2-cfi-asm
Andreas Krebbel [Thu, 12 Apr 2018 10:22:35 +0000 (10:22 +0000)] 
IBM Z: Spectre: Prevent thunk cfi to be emitted with -fno-dwarf2-cfi-asm

The CFI magic we emit as part of the indirect branch thunks in order to
have somewhat sane unwind information must not be emitted with
-fno-dwarf2-cfi-asm.

gcc/ChangeLog:

2018-04-12  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

Backport from mainline
2018-04-12  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

* config/s390/s390.c (s390_output_indirect_thunk_function): Check
also for flag_dwarf2_cfi_asm.

gcc/testsuite/ChangeLog:

2018-04-12  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

Backport from mainline
2018-04-12  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

* gcc.target/s390/nobp-no-dwarf2-cfi.c: New test.

From-SVN: r259342

7 years agoDaily bump.
GCC Administrator [Thu, 12 Apr 2018 00:16:05 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r259334

7 years agoalpha.md (stack_probe_internal): Rename from "probe_stack".
Uros Bizjak [Wed, 11 Apr 2018 19:03:51 +0000 (21:03 +0200)] 
alpha.md (stack_probe_internal): Rename from "probe_stack".

* config/alpha/alpha.md (stack_probe_internal): Rename
from "probe_stack".  Update all callers.

From-SVN: r259330

7 years agoDaily bump.
GCC Administrator [Wed, 11 Apr 2018 00:16:05 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r259305

7 years ago[PR target/85056] Address -Wmaybe-uninitialized diagnostic
Thomas Schwinge [Tue, 10 Apr 2018 16:55:55 +0000 (18:55 +0200)] 
[PR target/85056] Address -Wmaybe-uninitialized diagnostic

gcc/testsuite/
* gcc.target/nvptx/pr85056.c (main): Initialize "sum".

trunk r259288

From-SVN: r259290

7 years ago[AArch64] PR target/84748: Mark *compare_cstore<mode>_insn as clobbering CC reg
Kyrylo Tkachov [Tue, 10 Apr 2018 13:05:24 +0000 (13:05 +0000)] 
[AArch64] PR target/84748: Mark *compare_cstore<mode>_insn as clobbering CC reg

Backport from mainline
2018-03-08  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

PR target/84748
* config/aarch64/aarch64.md (*compare_cstore<mode>_insn): Mark pattern
as clobbering CC_REGNUM.

* gcc.c-torture/execute/pr84748.c: New test.

From-SVN: r259271

7 years agoDaily bump.
GCC Administrator [Tue, 10 Apr 2018 00:16:12 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r259261

7 years agoDaily bump.
GCC Administrator [Mon, 9 Apr 2018 00:16:18 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r259225

7 years agoDaily bump.
GCC Administrator [Sun, 8 Apr 2018 00:16:04 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r259213

7 years agoDaily bump.
GCC Administrator [Sat, 7 Apr 2018 00:16:05 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r259198

7 years agore PR middle-end/85196 (ICE in extract_insn, at recog.c:2311: unrecognizable insn)
Eric Botcazou [Fri, 6 Apr 2018 22:33:55 +0000 (22:33 +0000)] 
re PR middle-end/85196 (ICE in extract_insn, at recog.c:2311: unrecognizable insn)

PR target/85196
* config/sparc/sparc.c (sparc_expand_move): Deal with symbolic operands
based on LABEL_REF.  Remove useless assertion.
(pic_address_needs_scratch): Fix formatting.
(sparc_legitimize_pic_address): Minor tweaks.
(sparc_delegitimize_address): Adjust assertion accordingly.
* config/sparc/sparc.md (movsi_pic_label_ref): Change label_ref_operand
into symbolic_operand.
(movsi_high_pic_label_ref): Likewise.
(movsi_lo_sum_pic_label_ref): Likewise.
(movdi_pic_label_ref): Likewise.
(movdi_high_pic_label_ref): Likewise.
(movdi_lo_sum_pic_label_ref): Likewise.

From-SVN: r259196

7 years agoDaily bump.
GCC Administrator [Fri, 6 Apr 2018 00:16:04 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r259157

7 years agore PR target/85193 (ICE: SIGSEGV in memory_operand at recog.c:1361 with -O2 -fno...
Uros Bizjak [Thu, 5 Apr 2018 20:32:18 +0000 (22:32 +0200)] 
re PR target/85193 (ICE: SIGSEGV in memory_operand at recog.c:1361 with -O2 -fno-tree-ccp -fno-tree-fre -mno-sse)

PR target/85193
* config/i386/i386.md (define_attr "memory"): Handle rotate1 type.

testsuite/ChangeLog:

PR target/85193
* gcc.target/i386/pr85193.c: New test.

From-SVN: r259153

7 years agoDaily bump.
GCC Administrator [Thu, 5 Apr 2018 00:16:05 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r259109

7 years agoDaily bump.
GCC Administrator [Wed, 4 Apr 2018 00:16:11 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r259062

7 years agoDaily bump.
GCC Administrator [Tue, 3 Apr 2018 00:16:07 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r259022

7 years agobackport: re PR target/84912 (__builtin_divde* produce Internal Compiler Error when...
Peter Bergner [Mon, 2 Apr 2018 23:54:20 +0000 (18:54 -0500)] 
backport: re PR target/84912 (__builtin_divde* produce Internal Compiler Error when compiled -m32)

gcc/
Backport from mainline
2018-03-28  Peter Bergner  <bergner@vnet.ibm.com>

PR target/84912
* config/rs6000/rs6000.h: Update copyright date.
(RS6000_BTM_POWERPC64): New define.
(RS6000_BTM_COMMON): Add RS6000_BTM_POWERPC64.
* config/rs6000/rs6000.c: Update copyright date.
(rs6000_builtin_mask_calculate): Add support for RS6000_BTM_POWERPC64.
(rs6000_invalid_builtin): Add handling for RS6000_BTM_POWERPC64
(rs6000_builtin_mask_names): Add RS6000_BTM_POWERPC64.
* config/rs6000/rs6000-builtin.def: Update copyright date.
(BU_P7_POWERPC64_MISC_2): New macro definition.
(DIVDE): Use it.
(DIVDEU): Likewise.

Backport from mainline
2018-03-28  Peter Bergner  <bergner@vnet.ibm.com>

PR target/84912
* config/rs6000/rs6000-builtin.def (DIVWEO): Delete macro expansion.
(DIVWEUO): Likewise.
(DIVDEO): Likewise.
(DIVDEUO): Likewise.
* config/rs6000/rs6000.c (builtin_function_type): Remove support for
DIVWEUO and DIVDEUO.
* config/rs6000/rs6000.md: Update copyright date.
(UNSPEC_DIVEO, UNSPEC_DIVEUO): Delete unspecs.
(UNSPEC_DIV_EXTEND): Remove deleted unspecs.
(div_extend): Likewise.
* doc/extend.texi: Update copyright date.
(__builtin_divweo): Remove documentation for deleted builtin function.
(__builtin_divweuo): Likewise.
(__builtin_divdeo): Likewise.
(__builtin_divdeuo): Likewise.

gcc/testsuite/
Backport from mainline
2018-03-28  Peter Bergner  <bergner@vnet.ibm.com>

PR target/84912
* gcc.target/powerpc/extend-divide-1.c (div_weo): Remove test for
deleted builtin function.
(div_weuo): Likewise.
* gcc.target/powerpc/extend-divide-2.c (div_deo): Likewise.
(div_deuo): Likewise.

From-SVN: r259021

7 years agoi386: Enable AVX/AVX512 features only if supported by OSXSAVE
H.J. Lu [Mon, 2 Apr 2018 12:09:48 +0000 (12:09 +0000)] 
i386: Enable AVX/AVX512 features only if supported by OSXSAVE

Enable AVX and AVX512 features only if their states are supported by
OSXSAVE.

Backport from mainline
PR target/85100
* config/i386/cpuinfo.c (XCR_XFEATURE_ENABLED_MASK): New.
(XSTATE_FP): Likewise.
(XSTATE_SSE): Likewise.
(XSTATE_YMM): Likewise.
(XSTATE_OPMASK): Likewise.
(XSTATE_ZMM): Likewise.
(XSTATE_HI_ZMM): Likewise.
(XCR_AVX_ENABLED_MASK): Likewise.
(XCR_AVX512F_ENABLED_MASK): Likewise.
(get_available_features): Enable AVX and AVX512 features only
if their states are supported by OSXSAVE.

From-SVN: r259007

7 years agoDaily bump.
GCC Administrator [Mon, 2 Apr 2018 00:16:05 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r259000

7 years agoDaily bump.
GCC Administrator [Sun, 1 Apr 2018 00:16:04 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r258991

7 years agoDaily bump.
GCC Administrator [Sat, 31 Mar 2018 00:16:06 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r258984

7 years agore PR target/85056 ([nvptx] wrong declaration of external arrays)
Cesar Philippidis [Fri, 30 Mar 2018 15:47:23 +0000 (08:47 -0700)] 
re PR target/85056 ([nvptx] wrong declaration of external arrays)

PR target/85056

Backport from mainline
2018-03-27  Cesar Philippidis  <cesar@codesourcery.com>

PR target/85056

gcc/
* config/nvptx/nvptx.c (nvptx_assemble_decl_begin): Add '[]' to
extern array declarations.

gcc/testsuite/
* testsuite/gcc.target/nvptx/pr85056.c: New test.
* testsuite/gcc.target/nvptx/pr85056a.c: New test.

From-SVN: r258978

7 years agoDaily bump.
GCC Administrator [Fri, 30 Mar 2018 00:16:05 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r258968

7 years agoImplement P0962
Ville Voutilainen [Thu, 29 Mar 2018 14:10:22 +0000 (17:10 +0300)] 
Implement P0962

Backport from mainline
2018-03-23  Ville Voutilainen  <ville.voutilainen@gmail.com>

Implement P0962
        * parser.c (cp_parser_perform_range_for_lookup): Change
        the condition for deciding whether to use members.

From-SVN: r258956

7 years ago[ARM][PR target/84826] Fix ICE in extract_insn, at recog.c:2304 on
Sudakshina Das [Thu, 29 Mar 2018 09:27:53 +0000 (09:27 +0000)] 
[ARM][PR target/84826] Fix ICE in extract_insn, at recog.c:2304 on
arm-linux-gnueabihf

This patch backports r258777 and r258805 to gcc-7-branch
and gcc-6-branch. The same ICE occurs in both the branches with
-fstack-check. Thus the test case directive has been changed.

The discussion on the patch that went into trunk is:
https://gcc.gnu.org/ml/gcc-patches/2018-03/msg01120.html

ChangeLog entries:

*** gcc/ChangeLog ***

2018-03-29  Sudakshina Das  <sudi.das@arm.com>

Backport from mainline
2018-03-22  Sudakshina Das  <sudi.das@arm.com>

PR target/84826
* config/arm/arm.h (machine_function): Add static_chain_stack_bytes.
* config/arm/arm.c (arm_compute_static_chain_stack_bytes): Avoid
re-computing once computed.
(arm_expand_prologue): Compute machine->static_chain_stack_bytes.
(arm_init_machine_status): Initialize
machine->static_chain_stack_bytes.

*** gcc/testsuite/ChangeLog ***

2018-03-29  Sudakshina Das  <sudi.das@arm.com>

* gcc.target/arm/pr84826.c: Change dg-option to -fstack-check.

Backport from mainline
2018-03-23  Sudakshina Das  <sudi.das@arm.com>

PR target/84826
* gcc.target/arm/pr84826.c: Add dg directive.

Backport from mainline
2018-03-22  Sudakshina Das  <sudi.das@arm.com>

PR target/84826
* gcc.target/arm/pr84826.c: New test.

From-SVN: r258949

7 years agoDaily bump.
GCC Administrator [Thu, 29 Mar 2018 00:16:05 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r258944

7 years agocrypto-builtin-1-runnable: Add p8vector_hw to dg-do run.
Carl Love [Wed, 28 Mar 2018 21:04:55 +0000 (21:04 +0000)] 
crypto-builtin-1-runnable: Add p8vector_hw to dg-do run.

gcc/testsuite/ChangeLog:

2018-03-28  Carl Love  <cel@us.ibm.com>

* gcc.target/powerpc/crypto-builtin-1-runnable:  Add
p8vector_hw to dg-do run.

From-SVN: r258938

7 years agore PR fortran/85084 (ICE: out of memory allocating 18446744073709551600 bytes ...)
Thomas Koenig [Wed, 28 Mar 2018 17:41:51 +0000 (17:41 +0000)] 
re PR fortran/85084 (ICE: out of memory allocating 18446744073709551600 bytes ...)

2018-03-28  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/85084
Backport from trunk.
* frontend-passes.c (gfc_run_passes): Do not run front-end
optimizations if a previous error occurred.

2018-03-28  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/85084
Backport from trunk.
* gfortran.dg/matmul_rank_1.f90: New test.

From-SVN: r258927

7 years ago[arm] PR target/85026: Fix ldrsh length estimate in Thumb state
Kyrylo Tkachov [Wed, 28 Mar 2018 10:38:36 +0000 (10:38 +0000)] 
[arm] PR target/85026: Fix ldrsh length estimate in Thumb state

Backport from mainline
2018-03-23  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

PR target/85026
* config/arm/arm.md (unaligned_loadhis): Remove first alternative.
Clean up attributes.

* g++.dg/pr85026.C: New test.

From-SVN: r258918

7 years agoDaily bump.
GCC Administrator [Wed, 28 Mar 2018 00:16:05 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r258910

7 years agors6000: -mreadonly-in-sdata (PR82411)
Segher Boessenkool [Tue, 27 Mar 2018 23:28:25 +0000 (01:28 +0200)] 
rs6000: -mreadonly-in-sdata (PR82411)

This adds a new option -mreadonly-in-sdata (on by default) that
controls whether readonly data can be put in sdata.  (For EABI this
does nothing, readonly data is put in sdata2 as usual).

Backport from mainline
2018-03-08  Segher Boessenkool  <segher@kernel.crashing.org>

PR target/82411
* config/rs6000/rs6000.c (rs6000_elf_in_small_data_p): Don't put
readonly data in sdata, if that is disabled.
* config/rs6000/sysv4.opt (mreadonly-in-sdata): New option.
* doc/invoke.texi (RS/6000 and PowerPC Options): Document
-mreadonly-in-sdata option.

gcc/testsuite/
Backport from mainline
2018-03-08  Segher Boessenkool  <segher@kernel.crashing.org>

PR target/82411
* gcc.target/powerpc/ppc-sdata-2.c: Skip if -mno-readonly-in-sdata.

From-SVN: r258909

7 years agobackport: r6000.c (rtx_is_swappable_p): Add case UNSPEC_VPERMXOR.
Carl Love [Tue, 27 Mar 2018 15:04:27 +0000 (15:04 +0000)] 
backport: r6000.c (rtx_is_swappable_p): Add case UNSPEC_VPERMXOR.

gcc/ChangeLog:

2018-03-27  Carl Love  <cel@us.ibm.com>

Backport from mainline
2018-03-14  Carl Love  <cel@us.ibm.com>

* config/rs6000/r6000.c (rtx_is_swappable_p): Add case UNSPEC_VPERMXOR.

gcc/testsuite/ChangeLog:

2018-03-27  Carl Love  <cel@us.ibm.com>

* gcc.target/powerpc/crypto-builtin-1-runnable.c: New test file.

From-SVN: r258887

7 years ago[ARM][PR82989] Fix unexpected use of NEON instructions for shifts
Sudakshina Das [Tue, 27 Mar 2018 13:40:56 +0000 (13:40 +0000)] 
[ARM][PR82989] Fix unexpected use of NEON instructions for shifts

This is a backport of r258677 and r258723 of trunk.

*** gcc/ChangeLog ***

2018-03-27  Sudakshina Das  <sudi.das@arm.com>

Backport from mainline:
2018-03-20  Sudakshina Das  <sudi.das@arm.com>

PR target/82989
* config/arm/neon.md (ashldi3_neon): Update ?s for constraints
to favor GPR over NEON registers.
(<shift>di3_neon): Likewise.

*** gcc/testsuite/ChangeLog ***

2018-03-27  Sudakshina Das  <sudi.das@arm.com>

Backport from mainline:
2018-03-20  Sudakshina Das  <sudi.das@arm.com>

PR target/82989
* gcc.target/arm/pr82989.c: New test.

Backport from mainline:
2018-03-21  Sudakshina Das  <sudi.das@arm.com>

PR target/82989
* gcc.target/arm/pr82989.c: Change dg scan-assembly directives.

From-SVN: r258884

7 years ago[arm] PR target/82518: Return false in ARRAY_MODE_SUPPORTED_P for BYTES_BIG_ENDIAN
Kyrylo Tkachov [Tue, 27 Mar 2018 13:07:22 +0000 (13:07 +0000)] 
[arm] PR target/82518: Return false in ARRAY_MODE_SUPPORTED_P for BYTES_BIG_ENDIAN

Backport from mainline
2018-03-20  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

PR target/82518
* config/arm/arm.c (arm_array_mode_supported_p): Return false for
BYTES_BIG_ENDIAN.

* lib/target-supports.exp (check_effective_target_vect_load_lanes):
Disable for armeb targets.
* gcc.target/arm/pr82518.c: New test.

From-SVN: r258879

7 years agoDaily bump.
GCC Administrator [Tue, 27 Mar 2018 00:16:05 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r258867

7 years agoDaily bump.
GCC Administrator [Mon, 26 Mar 2018 00:16:05 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r258847

7 years agoDaily bump.
GCC Administrator [Sun, 25 Mar 2018 00:16:05 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r258836

7 years agoDaily bump.
GCC Administrator [Sat, 24 Mar 2018 00:16:09 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r258829

7 years agoPR c++/78489 - Substitution in wrong order
Jason Merrill [Fri, 23 Mar 2018 12:57:09 +0000 (08:57 -0400)] 
PR c++/78489 - Substitution in wrong order

PR c++/84489
* pt.c (type_unification_real): Revert last two changes.

From-SVN: r258802

7 years agoDaily bump.
GCC Administrator [Fri, 23 Mar 2018 00:16:11 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r258787

7 years agobackport "[tail-merge] Don't merge bbs with bb_has_abnormal_pred"
Tom de Vries [Thu, 22 Mar 2018 11:01:15 +0000 (11:01 +0000)] 
backport "[tail-merge] Don't merge bbs with bb_has_abnormal_pred"

2018-03-22  Tom de Vries  <tom@codesourcery.com>

backport from trunk:
2018-03-22  Tom de Vries  <tom@codesourcery.com>

PR tree-optimization/84956
* tree-ssa-tail-merge.c (find_clusters_1): Skip bbs with
bb_has_abnormal_pred.

* gcc.dg/pr84956.c: New test.

From-SVN: r258762

7 years agoUndo commit r258760
Tom de Vries [Thu, 22 Mar 2018 11:01:03 +0000 (11:01 +0000)] 
Undo commit r258760

From-SVN: r258761

7 years agoBackport "Require effective target global_constructor for two testcases"
Tom de Vries [Thu, 22 Mar 2018 10:44:51 +0000 (10:44 +0000)] 
Backport "Require effective target global_constructor for two testcases"

2017-03-27  Tom de Vries  <tom@codesourcery.com>

backport from trunk:
2017-03-24  Tom de Vries  <tom@codesourcery.com>

PR testsuite/80092
* gcc.dg/tls/emutls-2.c:  Add dg-require-effective-target
global_constructor.

From-SVN: r258760

7 years agoDaily bump.
GCC Administrator [Thu, 22 Mar 2018 00:16:06 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r258752

7 years ago2018-03-20 Steven G. Kargl <kargl@gcc.gnu.org>
Steven G. Kargl [Wed, 21 Mar 2018 01:34:01 +0000 (01:34 +0000)] 
2018-03-20  Steven G. Kargl  <kargl@gcc.gnu.org>

ChangeLog entries for r258700.

From-SVN: r258701

7 years agore PR fortran/85001 (ICE in gfc_build_array_type, at fortran/trans-types.c:1420)
Steven G. Kargl [Wed, 21 Mar 2018 01:27:42 +0000 (01:27 +0000)] 
re PR fortran/85001 (ICE in gfc_build_array_type, at fortran/trans-types.c:1420)

2018-03-20  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/85001
* interface.c (symbol_rank): Remove bogus null pointer check that
crept in when translating a ternary operator into an if-else
constructor.

2018-03-20  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/85001
* gfortran.dg/interface_41.f90: New test.

From-SVN: r258700

7 years agoDaily bump.
GCC Administrator [Wed, 21 Mar 2018 00:16:05 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r258695

7 years agoDaily bump.
GCC Administrator [Tue, 20 Mar 2018 00:16:05 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r258668

7 years agore PR fortran/84931 (Expansion of array constructor with constant implied-do-object...
Thomas Koenig [Mon, 19 Mar 2018 22:49:33 +0000 (22:49 +0000)] 
re PR fortran/84931 (Expansion of array constructor with constant implied-do-object goes sideways)

2018-03-19  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/84931
Backport from trunk
* simplify.c (gfc_convert_constant): Correctly handle iterators
for type conversion.

2018-03-19  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/84931
Backport from trunk
* gfortran.dg/array_constructor_52.f90: New test.

From-SVN: r258667

7 years agore PR fortran/65453 (ICE in build_function_decl, at fortran/trans-decl.c:2001)
Steven G. Kargl [Mon, 19 Mar 2018 19:14:06 +0000 (19:14 +0000)] 
re PR fortran/65453 (ICE in build_function_decl, at fortran/trans-decl.c:2001)

2018-03-19  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/65453
* decl.c (get_proc_name): Catch clash between a procedure statement
and a contained subprogram

2018-03-19  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/65453
* gfortran.dg/pr65453.f90: New test.

From-SVN: r258657

7 years agoDaily bump.
GCC Administrator [Mon, 19 Mar 2018 00:16:11 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r258638

7 years agobackport: pa.c (pa_callee_copies): New function.
John David Anglin [Sun, 18 Mar 2018 22:13:04 +0000 (22:13 +0000)] 
backport: pa.c (pa_callee_copies): New function.

Backport from mainline
2016-12-11  John David Anglin  <danglin@gcc.gnu.org>

* config/pa/pa.c (pa_callee_copies): New function.
* config/pa/pa.opt (mcaller-copies): New option.
* doc/invoke.texi (mcaller-copies): Document option.

From-SVN: r258635

7 years agoDaily bump.
GCC Administrator [Sun, 18 Mar 2018 00:16:05 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r258624

7 years agoDaily bump.
GCC Administrator [Sat, 17 Mar 2018 00:16:04 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r258615

7 years agoDaily bump.
GCC Administrator [Fri, 16 Mar 2018 00:16:04 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r258577

7 years agoDaily bump.
GCC Administrator [Thu, 15 Mar 2018 00:16:05 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r258544

7 years agore PR target/83451 (FAIL: gfortran.dg/matmul_10.f90 -O3 -fomit-frame-pointer -funro...
John David Anglin [Wed, 14 Mar 2018 23:55:02 +0000 (23:55 +0000)] 
re PR target/83451 (FAIL: gfortran.dg/matmul_10.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (ICE))

PR target/83451
* config/pa/pa.c (pa_emit_move_sequence):  Always emit secondary reload
insn for floating-point loads and stores.

From-SVN: r258543

7 years agoDaily bump.
GCC Administrator [Wed, 14 Mar 2018 00:16:18 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r258506

7 years agoDaily bump.
GCC Administrator [Tue, 13 Mar 2018 00:16:16 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r258472

7 years agoFix spelling of -mclflushopt in manual
Jonathan Wakely [Mon, 12 Mar 2018 22:35:12 +0000 (22:35 +0000)] 
Fix spelling of -mclflushopt in manual

* doc/invoke.texi (-mclflushopt): Fix spelling of option.

From-SVN: r258465

7 years agore PR fortran/83939 (Constraint C1290 (elemental function cannot be allocatable)...
Steven G. Kargl [Mon, 12 Mar 2018 18:26:28 +0000 (18:26 +0000)] 
re PR fortran/83939 (Constraint C1290 (elemental function cannot be allocatable) not enforced)

2018-03-12  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/83939
* resolve.c (resolve_fl_procedure): Enforce F2018:C15100.

2018-03-12  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/83939
* gfortran.dg/pr83939.f90

From-SVN: r258457

7 years agoDaily bump.
GCC Administrator [Mon, 12 Mar 2018 00:16:06 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r258439

7 years agobackport: re PR target/83984 (ld: The value 0x8000000000005 does not fit when applyin...
John David Anglin [Sun, 11 Mar 2018 14:44:48 +0000 (14:44 +0000)] 
backport: re PR target/83984 (ld: The value 0x8000000000005 does not fit when applying the relocation DIR21L)

Backport from mainline
2018-02-14  John David Anglin  <danglin@gcc.gnu.org>

PR target/83984
* config/pa/pa.md: Load address of PIC label using the linkage table
if the label is nonlocal.

From-SVN: r258433

7 years agobackport: fptr.c (_dl_read_access_allowed): New.
John David Anglin [Sun, 11 Mar 2018 14:38:50 +0000 (14:38 +0000)] 
backport: fptr.c (_dl_read_access_allowed): New.

Backport from mainline
2018-03-06  John David Anglin  <danglin@gcc.gnu.org>

* config/pa/fptr.c (_dl_read_access_allowed): New.
(__canonicalize_funcptr_for_compare): Use it.

From-SVN: r258431

7 years agobackport: pa.h (ASM_GENERATE_INTERNAL_LABEL): Revise to use sprint_ul.
John David Anglin [Sun, 11 Mar 2018 14:33:56 +0000 (14:33 +0000)] 
backport: pa.h (ASM_GENERATE_INTERNAL_LABEL): Revise to use sprint_ul.

Backport from mainline
2018-03-06  John David Anglin  <danglin@gcc.gnu.org>

* config/pa/pa.h (ASM_GENERATE_INTERNAL_LABEL): Revise to use
sprint_ul.
(ASM_OUTPUT_ADDR_VEC_ELT): Revise for above change.
(ASM_OUTPUT_ADDR_DIFF_ELT): Likewise.
* config/pa/pa64-hpux.h (ASM_GENERATE_INTERNAL_LABEL): Revise as above.

From-SVN: r258429

7 years agoDaily bump.
GCC Administrator [Sun, 11 Mar 2018 00:16:05 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r258421

7 years agore PR fortran/84734 (Compiling codes with insane array dimensions gives an ICE after...
Steven G. Kargl [Sat, 10 Mar 2018 19:00:49 +0000 (19:00 +0000)] 
re PR fortran/84734 (Compiling codes with insane array dimensions gives an ICE after r257971)

2018-03-10  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/84734
* arith.c (check_result, eval_intrinsic):  If result overflows, pass
the expression up the chain instead of a NULL pointer.

2018-03-10  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/84734
* gfortran.dg/pr84734.f90: New test.

From-SVN: r258419

7 years agobackport: re PR other/82352 (comdat-local function called by void h::i() outside...
H.J. Lu [Sat, 10 Mar 2018 18:45:55 +0000 (18:45 +0000)] 
backport: re PR other/82352 (comdat-local function called by void h::i() outside its comdat)

Backport r256266 from mainline

Backport from mainline
2018-01-04  Jakub Jelinek  <jakub@redhat.com>

PR ipa/82352
* g++.dg/ipa/pr82352.C (size_t): Define to __SIZE_TYPE__ instead of
long unsigned int.

From-SVN: r258418

7 years agoPR c++/84785 - ICE with alias template and default targs.
Jason Merrill [Sat, 10 Mar 2018 03:35:25 +0000 (22:35 -0500)] 
PR c++/84785 - ICE with alias template and default targs.

* pt.c (type_unification_real): Set processing_template_decl if
saw_undeduced == 1.

From-SVN: r258410

7 years agoDaily bump.
GCC Administrator [Sat, 10 Mar 2018 00:16:05 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r258403

7 years agoDaily bump.
GCC Administrator [Fri, 9 Mar 2018 00:16:05 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r258372

7 years ago[multiple changes]
Steven G. Kargl [Thu, 8 Mar 2018 19:06:57 +0000 (19:06 +0000)] 
[multiple changes]

2018-03-08 Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/64124
PR fortran/70409
* decl.c (gfc_match_char_spec): Try to reduce a charlen to a constant.

2018-03-08  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/64124
PR fortran/70409
* gfortran.dg/pr64124.f90: New tests.
* gfortran.dg/pr70409.f90: New tests.

From-SVN: r258368

7 years agoBackport r243662
Martin Liska [Thu, 8 Mar 2018 08:56:45 +0000 (09:56 +0100)] 
Backport r243662

2018-03-08  Martin Liska  <mliska@suse.cz>

Backport from mainline
2016-12-14  Jakub Jelinek  <jakub@redhat.com>

PR debug/77844
* valtrack.c: Include rtl-iter.h.
(struct rtx_subst_pair): Add insn field.
(propagate_for_debug_subst): If pair->to contains at least 2
regs, create a DEBUG_INSN with a debug temp before pair->insn
and replace from with the debug temp instead of pair->to.
(propagate_for_debug): Initialize p.insn.
* combine.c (insn_uid_check): New inline function.
(INSN_COST, LOG_LINKS): Use it instead of INSN_UID.
(find_single_use, combine_instructions,
cant_combine_insn_p, try_combine): Use NONDEBUG_INSN_P instead of
INSN_P.
2018-03-08  Martin Liska  <mliska@suse.cz>

Backport from mainline
2016-12-14  Jakub Jelinek  <jakub@redhat.com>

PR debug/77844
* g++.dg/opt/pr77844.C: New test.

From-SVN: r258359

7 years agoBackport r256226
Martin Liska [Thu, 8 Mar 2018 08:56:20 +0000 (09:56 +0100)] 
Backport r256226

2018-03-08  Martin Liska  <mliska@suse.cz>

Backport from mainline
2018-01-04  Martin Liska  <mliska@suse.cz>

PR ipa/82352
* ipa-icf.c (sem_function::merge): Do not cross comdat boundary.
2018-03-08  Martin Liska  <mliska@suse.cz>

Backport from mainline
2018-01-04  Martin Liska  <mliska@suse.cz>

PR ipa/82352
* g++.dg/ipa/pr82352.C: New test.

From-SVN: r258358

7 years agoBackport r254257
Martin Liska [Thu, 8 Mar 2018 08:55:59 +0000 (09:55 +0100)] 
Backport r254257

2018-03-08  Martin Liska  <mliska@suse.cz>

Backport from mainline
2017-10-31  Martin Liska  <mliska@suse.cz>

PR gcov-profile/82633
* doc/gcov.texi: Document -fkeep-{static,inline}-functions and
their interaction with GCOV infrastructure.
* configure.ac: Add -fkeep-{inline,static}-functions to
coverage_flags.
* configure: Regenerate.

From-SVN: r258357

7 years agoBackport r254137
Martin Liska [Thu, 8 Mar 2018 08:52:39 +0000 (09:52 +0100)] 
Backport r254137

2018-03-08  Martin Liska  <mliska@suse.cz>

Backport from mainline
2017-10-27  Martin Liska  <mliska@suse.cz>

PR gcov-profile/82457
* doc/invoke.texi: Document that one needs a non-strict ISO mode
for fork-like functions to be properly instrumented.

From-SVN: r258356

7 years agoDaily bump.
GCC Administrator [Thu, 8 Mar 2018 00:16:05 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r258343

7 years agoS/390: Disable branch prediction
Andreas Krebbel [Wed, 7 Mar 2018 13:10:35 +0000 (13:10 +0000)] 
S/390: Disable branch prediction

gcc/ChangeLog:

2018-03-07  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

Backport from mainline
2018-02-08  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

* config/s390/s390-opts.h (enum indirect_branch): Define.
* config/s390/s390-protos.h (s390_return_addr_from_memory)
(s390_indirect_branch_via_thunk)
(s390_indirect_branch_via_inline_thunk): Add function prototypes.
(enum s390_indirect_branch_type): Define.
* config/s390/s390.c (struct s390_frame_layout, struct
machine_function): Remove.
(indirect_branch_prez10thunk_mask, indirect_branch_z10thunk_mask)
(indirect_branch_table_label_no, indirect_branch_table_name):
Define variables.
(INDIRECT_BRANCH_NUM_OPTIONS): Define macro.
(enum s390_indirect_branch_option): Define.
(s390_return_addr_from_memory): New function.
(s390_handle_string_attribute): New function.
(s390_attribute_table): Add new attribute handler.
(s390_execute_label): Handle UNSPEC_EXECUTE_JUMP patterns.
(s390_indirect_branch_via_thunk): New function.
(s390_indirect_branch_via_inline_thunk): New function.
(s390_function_ok_for_sibcall): When jumping via thunk disallow
sibling call optimization for non z10 compiles.
(s390_emit_call): Force indirect branch target to be a single
register.  Add r1 clobber for non-z10 compiles.
(s390_emit_epilogue): Emit return jump via return_use expander.
(s390_reorg): Handle JUMP_INSNs as execute targets.
(s390_option_override_internal): Perform validity checks for the
new command line options.
(s390_indirect_branch_attrvalue): New function.
(s390_indirect_branch_settings): New function.
(s390_set_current_function): Invoke s390_indirect_branch_settings.
(s390_output_indirect_thunk_function):  New function.
(s390_code_end): Implement target hook.
(s390_case_values_threshold): Implement target hook.
(TARGET_ASM_CODE_END, TARGET_CASE_VALUES_THRESHOLD): Define target
macros.
* config/s390/s390.h (struct s390_frame_layout)
(struct machine_function): Move here from s390.c.
(TARGET_INDIRECT_BRANCH_NOBP_RET)
(TARGET_INDIRECT_BRANCH_NOBP_JUMP)
(TARGET_INDIRECT_BRANCH_NOBP_JUMP_THUNK)
(TARGET_INDIRECT_BRANCH_NOBP_JUMP_INLINE_THUNK)
(TARGET_INDIRECT_BRANCH_NOBP_CALL)
(TARGET_DEFAULT_INDIRECT_BRANCH_TABLE)
(TARGET_INDIRECT_BRANCH_THUNK_NAME_EXRL)
(TARGET_INDIRECT_BRANCH_THUNK_NAME_EX)
(TARGET_INDIRECT_BRANCH_TABLE): Define macros.
* config/s390/s390.md (UNSPEC_EXECUTE_JUMP)
(INDIRECT_BRANCH_THUNK_REGNUM): Define constants.
(mnemonic attribute): Add values which aren't recognized
automatically.
("*cjump_long", "*icjump_long", "*basr", "*basr_r"): Disable
pattern for branch conversion.  Fix mnemonic attribute.
("*c<code>", "*sibcall_br", "*sibcall_value_br", "*return"): Emit
indirect branch via thunk if requested.
("indirect_jump", "<code>"): Expand patterns for branch conversion.
("*indirect_jump"): Disable for branch conversion using out of
line thunks.
("indirect_jump_via_thunk<mode>_z10")
("indirect_jump_via_thunk<mode>")

2018-03-07  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

Backport from mainline
2018-02-09  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

PR target/PR84295
* config/s390/s390.c (s390_set_current_function): Invoke
s390_indirect_branch_settings also if fndecl didn't change.

gcc/testsuite/ChangeLog:

2018-03-07  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

Backport from mainline
2018-02-08  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

* gcc.target/s390/nobp-function-pointer-attr.c: New test.
* gcc.target/s390/nobp-function-pointer-nothunk.c: New test.
* gcc.target/s390/nobp-function-pointer-z10.c: New test.
* gcc.target/s390/nobp-function-pointer-z900.c: New test.
* gcc.target/s390/nobp-indirect-jump-attr.c: New test.
* gcc.target/s390/nobp-indirect-jump-inline-attr.c: New test.
* gcc.target/s390/nobp-indirect-jump-inline-z10.c: New test.
* gcc.target/s390/nobp-indirect-jump-inline-z900.c: New test.
* gcc.target/s390/nobp-indirect-jump-nothunk.c: New test.
* gcc.target/s390/nobp-indirect-jump-z10.c: New test.
* gcc.target/s390/nobp-indirect-jump-z900.c: New test.
* gcc.target/s390/nobp-return-attr-all.c: New test.
* gcc.target/s390/nobp-return-attr-neg.c: New test.
* gcc.target/s390/nobp-return-mem-attr.c: New test.
* gcc.target/s390/nobp-return-mem-nothunk.c: New test.
* gcc.target/s390/nobp-return-mem-z10.c: New test.
* gcc.target/s390/nobp-return-mem-z900.c: New test.
* gcc.target/s390/nobp-return-reg-attr.c: New test.
* gcc.target/s390/nobp-return-reg-mixed.c: New test.
* gcc.target/s390/nobp-return-reg-nothunk.c: New test.
* gcc.target/s390/nobp-return-reg-z10.c: New test.
* gcc.target/s390/nobp-return-reg-z900.c: New test.
* gcc.target/s390/nobp-table-jump-inline-z10.c: New test.
* gcc.target/s390/nobp-table-jump-inline-z900.c: New test.
* gcc.target/s390/nobp-table-jump-z10.c: New test.
* gcc.target/s390/nobp-table-jump-z900.c: New test.

2018-03-07  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

Backport from mainline
2018-02-09  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

PR target/PR84295
* gcc.target/s390/pr84295.c: New test.

From-SVN: r258335

7 years agoBackport r257842
Martin Liska [Wed, 7 Mar 2018 09:49:47 +0000 (10:49 +0100)] 
Backport r257842

2018-03-07  Martin Liska  <mliska@suse.cz>

Backport from mainline
2018-02-20  Martin Liska  <mliska@suse.cz>

PR c/84310
PR target/79747
* final.c (shorten_branches): Build align_tab array with one
more element.
* opts.c (finish_options): Add alignment option limit check.
(MAX_CODE_ALIGN): Likewise.
(MAX_CODE_ALIGN_VALUE): Likewise.
* doc/invoke.texi: Document maximum allowed option value for
all -falign-* options.
2018-03-07  Martin Liska  <mliska@suse.cz>

Backport from mainline
2018-02-20  Martin Liska  <mliska@suse.cz>

PR c/84310
PR target/79747
* gcc.target/i386/pr84310.c: New test.
* gcc.target/i386/pr84310-2.c: Likewise.

From-SVN: r258332