Re: [PR 78687] Set SRA grp_write lazily

2017-04-27 Thread Richard Biener
On Thu, 27 Apr 2017, Martin Jambor wrote: > Hi, > > PR 78687 is a reported SRA missed-optimization issue. The problem, in > its simplest form, happens when we have two big local non-addressable > structures, we initialize only small portions of the first one and > then assign all of it it to th

Re: [PATCH 05/12 rev 1] [i386] Add option -mcall-ms2sysv-xlogues

2017-04-27 Thread Daniel Santos
Oops. I blame my fingers. :) Daniel --- gcc/config/i386/i386.c | 6 +- gcc/config/i386/i386.opt | 4 gcc/doc/invoke.texi | 13 - 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 113f83742c2..52111

Re: [PATCH] Fix AIX bootstrap comparison due to empty *-tests.c and selftest* files (PR bootstrap/80531)

2017-04-27 Thread Richard Biener
On April 27, 2017 10:20:57 PM GMT+02:00, Jakub Jelinek wrote: >Hi! > >This is something that fails bootstrap newly in GCC 7 and only with >(now on the branch default --enable-checking=release (or >--disable-checking)). The problem is that the *-tests.c and >selftest*.c >sources after including so

Re: [PATCH][RFC] Enable -fstrict-overflow by default

2017-04-27 Thread Martin Sebor
On 04/27/2017 03:16 AM, Richard Biener wrote: On Wed, 26 Apr 2017, Martin Sebor wrote: On 04/26/2017 01:59 AM, Richard Biener wrote: On Tue, 25 Apr 2017, Martin Sebor wrote: On 04/24/2017 05:25 AM, Richard Biener wrote: The following makes signed overflow undefined for all (non-)optimizati

Re: [PATCH] handle sprintf(d, "%s", ...) in gimple-ssa-sprintf.c

2017-04-27 Thread Martin Sebor
On 04/25/2017 09:55 PM, Martin Sebor wrote: On 04/25/2017 04:05 PM, Jeff Law wrote: On 04/21/2017 03:33 PM, Martin Sebor wrote: Bug 77671 - missing -Wformat-overflow warning on sprintf overflow with "%s", is caused by gimple-fold.c transforming s{,n}printf calls with a plain "%s" format string

Re: [PATCH 05/12] [i386] Add option -mcall-ms2sysv-xlogues

2017-04-27 Thread Sandra Loosemore
On 04/27/2017 02:09 AM, Daniel Santos wrote: @@ -25308,6 +25308,17 @@ You can control this behavior for specific functions by using the function attributes @code{ms_abi} and @code{sysv_abi}. @xref{Function Attributes}. +@item -mcall-ms2sysv-xlogues +@opindex mcall-ms2sysv-xlogues +@opindex

Re: [PATCH] Implement a warning for bogus sizeof(pointer) / sizeof(pointer[0])

2017-04-27 Thread Martin Sebor
I suggest avoiding "element size" because the pointed-to argument need not be an array. Mentioning the types should help users better understand the problem (especially in C++ where types are often obscured by layers of templates). It might also be a nice touch to add a note pointing to the decl

Re: [testsuite] Add missing dg-require-effective-target alloca to gcc testsuite

2017-04-27 Thread Tom de Vries
On 04/26/2017 01:57 PM, Jakub Jelinek wrote: I guess those should be decided case by case whether we want relative, absolute or saved line numbers. If the diagnostic is within the same function or code block as the stuff it is relative to, relative is fine, but if e.g. the messages are just at t

[gomp4] Fix an ICE involving OpenACC routines inside broken fortran functions.

2017-04-27 Thread Cesar Philippidis
I encountered an ICE when the fortran FE tries to parse an OpenACC routine directive when the containing function has a syntax error. E.g. integer function f1 is missing an argument list, so the fortran FE will not create a function symbol for f1. Consequently, the OpenACC routine parser cannot

Re: [PATCH] have -Wformat-overflow handle -fexec-charset (PR 80503)

