Re: [PATCH][compare-elim] Merge zero-comparisons with normal ops

2017-10-14 Thread Eric Botcazou
> This looks good. OK for the trunk. FWIW I disagree. The patch completely shuns the existing implementation of the pass, which is based on a forward scan within basic blocks to identify the various interesting instructions and record them, and uses full-blown def-use and use-def chains inste

[committed] Fix pr81423.c testcase (PR rtl-optimization/81423)

2017-10-14 Thread Jakub Jelinek
Hi! The original C++ testcase has been transcribed into C and during that process a UB has been introduced, original had unsigned(5677365550390624949LL - ll) - (ull1 > 0) while what has been committed has (5677365550390624949L - ll) - (ull1 > 0) I've also changed all L suffixed constants to LL for

[PATCH, i386]: Fix gcc.target/i386/pr71245-?.c scan asm failures

2017-10-14 Thread Uros Bizjak
Hello! Now that prerequisite middle-end patch is committed, we can match atomic FILD/FIST and LDX/STX sequences with a peephole2 pattern that also include (known) memory blockage instruction. 2017-10-14 Uros Bizjak * config/i386/sync.md (FILD_ATOMIC/FIST_ATOMIC FP load peephole2): Use

Re: [PATCH v2, middle-end]: Introduce memory_blockage named insn pattern

2017-10-14 Thread Andrew Pinski
On Mon, Sep 18, 2017 at 2:06 PM, Uros Bizjak wrote: > On Tue, Sep 5, 2017 at 3:50 PM, Uros Bizjak wrote: >> Revised patch, incorporates fixes from Alexander's review comments. >> >> I removed some implementation details from Alexander's description of >> memory_blockage named pattern. >> >> >> 20

Re: [PATCH v2, middle-end]: Introduce memory_blockage named insn pattern

2017-10-14 Thread Christophe Lyon
On 14 October 2017 at 12:16, Andrew Pinski wrote: > On Mon, Sep 18, 2017 at 2:06 PM, Uros Bizjak wrote: >> On Tue, Sep 5, 2017 at 3:50 PM, Uros Bizjak wrote: >>> Revised patch, incorporates fixes from Alexander's review comments. >>> >>> I removed some implementation details from Alexander's des

Re: [PATCH v2, middle-end]: Introduce memory_blockage named insn pattern

2017-10-14 Thread Uros Bizjak
On Sat, Oct 14, 2017 at 12:16 PM, Andrew Pinski wrote: > On Mon, Sep 18, 2017 at 2:06 PM, Uros Bizjak wrote: >> On Tue, Sep 5, 2017 at 3:50 PM, Uros Bizjak wrote: >>> Revised patch, incorporates fixes from Alexander's review comments. >>> >>> I removed some implementation details from Alexander'

Re: Zen tuning part 6: Break up CPU specific tuning bits to central place

2017-10-14 Thread Jakub Jelinek
On Tue, Oct 10, 2017 at 11:41:20PM +0200, Jan Hubicka wrote: > it is common mistake to forget updating CPU spefic bits in i386.c while doing > new CPU tuning. It is understandble given how large i386.c is and how well > those are hidden. This patch moves majority of CPU specific bits into > x86-t

Re: [PATCH v2, middle-end]: Introduce memory_blockage named insn pattern

2017-10-14 Thread David Edelsohn
This patch has broken bootstrap on AIX and possibly powerpc64-linux. Was this patch tested on any architecture other than x86? /nasfarm/edelsohn/src/src/libgcc/emutls.c: In function '__emutls_get_address': /nasfarm/edelsohn/src/src/libgcc/emutls.c:139:11: internal compiler error: in invalid_void,

Re: [PATCH v2, middle-end]: Introduce memory_blockage named insn pattern

2017-10-14 Thread David Edelsohn
On Sat, Oct 14, 2017 at 11:44 AM, David Edelsohn wrote: > This patch has broken bootstrap on AIX and possibly powerpc64-linux. > Was this patch tested on any architecture other than x86? > > /nasfarm/edelsohn/src/src/libgcc/emutls.c: In function '__emutls_get_address': > /nasfarm/edelsohn/src/src/

[Ada] Missing warning about replacement of warnings off for unreferenced

2017-10-14 Thread Pierre-Marie de Rodat
This patch corrects an issue introduced by Q220-025 where the use of pragma warnings off applied to an unreferenced variable is not warned about the possibility of replacing with the more specific pragma unreferenced when using the -gnatw.w. -- Source -- -- p.adb proce

[Ada] Proper resolution of Initializes and Initial_Condition

2017-10-14 Thread Pierre-Marie de Rodat
This patch modifies the processing of SPARK annotations Initializes and Initial_Condition to perform the resolution of the related expressions at the end of the enclosing package visible declarations. -- Source -- -- init_cond.ads package Init_Cond with SPARK_Mode,

[Ada] Remove obsolete comment for Generic_Parent

2017-10-14 Thread Pierre-Marie de Rodat
Routine [Set_]Generic_Parent can only be called on package, function and procedure specification nodes, as asserted in their bodies. It would crash when called for renaming or object declarations; the comment was most likely referring to some earlier implemenation idea. Tested on x86_64-pc-linux-g

Re: [PATCH][GRAPHITE] Consistently use region analysis

