[RFA/RFC] Stack clash mitigation patch 07/08 - V3

2017-07-30 Thread Jeff Law
This patch adds aarch64 supports for stack clash mitigation. Changes since V2: Uses new PARAMS to control the guard size and probing interval. Uses a 64k guard by default and a 1k outgoing args size. Simplified code slightly as a result of "can't happen" cases. Probe the last allocated word

[PATCH][RFA/RFC] Stack clash mitigation patch 06/08 - V3

2017-07-30 Thread Jeff Law
This contains the PPC bits for stack clash protection. Changes since V2: Exploits inlined/unrolled probes and rotated loops for the dynamic area. Some trivial simplifications. It also uses the new params to control if probes are needed and how often to probe. Jeff *

[PATCH][RFA/RFC] Stack clash mitigation patch 08/08 - V3

2017-07-30 Thread Jeff Law
These are the s390 patches for stack clash mitigation. Changes since V2: Incorporate changes from IBM to address missing functionality. Hopefully no longer regresses Ada as we no longer define STACK_CHECK_STATIC_BUILTIN. Jeff * config/s390/s390.c (MIN_UNROLL_PROBES): Define.

[PATCH][RFA/RFC] Stack clash mitigation patch 05/08 - V3

2017-07-30 Thread Jeff Law
This patch catches a couple places where the generic parts of the compiler would transform prologue probing sequences in unsafe ways. Changes since V2: Testing for aarch64 showed the scheduler would perform transformations similar to combine-stack-adjustments via its dependency breaking

[PATCH][RFA/RFC] Stack clash mitigation patch 04/08 - V3

2017-07-30 Thread Jeff Law
This patch adds stack clash protection to the x86 port and provides the first set of tests that will be used by the other ports in the future. Changes since V2: This uses the new PARAMs to determine if probing is needed and how often to probe once probing is needed. New tests were added to

[PATCH][RFA/RFC] Stack clash mitigation patch 03/08 - V3

2017-07-30 Thread Jeff Law
This patch introduces some routines for logging of stack clash protection actions. I don't think this patch changed at all relative to V2. Jeff * function.c (dump_stack_clash_frame_info): New function. * function.h (dump_stack_clash_frame_info): Prototype. (enum

[PATCH][RFA/RFC] Stack clash mitigatoin patch 02b/08 - V3

2017-07-30 Thread Jeff Law
This patch adds checking of flag_stack_protection to various backends that will rely on partial protection against stack-clash via -fstack-check. I don't think this patch changed at all relative to V2. Jeff * config/alpha/alpha.c (alpha_expand_prologue): Also check

[PATCH][RFA/RFC] Stack clash mitigation patch 02/08 - V3

2017-07-30 Thread Jeff Law
This patch introduces generic mechanisms to protect the dynamically allocated stack space against stack-clash attacks. Changes since V2: Dynamic allocations can be emitted as unrolled inlined probes or with a rotated loop. Blockage insns are also properly emitted for the dynamic area probes

[PATCH][RFA/RFC] Stack clash mitigation patch 01/08 - V3

2017-07-30 Thread Jeff Law
This patch introduces the stack clash protection options Changes since V2: Adds two new params. The first controls the size of the guard area. This controls the threshold for when a function prologue requires probes. The second controls the probing interval -- ie, once probes are needed, how

[PATCH][RFA/RFC] Stack clash mitigation patch 00/08 - V3

2017-07-30 Thread Jeff Law
OK, so about a week later than I wanted. Too many fires, not enough water. The V3 patch has expanded a bit... 1. For constant sized dynamic allocations we'll allocate/probe up to 4 STACK_CLASH_PROTECTION_PROBE_INTERVAL regions inline and unrolled. 2. For larger constant sized

Re: [ patch, libfortran] Fix PR 81581

2017-07-30 Thread Jerry DeLisle
On 07/30/2017 11:55 AM, Thomas Koenig wrote: > Hello world, > > the attached patch performs a runtime-check for the dim arguments > for transformational intrinsic functions. > > I debated with myself a bit if I should make this depend on > bounds checking, but I finally decided against it. The

[PATCH, i386]: Implement attribute ((naked))

2017-07-30 Thread Uros Bizjak
Hello! attribute ((naked)) generates function body without function frame, and as shown in PR 25967 [1], users are looking for this feature also for x86 targets. Recently, Daniel introduced a testcase that would benefit from this attribute. Attached patch also adds a trap instruction (ud2) at

[PATCH] Fix PR81354 (rewrite gimple_split_edge)

2017-07-30 Thread Bill Schmidt
Hi, PR81354 identifies a latent bug that can happen in SLSR since the conditional candidate support was first added. SLSR relies on the address of a GIMPLE PHI remaining constant during the course of the optimization pass, but it needs to split edges. The use of make_single_succ_edge and

Re: [PATCH], PR target/81593, Optimize PowerPC vector sets coming from a vector extracts

2017-07-30 Thread Bill Schmidt
> On Jul 28, 2017, at 4:08 PM, Segher Boessenkool > wrote: > > Hi! > > On Thu, Jul 27, 2017 at 07:21:14PM -0400, Michael Meissner wrote: >> This patches optimizes the PowerPC vector set operation for 64-bit doubles >> and >> longs where the elements in the vector

Re: [PATCH] PR libstdc++/79162 ambiguity in string assignment due to string_view overload (LWG 2946)

2017-07-30 Thread Daniel Krügler
2017-07-28 22:40 GMT+02:00 Daniel Krügler : > 2017-07-28 22:29 GMT+02:00 Daniel Krügler : >> 2017-07-28 22:25 GMT+02:00 Tim Song : >>> On Fri, Jul 28, 2017 at 4:10 PM, Daniel Krügler >>>

Re: [PATCH 1/2, c-family]: Add 'z' to asm_fprintf_char_table

2017-07-30 Thread Uros Bizjak
On Wed, Jul 26, 2017 at 2:18 PM, Uros Bizjak wrote: > Hello! > > This patch is the prerequisite for my next patch. It enables %z > extension for asm_fprintf that will emit 'q' or 'l' suffixes for > instructions with word-sized operands. > > 2017-07-26 Uros Bizjak

Re: [PATCH] i386: Update INCOMING_FRAME_SP_OFFSET for exception handler

2017-07-30 Thread Uros Bizjak
On Sat, Jul 29, 2017 at 4:22 PM, H.J. Lu wrote: > Since there is an extra error code passed to the exception handler, > INCOMING_FRAME_SP_OFFSET is return address plus error code for the > exception handler. This patch updates INCOMING_FRAME_SP_OFFSET to > the correct value

Re: [PATCH] i386: Rewrite check for AVX512 features

2017-07-30 Thread Uros Bizjak
On Sat, Jul 29, 2017 at 3:06 PM, H.J. Lu wrote: > Add a new file, avx512-check.h, to check all AVX512 features. The test > is skipped if any requested AVX512 features are unavailable. > > Tested on Skylake server and Haswell. OK for trunk? No, I'd rather leave it in in the

[PATCHv5][PR 57371] Remove useless floating point casts in comparisons

2017-07-30 Thread Yury Gribov
Hi all, This is an updated version of patch in https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00924.html . It prevents optimization in presense of sNaNs (and qNaNs when comparison operator is > >= < <=) to preserve FP exceptions. I've fixed some stylistic issues mentioned in previous review.