2017-04-27 Thread Martin Sebor
On 04/26/2017 04:34 PM, Jakub Jelinek wrote: On Wed, Apr 26, 2017 at 10:26:56PM +, Joseph Myers wrote: On Wed, 26 Apr 2017, Martin Sebor wrote: Testing my solution for bug 77671 (missing -Wformat-overflow sprintf with "%s") caused a regression in the charset/builtin2.c test for bug 25120 (

Re: [PATCH] C++: Add fix-it hints for -Wold-style-cast

2017-04-27 Thread Marek Polacek
On Thu, Apr 27, 2017 at 05:10:24PM -0400, David Malcolm wrote: > + /* First try const_cast. */ > + trial = build_const_cast (dst_type, orig_expr, 0 /* complain */); > + if (trial != error_mark_node) > +return "const_cast"; > + > + /* If that fails, try static_cast. */ > + trial = build_s

Re: [PATCH] Fix fold_binary_loc BIT_XOR_EXPR folding (PR sanitizer/80349)

2017-04-27 Thread Jakub Jelinek
On Thu, Apr 27, 2017 at 09:17:44PM +0200, Marek Polacek wrote: > Yet another missing converts caused that BIT_XOR_EXPRs with incompatible > arguments have gotten into the gimplifier. Fixed thus. This patch also > improves readability by using a temporary, the current style wasn't very > readable

Re: [PATCH] C++: Add fix-it hints for -Wold-style-cast

2017-04-27 Thread Florian Weimer
* David Malcolm: > gcc/testsuite/ChangeLog: > * g++.dg/other/old-style-cast-fixits.C: New test case. Would it make sense to add a test cases for the non-fixable cases? That would be: void test_1 (const void *ptr) { foo *f = (foo *)ptr; } And: const bar b_inst; foo *f = (fo

Re: [PATCH] Match x86 family machine constraints section with constarints.md

2017-04-27 Thread Sandra Loosemore
On 04/26/2017 08:29 AM, Peryt, Sebastian wrote: Hi, This patch updates x86 family machine constraints section in '16.8.5 Constraints for Particular Machines' section to match the ones in 'config/i386/constraints.md'. gcc/ * doc/md.texi (Machine Constraints): Update x86 family machine

[PATCH] C++: Add fix-it hints for -Wold-style-cast

2017-04-27 Thread David Malcolm
Volker's patch for -Wold-style-cast inspired me to add a fix-it hint for when this warning fires, which converts the C-style cast to a C++-style cast. It tries to find a legal C++-style cast, trying them in the order: const_cast, static_cast, reinterpret_cast. It doesn't try dynamic_cast. It cal

[PATCH] Fix AIX bootstrap comparison due to empty *-tests.c and selftest* files (PR bootstrap/80531)

2017-04-27 Thread Jakub Jelinek
Hi! This is something that fails bootstrap newly in GCC 7 and only with (now on the branch default --enable-checking=release (or --disable-checking)). The problem is that the *-tests.c and selftest*.c sources after including some headers have the whole body guarded with #if CHECKING_P and with re

[committed] Fix AIX libgomp bootstrap comparison (PR bootstrap/80531)

2017-04-27 Thread Jakub Jelinek
Hi! AIX with -fPIC emits especially for __attribute__((constructor)) functions symbol names with random seed in it, which breaks bootstrap comparison. libstdc++ uses -frandom-seed=$@ everywhere, libgomp on HPUX uses -frandom-seed=fixed-string (should be eventually changed to $@), this patch adds i

Re: [Patch, fortran] PR34360 (Comment 28) - ICE when assigning item of a derived-component to a pointer

2017-04-27 Thread Thomas Koenig
Hello Paul, The attached fixes the problem withPR51218 and bootstraps and regtests on FC23/x86_64 - OK for trunk? I threw as many test cases at this as I could, and the patch worked very well. So, yes, OK for trunk. And thanks a lot for the patch! Regards Thomas

Re: Make pretty printers version namespace dependant

2017-04-27 Thread François Dumont
On 27/04/2017 20:32, Jonathan Wakely wrote: On 27/04/17 20:12 +0200, François Dumont wrote: Hi Here is the patch to registers Printers depending on activation of versioned namespace. 2017-04-27 François Dumont * python/Makefile.am [ENABLE_SYMVERS_GNU_NAMESPACE] (user_versioned_n

[PATCH] Fix fold_binary_loc BIT_XOR_EXPR folding (PR sanitizer/80349)

2017-04-27 Thread Marek Polacek
Yet another missing converts caused that BIT_XOR_EXPRs with incompatible arguments have gotten into the gimplifier. Fixed thus. This patch also improves readability by using a temporary, the current style wasn't very readable especially because of the wrong formatting caused by adding the *_loc v

Re: [PATCH] Don't assume __secure_getenv is available

2017-04-27 Thread Janne Blomqvist
On Thu, Apr 27, 2017 at 9:50 PM, Janne Blomqvist wrote: [snip] And on top of that patch this simple typo fix: diff --git a/libgfortran/runtime/environ.c b/libgfortran/runtime/environ.c index 969dcdf..f488e87 100644 --- a/libgfortran/runtime/environ.c +++ b/libgfortran/runtime/environ.c @@ -46,7

[PATCH] Don't assume __secure_getenv is available

2017-04-27 Thread Janne Blomqvist
Glibc 2.17 made __secure_getenv an officially supported function, and renamed it secure_getenv. The libgfortran configure has checked for both of these, per https://sourceware.org/glibc/wiki/Tips_and_Tricks/secure_getenv. Unfortunately, while the dynamical library (libc.so) retains the __secure_ge

[PATCH] doc/extend.texi (Object Size Checking): Improve grammar.

2017-04-27 Thread Jonathan Wakely
The main change is s/overflown/overflowed/ but I made a couple of other minor grammatical fixes. Committed to trunk as obvious. commit 6c664e18a926ea60d253001e78fe9e6828416884 Author: Jonathan Wakely Date: Thu Apr 27 19:42:52 2017 +0100 * doc/extend.texi (Object Size Checking): Impr

Re: [PATCH] PR c++/80544 strip cv-quals from cast results

2017-04-27 Thread Paolo Carlini
Hi, On 27/04/2017 18:59, Jonathan Wakely wrote: This is probably not the best way to do this, but it seems to work. Eventually, if this is the way to go, a small maybe_strip_* helper could tidy a bit the code... Paolo.

Re: Make pretty printers version namespace dependant

2017-04-27 Thread Jonathan Wakely
On 27/04/17 20:12 +0200, François Dumont wrote: Hi Here is the patch to registers Printers depending on activation of versioned namespace. 2017-04-27 François Dumont * python/Makefile.am [ENABLE_SYMVERS_GNU_NAMESPACE] (user_versioned_namespace): New. (gdb.py): Adapt target.

Make pretty printers version namespace dependant

2017-04-27 Thread François Dumont
Hi Here is the patch to registers Printers depending on activation of versioned namespace. 2017-04-27 François Dumont * python/Makefile.am [ENABLE_SYMVERS_GNU_NAMESPACE] (user_versioned_namespace): New. (gdb.py): Adapt target. * python/Makefile.in: Regenerate. * pyt

[C++ Patch] Remove is_auto_or_concept, etc (Was: Re: [C++, concepts] Two slightly obscure pt.c functions?)

2017-04-27 Thread Paolo Carlini
Hi again, On 26/04/2017 12:32, Paolo Carlini wrote: Hi, in 2013 (2013-09-16) Adam added two slightly obscure functions and I can't find much around in terms of rationale, etc: /* Returns true iff TYPE is a TEMPLATE_TYPE_PARM representing 'auto', 'decltype(auto)' or a concept. */ bool is

Re: [PATCH v4 0/12 GCC8] [i386] Improve 64-bit Microsoft to System V ABI pro/epilogues

2017-04-27 Thread Daniel Santos
I probably should have mentioned that these are all for GCC8.

[PATCH][AArch64] Improve Cortex-A53 shift bypass

2017-04-27 Thread Wilco Dijkstra
The aarch_forward_to_shift_is_not_shifted_reg bypass always returns true on AArch64 shifted instructions. This causes the bypass to activate in too many cases, resulting in slower execution on Cortex-A53 like reported in PR79665. This patch uses the arm_no_early_alu_shift_dep condition instead wh

[PATCH] PR c++/80544 strip cv-quals from cast results

2017-04-27 Thread Jonathan Wakely
This is probably not the best way to do this, but it seems to work. I also tried to add a warning like EDG's (see the PR) but it gave a false positive for direct-list-init of scoped enums (P0138R2, r240449) because that code goes through build_c_cast to perform the conversion, so looks like a cas

Re: [PING][PATCH] Move the check for any_condjump_p from sched-deps to target macros

2017-04-27 Thread Jeff Law
On 04/26/2017 06:50 AM, Hurugalawadi, Naveen wrote: Hi Wilco, Thanks for reviewing the patch. The return false seems incorrect - it means a core can either have FUSE_CMP_BRANCH or FUSE_ALU_BRANCH but not both. Thanks for pointing out about the confusion. Modified the code as required. Bootst

Re: [PATCH] Check for sp push/pop insns in reg_set_p (PR target/79430)

2017-04-27 Thread Jeff Law
On 04/27/2017 01:32 AM, Jakub Jelinek wrote: Hi! As mentioned in the PR and can be seen on the testcase (too large for testsuite, with lots of delta reduction I got 48KB *.f90 file still using a dozen of modules), we miscompile it because we have mem(sp+64) memory (what %st is loaded from) and a

Re: [PATCH] Improved diagnostics for casts and enums

2017-04-27 Thread Martin Sebor
On 04/27/2017 01:29 AM, Volker Reichelt wrote: Hi, the following two patches aim at improving GCC's diagnostics to help the user to get rid of old-style casts. While old-style pointer casts are really bad and need to be weeded out quickly, old-style casts between arithmetic types are IMHO much m

Re: [PATCH GCC8][14/33]Handle more cheap operations in force_expr_to_var_cost

2017-04-27 Thread Bin.Cheng
On Thu, Apr 27, 2017 at 4:30 PM, Jeff Law wrote: > On 04/26/2017 06:58 AM, Richard Biener wrote: >> >> On Tue, Apr 18, 2017 at 12:44 PM, Bin Cheng >> wrote: >>> >>> Hi, This patch handles more cheap cases in function >>> force_expr_to_var_cost, specifically, TRUNC_DIV_EXPR, BIT_AND_EXPR, >>> BIT_

Re: [PATCH] Remove -fstrict-overflow, default to undefined signed integer and pointer overflow

2017-04-27 Thread Jeff Law
On 04/26/2017 05:31 AM, Richard Biener wrote: The following removes the third state we had apart from signed integer overflow wrapping and being undefined. It makes signed integer overflow undefined, consistently at all optimization levels. -fno-strict-overflow stays as a backward compatible w

Re: [PATCH GCC8][14/33]Handle more cheap operations in force_expr_to_var_cost

2017-04-27 Thread Jeff Law
On 04/26/2017 06:58 AM, Richard Biener wrote: On Tue, Apr 18, 2017 at 12:44 PM, Bin Cheng wrote: Hi, This patch handles more cheap cases in function force_expr_to_var_cost, specifically, TRUNC_DIV_EXPR, BIT_AND_EXPR, BIT_IOR_EXPR, RSHIFT_EXPR and BIT_NOT_EXPR. Is it OK? I wonder if using add

[PATCH] Remove reundant const-qualification from cast targets

2017-04-27 Thread Jonathan Wakely
static_cast and const_cast are meaningless when T is not a class type, because the result is a prvalue and prvalues of non-class type are unqualified. I'm removing these pointless const-qualifications now, because I'm experimenting with a patch to make the front-end warn about this. * inc

Re: [PATCH] Fix PR80533

2017-04-27 Thread Alexander Monakov
On Thu, 27 Apr 2017, Richard Biener wrote: > struct q { int n; long o[100]; }; > struct r { int n; long o[0]; }; > > union { > struct r r; > struct q q; > } u; > > int foo (int i, int j) > { > long *q = u.r.o; > u.r.o[i/j] = 1; > return q[2]; > } > > but nothing convinced schedulin

[PR 78687] Set SRA grp_write lazily

2017-04-27 Thread Martin Jambor
Hi, PR 78687 is a reported SRA missed-optimization issue. The problem, in its simplest form, happens when we have two big local non-addressable structures, we initialize only small portions of the first one and then assign all of it it to the second one, where we still only work with the initial

Re: [PATCH, v3] Fix PR51513, switch statement with default case containing __builtin_unreachable leads to wild branch

2017-04-27 Thread Peter Bergner
On 4/27/17 6:57 AM, Bernhard Reutner-Fischer wrote: > On Wed, Apr 26, 2017 at 10:39:12PM -0500, Peter Bergner wrote: >> +/* Returns true if the basic block BB has no successors and only contains >> + a call to __builtin_unreachable (). */ > > so > return EDGE_COUNT (bb->succs) == 0 > && (

Re: [PATCH] Improve VRP range intersection for partly symbolic ranges

2017-04-27 Thread Richard Biener
On April 27, 2017 4:06:48 PM GMT+02:00, "Bin.Cheng" wrote: >On Thu, Apr 27, 2017 at 2:49 PM, Richard Biener >wrote: >> >> The following makes intersecting [-INF, +10] and [a + -1, +INF] >> to [10, a + -1] possible with the chance that for a <= 10 the >> resulting range will be empty (but not tri

Re: [PATCH] Fix test-case on ppc64le (PR testsuite/79455).

2017-04-27 Thread Jakub Jelinek
On Thu, Apr 27, 2017 at 04:11:36PM +0200, Martin Liška wrote: > On 04/26/2017 03:38 PM, Bernd Edlinger wrote: > > I think however, that only one extra call frame can ever > > be seen, because the stack frames are only created by instrumentation > > at instrumented function begin and end statements.

Re: [PATCH] Fix test-case on ppc64le (PR testsuite/79455).

2017-04-27 Thread Martin Liška
On 04/26/2017 03:38 PM, Bernd Edlinger wrote: > I think however, that only one extra call frame can ever > be seen, because the stack frames are only created by instrumentation > at instrumented function begin and end statements. > > So probably the test expectations could be more strict than in t

Re: [PATCH] Improve VRP range intersection for partly symbolic ranges

2017-04-27 Thread Bin.Cheng
On Thu, Apr 27, 2017 at 2:49 PM, Richard Biener wrote: > > The following makes intersecting [-INF, +10] and [a + -1, +INF] > to [10, a + -1] possible with the chance that for a <= 10 the > resulting range will be empty (but not trivially visible as so). Hi, I noticed operand_less_p is quite simple

Re: [PATCH] Fix PR80539

2017-04-27 Thread Sebastian Pop
The patch looks good to me. Thanks, Sebastian On Thu, Apr 27, 2017 at 4:25 AM, Richard Biener wrote: > > SCEV analysis requires us to be in loop-closed SSA form to be able > to compute overall effects of inner loops when required. Unfortunately > we have too many places it is used where we are

Re: [AArch64] Fix for gcc-7 regression PR 80530

2017-04-27 Thread Richard Earnshaw (lists)
On 27/04/17 14:26, Jakub Jelinek wrote: > On Thu, Apr 27, 2017 at 01:32:11PM +0100, Richard Earnshaw (lists) wrote: >> This patch fixes the regression caused by the changes to add square root >> estimation when compiling for xgene-1 or exynos-m1 targets. >> >> The issue is that the expand path for

[Ada] Give warnings on questionable layout of record types

2017-04-27 Thread Arnaud Charlet
This implements a warning on the questionable placement of specific sorts of components in record types, more specifically those with non-fixed size or those with a fixed size that is not a mutiple of the storage unit. It is enabled by -gnatw.q (and disabled by -gnatw.Q) only for the time being.

[PATCH] Improve VRP range intersection for partly symbolic ranges

2017-04-27 Thread Richard Biener
The following makes intersecting [-INF, +10] and [a + -1, +INF] to [10, a + -1] possible with the chance that for a <= 10 the resulting range will be empty (but not trivially visible as so). Bootstrap / regtest running on x86_64-unknown-linux-gnu. I'll add a testcase later. Richard. 2017-04-27

[PATCH] Refactor assert expr finding in VRP to re-use it from EVRP

2017-04-27 Thread Richard Biener
This refactors register_edge_assert_for_* so that EVRP can use the "advanced" extraction of ranges from conditions. It is a re-send of one part of a series from last December, third part first (and thus slightly different). Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. Richard.

[Ada] Class-wide preconditions in dispatching calls.

2017-04-27 Thread Arnaud Charlet
This patch is a partial implementation of the semantics mandated in AI12-0195 concerning class-wide preconditions on dispatching calls: the precondition that applies is that of the denoted subprogram entity, not that of the body that is actually executed. Tested in ACATS test C611A03 Tested on x8

Re: [PATCH] TYPE_TYPELESS_STORAGE handling fixes (PR c++/80534)

2017-04-27 Thread Richard Biener
On Thu, 27 Apr 2017, Jakub Jelinek wrote: > Hi! > > As mentioned in the PR, stor-layout.c (layout_type) can set > TYPE_TYPELESS_STORAGE flag on ARRAY_TYPE that didn't have it before, > which breaks ARRAY_TYPE hashing in build_array_type_1/type_hash_canon. > > We have 2 cases, one is ARRAY_TYPE w

Re: [AArch64] Fix for gcc-7 regression PR 80530

2017-04-27 Thread Jakub Jelinek
On Thu, Apr 27, 2017 at 01:32:11PM +0100, Richard Earnshaw (lists) wrote: > This patch fixes the regression caused by the changes to add square root > estimation when compiling for xgene-1 or exynos-m1 targets. > > The issue is that the expand path for the reciprocal estimate square > root pattern

[PATCH] TYPE_TYPELESS_STORAGE handling fixes (PR c++/80534)

2017-04-27 Thread Jakub Jelinek
Hi! As mentioned in the PR, stor-layout.c (layout_type) can set TYPE_TYPELESS_STORAGE flag on ARRAY_TYPE that didn't have it before, which breaks ARRAY_TYPE hashing in build_array_type_1/type_hash_canon. We have 2 cases, one is ARRAY_TYPE with non-AGGREGATE_TYPE_P element type (note: TYPE_TYPELES

[Ada] Elaboration checks for dispatching calls

2017-04-27 Thread Arnaud Charlet
This patch introduces a new access-before-elaboration check which attempts to detect an indirect call to a primitive of a tagged type through dispatching where the body of the primitive has not been elaborated yet. The check uses a flag which is set after the body of the primitive is elaborated and

Re: [PATCH] Backport the recent ARM ABI patch to 6 (PR target/77728)

2017-04-27 Thread Marek Polacek
On Thu, Apr 27, 2017 at 02:46:23PM +0200, Jakub Jelinek wrote: > On Thu, Apr 27, 2017 at 01:37:02PM +0100, Richard Earnshaw (lists) wrote: > > > + if (ncrn & 1) > > > +{ > > > + int res = arm_needs_doubleword_align (mode, type); > > > + /* Only warn during RTL expansion of call stmts

Re: [PATCH] Don't check for __secure_getenv

2017-04-27 Thread Jakub Jelinek
On Thu, Apr 27, 2017 at 03:50:19PM +0300, Janne Blomqvist wrote: > Glibc 2.17 made __secure_getenv an officially supported function, and > renamed it secure_getenv. The libgfortran configure has checked for > both of these, per > https://sourceware.org/glibc/wiki/Tips_and_Tricks/secure_getenv. > >

[PATCH] Don't check for __secure_getenv

2017-04-27 Thread Janne Blomqvist
Glibc 2.17 made __secure_getenv an officially supported function, and renamed it secure_getenv. The libgfortran configure has checked for both of these, per https://sourceware.org/glibc/wiki/Tips_and_Tricks/secure_getenv. Unfortunately, while the dynamical library (libc.so) retains the __secure_ge

Re: [PATCH] Backport the recent ARM ABI patch to 6 (PR target/77728)

2017-04-27 Thread Jakub Jelinek
On Thu, Apr 27, 2017 at 01:37:02PM +0100, Richard Earnshaw (lists) wrote: > > + if (ncrn & 1) > > +{ > > + int res = arm_needs_doubleword_align (mode, type); > > + /* Only warn during RTL expansion of call stmts, otherwise we would > > +warn e.g. during gimplification even on fun

Re: [PATCH] Backport the recent ARM ABI patch to 6 (PR target/77728)

2017-04-27 Thread Richard Earnshaw (lists)
On 27/04/17 11:44, Marek Polacek wrote: > This is a backport of the ARM ABI fix, except that it doesn't change code, > only adds the ABI warning. > > So there were four changes, three of them are changing "else if (res < 0)" > to "if (res != 0)" and the fourth was the "res != 0" change in > arm_fu

[AArch64] Fix for gcc-7 regression PR 80530

2017-04-27 Thread Richard Earnshaw (lists)
This patch fixes the regression caused by the changes to add square root estimation when compiling for xgene-1 or exynos-m1 targets. The issue is that the expand path for the reciprocal estimate square root pattern assumes that pattern cannot fail once it has been decided that this expansion path

Re: [PATCH, v3] Fix PR51513, switch statement with default case containing __builtin_unreachable leads to wild branch

2017-04-27 Thread Bernhard Reutner-Fischer
On Wed, Apr 26, 2017 at 10:39:12PM -0500, Peter Bergner wrote: > +/* Returns true if the basic block BB has no successors and only contains > + a call to __builtin_unreachable (). */ so return EDGE_COUNT (bb->succs) == 0 && (gsi = gsi_last_nondebug_bb (bb)) && !gsi_end_p (gsi) &&

Re: [PATCH] Improved diagnostics for casts and enums

2017-04-27 Thread Nathan Sidwell
On 04/27/2017 03:29 AM, Volker Reichelt wrote: Hi, the following two patches aim at improving GCC's diagnostics to help the user to get rid of old-style casts. While old-style pointer casts are really bad and need to be weeded out quickly, old-style casts between arithmetic types are IMHO much m

Re: [PATCH] C++: fix-it hints suggesting accessors for private fields

2017-04-27 Thread Nathan Sidwell
On 04/26/2017 12:34 PM, David Malcolm wrote: Thanks - yes; that gives information on the const vs non-const of the "this" parameter, but doesn't say whether the argument was const vs non -const. However, within: int test_const_ptr (const t1 *ptr) { return ptr->m_color; } from which we can

[Ada] Removal of elaboration-related flags for SPARK

2017-04-27 Thread Arnaud Charlet
This patch suppresses the generation of elaboration counters and access-before- elaboration checks for GNATprove compilations. -- Source -- -- dic.ads package Dic with Elaborate_Body Is G : Integer; type T is private with Default_Initial_Condition => Foo (T);

[Ada] Fix evaluation of comparisons for GNATprove

2017-04-27 Thread Arnaud Charlet
Static analysis tools benefit from some evaluations being done in frontend, in particular comparisons between values of universal types which are supposed to be evaluated at compile time and which static analysis tools like GNATprove may not support. Restore such evaluation during semantic analysis

[Ada] Fix handling of wrappers for some primitives in GNATprove

2017-04-27 Thread Arnaud Charlet
The wrappers introduced to handle correctly calls to overridden primitives in class-wide contracts of inherited primitives need to be introduced for compilation (whether SPARK_Mode is On or Off) but not formal verification (when GNATprove_Mode is True). Tested on x86_64-pc-linux-gnu, committed on

[PATCH] Backport the recent ARM ABI patch to 6 (PR target/77728)

2017-04-27 Thread Marek Polacek
This is a backport of the ARM ABI fix, except that it doesn't change code, only adds the ABI warning. So there were four changes, three of them are changing "else if (res < 0)" to "if (res != 0)" and the fourth was the "res != 0" change in arm_function_arg_boundary. I've verified on a testcase th

[Ada] Fix side-effect removal for GNATprove

2017-04-27 Thread Arnaud Charlet
GNATprove relies on side-effects being removed and value being fixed from renamings, which was not the case for the renaming of a qualified expression. Now done. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-04-27 Yannick Moy * exp_util.ads, exp_util.adb (Evaluate_Name): Forc

[Ada] Memory leak when using variant records

2017-04-27 Thread Arnaud Charlet
This patch corrects an issue whereby variant records with controlled components would skip generation of finalization routines due to a counter (Num_Comps) improperly being reset. -- Source -- -- map_leak.adb with Ada.Strings.Hash; with Ada.Containers.Indefinite_Hashed

Re: [PATCH] Fix PR80539

2017-04-27 Thread Richard Biener
On Thu, 27 Apr 2017, Bin.Cheng wrote: > On Thu, Apr 27, 2017 at 10:25 AM, Richard Biener wrote: > > > > SCEV analysis requires us to be in loop-closed SSA form to be able > > to compute overall effects of inner loops when required. Unfortunately > > we have too many places it is used where we ar

[Ada] Spurious visibility error in instance with nested packages

2017-04-27 Thread Arnaud Charlet
This patch corrects the visibility machinery to properly infer the original visibility of a use-visible entity defined within a nested package within a generic when the generic is instantiated and there is already another use- visible entity which satisfies the referenced. -- Source -

[PATCH] Fix PR80533

2017-04-27 Thread Richard Biener
When set_mem_attributes_minus_bitpos computes the MEM_EXPR for MEM RTXen it strips outermost ARRAY_REFs (for historic efficiency reasons). Nowadays a MEM_EXPR has to be conservative with respect to alias analysis which means it has to cover the original access. This means we may _not_ end up with

[Ada] for CodePeer, don't expand Image, Wide_Image, Wide_Wide_Image attributes

2017-04-27 Thread Arnaud Charlet
This change has no user-visible effect except when Gnat2scil is running. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-04-27 Steve Baird * exp_attr.adb (Expand_N_Attribute_Reference): Don't expand Image, Wide_Image, Wide_Wide_Image attributes for CodePeer. In

[Ada] 'Type_Key on subtypes and derived types

2017-04-27 Thread Arnaud Charlet
This patch fixes a bug in which 'Type_Key on a subtype or derived type could sometimes access the wrong source buffer. The following test should compile and run silently. package P is type My_Int is range 1 .. 10; for My_Int'Size use 10; end P; with P; use P; package Q is type New_My_Int

[Ada] Spurious error in function call with incomplete type

2017-04-27 Thread Arnaud Charlet
This patch removes a spurious error from a function call when the return type of the function is an incomplete type. This can be the case if the type is a generic formal, or a limited view. It can also happen when the function declaration appears before the full view of the type (which is legal in

Re: [PATCH] Fix PR80539

2017-04-27 Thread Bin.Cheng
On Thu, Apr 27, 2017 at 10:25 AM, Richard Biener wrote: > > SCEV analysis requires us to be in loop-closed SSA form to be able > to compute overall effects of inner loops when required. Unfortunately > we have too many places it is used where we are not in loop-closed SSA > form. The following p

[Ada] Provide extended contracts for formal doubly linked lists

2017-04-27 Thread Arnaud Charlet
Primitives of doubly linked lists are now annotated with precise contracts which can be used for formal verification with GNATprove. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-04-27 Claire Dross * a-cfdlli.adb, a-cfdlli.ads (=): Generic parameter removed to allow t

[PATCH] Fix PR80539

2017-04-27 Thread Richard Biener
SCEV analysis requires us to be in loop-closed SSA form to be able to compute overall effects of inner loops when required. Unfortunately we have too many places it is used where we are not in loop-closed SSA form. The following patch makes us more conservative in two places where we previously

[Ada] Strict and relaxed secondary stack management

2017-04-27 Thread Arnaud Charlet
This patch modifies the management of secondary stack within transient blocks by allowing "relaxed management" to be the default. In this mode a block will not manage the secondary stack if there exists an enclosing scope which already does that. "Strict management" can be enforced by means of swit

[Ada] Raise exception if Current_Directory does not exist

2017-04-27 Thread Arnaud Charlet
This patch fixes a bug in which Ada.Directories.Current_Directory returns invalid data if the current directory does not exist. The following test should run silently: rm -rf bug7550 mkdir -p bug7550 cd bug7550 cp ../bug7550.adb . gnatmake -q -f bug7550.adb -o bug7550 ./bug7550 & cd .. sleep 1 rm

[Ada] Names of Ghost entities are uniquely identified in executable

2017-04-27 Thread Arnaud Charlet
Names of Ghost entities are now prefixed by "___ghost_" (three leading underscores) to make it possible to independently check the presence of ghost code in an object file or an executable. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-04-27 Yannick Moy * exp_dbug.adb, exp_db

[Ada] Crash on illegal quantified expression

2017-04-27 Thread Arnaud Charlet
This patch adds a diagnostic to detect an illegal quantified expression which is masquerading as an iterated component association. -- Source -- -- proc.adb with Ada.Containers; with Ada.Containers.Hashed_Sets; procedure Proc is function Hash (X : Integer) return A

Re: [PATCH][RFC] Enable -fstrict-overflow by default

2017-04-27 Thread Richard Biener
On Wed, 26 Apr 2017, Martin Sebor wrote: > On 04/26/2017 01:59 AM, Richard Biener wrote: > > On Tue, 25 Apr 2017, Martin Sebor wrote: > > > > > On 04/24/2017 05:25 AM, Richard Biener wrote: > > > > > > > > The following makes signed overflow undefined for all (non-)optimization > > > > levels.

Re: [PATCH] More conservative reg-stack push/pop sp modification fix (PR target/79430)

2017-04-27 Thread Richard Biener
On Thu, 27 Apr 2017, Jakub Jelinek wrote: > Hi! > > As the patch I've just posted is probably too dangerous for 7.1, here > is a more localized version of the fix, which doesn't change reg_set_p/ > modified_in_p/modified_between_p etc. behavior that is used in many spots, > but just changes emit_

[Ada] Provide library for functional containers

2017-04-27 Thread Arnaud Charlet
This patch introduces new children of Ada.Containers. They provide functional, mathematical like containers, which can be used as high level models when specifying data structures. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-04-27 Claire Dross * a-cofuba.ads, a-cofuba.adb (

[Ada] Crash on ambiguous allocator expression

2017-04-27 Thread Arnaud Charlet
This patch corrects a crash that was produced when comparing "null" to an allocator due to type Any_Access being improperly setup with no designated type. Because both operands require a specific type from context such a case will now emit the proper "ambiguous operands" error. -- Sou

Re: [PATCH][GCC][mid-end] Align cost calculations of mod with div. (PR middle-end/79665)

2017-04-27 Thread Richard Biener
On Wed, Apr 26, 2017 at 6:02 PM, Tamar Christina wrote: > Hi all, > > r245676 (PR/79665) introduced a change to calculate the costs of signed > and unsigned div operations independently and when both are possible to > allow you to specify a preference via cost mode. > > From the cover letter https

[Ada] Finer grained secondary stack management

2017-04-27 Thread Arnaud Charlet
This patch has several effects: 1) The management of the secondary stack is now "tighter". A transient block created for the purpose of managing the secondary stack will do so unless the block appears within a function returning on the secondary stack or when 2) is in effect. Previously,

[Ada] Spurious visibility error with entity in formal package.

2017-04-27 Thread Arnaud Charlet
This patch removes a spurious visibility error on a reference to a formal T of a formal package, when T is declared as a formal derived type and there is no corresponding actual for T in the formal package declaration, that is to say it is covered by an (others => <>) clause. Compiling c.adb must

Re: [testsuite] Add missing dg-require-effective-target alloca to gcc testsuite

2017-04-27 Thread Tom de Vries
On 04/26/2017 01:57 PM, Jakub Jelinek wrote: On Wed, Apr 26, 2017 at 01:48:03PM +0200, Tom de Vries wrote: [ reposting with patch removed, was too big for gcc-patches@ ] I see in various tests you've ended up with ... { target ... } . } I think it would be better to just use ... { target ... }

[PATCH][x86] Add missing intrinsics for ADD[SD,SS] and SUB[SD,SS]

2017-04-27 Thread Peryt, Sebastian
Hi, This patch adds missing intrinsics for ADDSD, ADDSS, SUBSD and SUBSS instructions. gcc/ * config/i386/avx512fintrin.h (_mm_mask_add_round_sd, _mm_maskz_add_round_sd, _mm_mask_add_round_ss, _mm_maskz_add_round_ss, _mm_mask_sub_round_sd, _mm_maskz_sub_round_sd,

[PATCH 12/12] [i386,testsuite] Test program for ms to sysv abi function calls.

2017-04-27 Thread Daniel Santos
A comprehensive program for testing x86_64 ms_abi functions that call sysv_abi functions to help validate -mcall-ms2sysv-xlogues and use of aligned SSE MOVs after a (non-DRAP) realigned stack. Signed-off-by: Daniel Santos --- gcc/Makefile.in| 2 + .../gcc.ta

[PATCH 11/12] [i386] Add remainder of -mcall-ms2sysv-xlogues implementation

2017-04-27 Thread Daniel Santos
Add functions emit_outlined_ms2sysv_save and emit_outlined_ms2sysv_restore, which are called from ix86_expand_prologue and ix86_expand_epilogue, respectively. Also adds the code to ix86_expand_call that enables the optimization (setting the machine_function's outline_ms_sysv field). Signed-off-by

[PATCH 06/12] [i386] Add class xlogue_layout and new fields to struct machine_function

2017-04-27 Thread Daniel Santos
Of the new fields added to struct machine_function, call_ms2sysv is initially set in ix86_expand_call, but may later be cleared when ix86_compute_frame_layout is called (both of these are in subsequent patch). If it is not cleared, then the remaining new fields will be set in ix86_compute_frame_la

[PATCH 07/12] [i386] Modify ix86_save_reg to optionally omit stub-managed registers

2017-04-27 Thread Daniel Santos
Add HARD_REG_SET stub_managed_regs to track which registers will be managed by the pro/epilogue stubs for the function. Add a third parameter bool ignore_outlined to ix86_save_reg to specify rather or not the count should include registers marked in stub_managed_regs. All call sites are modified.

[PATCH 08/12] [i386] Modify ix86_compute_frame_layout for -mcall-ms2sysv-xlogues

2017-04-27 Thread Daniel Santos
ix86_compute_frame_layout will now populate fields added to structs machine_function and ix86_frame and modify the frame layout specifics to facilitate the use of save & restore stubs. This is also where we init stub_managed_regs to track which register saves & restores are being managed by the ou

[PATCH 09/12] [i386] Add patterns and predicates foutline-msabi-xlouges

2017-04-27 Thread Daniel Santos
Adds the predicates save_multiple and restore_multiple to predicates.md, which are used by following patterns in sse.md: * save_multiple - insn that calls a save stub * restore_multiple - call_insn that calls a save stub and returns to the function to allow a sibling call (which should typically

[PATCH 10/12] [i386] Add ms2sysv pro/epilogue stubs to libgcc

2017-04-27 Thread Daniel Santos
Add new header libgcc/config/i386/i386-asm.h to manage common cpp and gas macros. Add new stubs. Stubs use the following naming convention: __ms64[f][x]_ Save or restore ms64Avoid possible name collisions with future stubs (specific to 64-bit msabi --> sysv

[PATCH 03/12] [i386] Use re-aligned stack pointer for aligned SSE movs

2017-04-27 Thread Daniel Santos
Add an optional `align' parameter to choose_baseaddr, allowing the caller to request an address that is aligned to some boundary. Modify ix86_emit_save_regs_using_mov and ix86_emit_restore_regs_using_mov use optimally aligned memory when such a base register is available. Signed-off-by: Daniel Sa

[PATCH 05/12] [i386] Add option -mcall-ms2sysv-xlogues

2017-04-27 Thread Daniel Santos
Adds the options -mcall-ms2sysv-xlogues to i386.opt and i386.c and documentation to invoke.texi. Using -mcall-ms2sysv-xlogues on SEH targets is currently unsupported and will result in a sorry (). SEH targets can be supported, but it would require adding support for CFA_REG_EXPRESSION to the SEH

  1   2   >