2017-10-14 Thread Sebastian Pop
On Fri, Oct 13, 2017 at 8:02 AM, Richard Biener wrote: > > Now that SCEV instantiation handles regions properly (see hunk below > for a minor fix) we can use it consistently from GRAPHITE and thus > simplify scalar_evolution_in_region greatly. > > Bootstrap and regtest running on x86_64-unknown-l

[Ada] Variable assignments and reads in SPARK elaboration code

2017-10-14 Thread Pierre-Marie de Rodat
This patch reimplements the treatment of variable assignments and reads within SPARK elaboration code. The changes are as follows: 1) Diagnostics of variable assignments in elaboration code are now based on the rules in effect (either Ada or SPARK). 2) Variable assignments in Ada elaboration c

[Ada] Spurious ineffective use_type_clause warning on private type

2017-10-14 Thread Pierre-Marie de Rodat
This patch corrects an issue whereby a defaulted formal subprogram was not being accounted for when checking for ineffective use_type_clauses on private types used as generic actuals. -- Source -- -- types.ads package Types is type Enum_1 is private; private type

[Ada] Missing validity check on record type component

2017-10-14 Thread Pierre-Marie de Rodat
The compiler may silently skip generating a validity check on a type conversion of a component of a record type. After this patch the error is reported on the following sources. pragma Initialize_Scalars; package Pkg is type T is record Major : Natural; Minor : Natural; end recor

[Ada] Fix performance regression of Ada.Numerics on 32-bit Windows

2017-10-14 Thread Pierre-Marie de Rodat
This fixes a run-time performance regression recently introduced on 32-bit Windows for Ada.Numerics by an unrelated change that exposed an old defect of the compiler on 32-bit Windows, namely that the Long_Long_Float type has got a wrong alignment of 8 instead of the expected 4. The following pack

[Ada] Premature evaluation of message string in Assert pragma

2017-10-14 Thread Pierre-Marie de Rodat
RM 11.4.2 stipulates that the optional string argument in an Assert pragma is evaluated only if the assertion fails and the string is incorporated into the raise statement. Previous to this patch the string expression was evaluated unconditionally, leading to unwanted side effects if its evaluation

[Ada] Repair ABI breakage on 32-bit x86/Linux

2017-10-14 Thread Pierre-Marie de Rodat
This repairs the ABI breakage for record types with Long_Float components introduced on 32-bit x86/Linux by the previous change. The Long_Float type is awkward on this platform because it has got a dual alignment setting: it's 8 for standalone object and array component and 4 for record component.

[Ada] Activation/suppression of SPARK elaboration rules

2017-10-14 Thread Pierre-Marie de Rodat
This patch utilizes compilation switch -gnatd.v to enforce the SPARK rules for elaboration in SPARK code. The affected scenarios are calls and instantiations. If the switch is active, the ABE mechanism will verify that the scenarios have fulfilled their Elaborate[_All] requirements. Otherwise the s

[Ada] Calls in preelaborated units and pragma Remote_Call_Interface

2017-10-14 Thread Pierre-Marie de Rodat
This patch modifies the check which ensures that no call is executed in a preelaborated unit. The check now properly ignores a case where a generic unit is subject to pragma Remote_Call_Interface, and the call appears in the body. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ 2017-1

Re: [PATCH v2, middle-end]: Introduce memory_blockage named insn pattern

2017-10-14 Thread Uros Bizjak
On Sat, Oct 14, 2017 at 5:44 PM, David Edelsohn wrote: > This patch has broken bootstrap on AIX and possibly powerpc64-linux. > Was this patch tested on any architecture other than x86? No. > /nasfarm/edelsohn/src/src/libgcc/emutls.c: In function '__emutls_get_address': > /nasfarm/edelsohn/src/s

Re: [PATCH v2, middle-end]: Introduce memory_blockage named insn pattern

2017-10-14 Thread David Edelsohn
On Sat, Oct 14, 2017 at 1:29 PM, Uros Bizjak wrote: > On Sat, Oct 14, 2017 at 5:44 PM, David Edelsohn wrote: >> This patch has broken bootstrap on AIX and possibly powerpc64-linux. >> Was this patch tested on any architecture other than x86? > > No. > >> /nasfarm/edelsohn/src/src/libgcc/emutls.c:

Re: [PATCH] Improve simplify_rotate (PR middle-end/62263, PR middle-end/82498)

2017-10-14 Thread Richard Biener
On October 13, 2017 9:36:48 PM GMT+02:00, Jakub Jelinek wrote: >Hi! > >The forwprop rotate pattern recognizer is able to detect various >patterns, but for the case where we want to support all rotate >counts without UB, it requires >Y &= B - 1; >R = (X << Y) | (X >> ((-Y) & (B - 1))); >where >R =

Re: [PATCH] Slightly improve phiopt value_replacement optimization (PR middle-end/62263, PR middle-end/82498)

2017-10-14 Thread Richard Biener
On October 13, 2017 9:43:10 PM GMT+02:00, Jakub Jelinek wrote: >Hi! > >First of all, there was a typo, we are optimizing >(x != 0) ? x + y : y >into x + y rather than y. > >And, as the comment mentions, the condition that there is just a single >stmt is too restrictive and in the various patterns