Re: [PATCH] streambuf_iterator: avoid debug-dependent behaviour

2017-09-07 Thread Petr Ovtchenkov
-gcc-patches On Thu, 7 Sep 2017 23:02:15 +0200 François Dumont wrote: > + _M_c = _M_sbuf->sgetc(); > + if (_S_at_eof(_M_c)) > + _M_sbuf = 0; _M_sbuf = 0; <--- Is not what I axpect here. Suggestions will be later, after we finish copyright assignment for

Re: Statement Frontier Notes, Location Views, and Inlined Entry Point Markers

2017-09-07 Thread Joseph Myers
On Fri, 25 Aug 2017, Alexandre Oliva wrote: > for gcc/ChangeLog > > * common.opt (Wa, Wl, Wp, g, gz=): Add > RejectNegative. > (gno-column-info): Remove. > (gcolumn-info): Drop RejectNegative. > (gno-): New prefix. > (gno-record-gcc-switches): Remove. >

Re: [PATCH] Fix atomic builtins on arrays (PR target/82112)

2017-09-07 Thread Joseph Myers
On Thu, 7 Sep 2017, Jakub Jelinek wrote: > Ah, ok, so like this instead? > > 2017-09-07 Jakub Jelinek > > PR target/82112 > * c-common.c (sync_resolve_size): Instead of c_dialect_cxx () > assertion check that in the condition. >

Re: [PATCH] Fix atomic builtins on arrays (PR target/82112)

2017-09-07 Thread Jakub Jelinek
On Thu, Sep 07, 2017 at 03:35:00PM +, Joseph Myers wrote: > > The powerpc patch I've just posted led me to try __atomic_* builtins > > on arrays as in the testcase below. While it works fine if the > > array is just on the first argument or in C, in C++ for arrays in 2nd > > or 3rd argument

Re: [PATCH] streambuf_iterator: avoid debug-dependent behaviour

2017-09-07 Thread François Dumont
Hi Following this report I had a closer look to this debug-dependent behavior which I agree about. I have added some checks to 2.cc as shown in the patch. Initially the test was failing because: /home/fdt/dev/gcc/git/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/2.cc:45: void

Backports to 7.x

2017-09-07 Thread Jakub Jelinek
Hi! I've bootstrapped/regtested and committed to gcc-7-branch backports of 10 trunk commits. Jakub 2017-09-07 Jakub Jelinek Backported from mainline 2017-07-27 Jakub Jelinek PR c/45784 * c-omp.c

Re: Add support to trace comparison instructions and switch statements

2017-09-07 Thread David Edelsohn
On Thu, Sep 7, 2017 at 6:57 PM, Rainer Orth wrote: > Jakub Jelinek writes: > >> On Wed, Sep 06, 2017 at 10:08:01PM +0200, David Edelsohn wrote: >>> This change broke bootstrap on AIX because sancov.c now references a >>> macro that is defined as

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

2017-09-07 Thread Jeff Law
On 09/05/2017 03:48 PM, Segher Boessenkool wrote: > Hi! > > On Sat, Sep 02, 2017 at 12:31:16AM -0600, Jeff Law wrote: >> On 08/29/2017 05:14 PM, Segher Boessenkool wrote: >>> Actually, everywhere it is used it has a Pmode == SImode wart before >>> it, to emit the right update_stack insn... So

Re: Add support to trace comparison instructions and switch statements

2017-09-07 Thread Rainer Orth
Jakub Jelinek writes: > On Wed, Sep 06, 2017 at 10:08:01PM +0200, David Edelsohn wrote: >> This change broke bootstrap on AIX because sancov.c now references a >> macro that is defined as a function on AIX. sancov.c needs to include >> tm_p.h to pull in the target-dependent

[SPARC] Fix PR target/80897

2017-09-07 Thread Eric Botcazou
This is the Ada bootstrap failure on SPARC64/Linux that I worked around at some point; it turns out that we can do something plausible in the back-end. Tested on SPARC64/Linux, applied on mainline. 2017-09-07 Eric Botcazou PR target/80897 *

Re: [PATCH] Fix atomic builtins on arrays (PR target/82112)

2017-09-07 Thread Joseph Myers
On Thu, 7 Sep 2017, Jakub Jelinek wrote: > Hi! > > The powerpc patch I've just posted led me to try __atomic_* builtins > on arrays as in the testcase below. While it works fine if the > array is just on the first argument or in C, in C++ for arrays in 2nd > or 3rd argument the atomics are

Fix PR ada/82127

2017-09-07 Thread Eric Botcazou
A small oversight in the implementation of component reordering. Tested on x86_64-suse-linux, applied on mainline. 2017-09-07 Eric Botcazou PR ada/82127 * gcc-interface/decl.c (copy_and_substitute_in_layout): Put the fields in order of

PING: [PATCH] Add -static-pie to GCC driver to create static PIE

2017-09-07 Thread H.J. Lu
On Mon, Aug 28, 2017 at 10:13 AM, H.J. Lu wrote: > On Mon, Aug 28, 2017 at 9:10 AM, Joseph Myers wrote: >> On Tue, 8 Aug 2017, H.J. Lu wrote: >> >>> This patch adds -static-pie to GCC driver to create static PIE. A static >>> position independent

Re: [PATCH] PR libstdc++/79433 no #error for including headers with wrong -std

2017-09-07 Thread Ville Voutilainen
On 7 September 2017 at 17:18, Jonathan Wakely wrote: > Does anybody object to this change? Is getting a #error still useful, > given the existence of __has_include and __cpp_lib macros? I wholeheartedly agree with this change. And I should point out that vast amounts of

RE: [RFC, vectorizer] Allow single element vector types for vector reduction operations

2017-09-07 Thread Richard Biener
On September 7, 2017 1:20:13 PM GMT+02:00, Jon Beniston wrote: >Hi Bernd, > >>This seems to ring a bell. I think I submitted a patch for this here >>- is this the same problem? >>https://gcc.gnu.org/ml/gcc-patches/2010-12/msg01724.html > >Looks like it. Looks my suggestion

[PATCH] PR libstdc++/79433 no #error for including headers with wrong -std

2017-09-07 Thread Jonathan Wakely
As discussed in PR 79433, the recommended way to test for new features such as std::optional has problems. The current version of SD-6 at https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations says to simply check __has_include(optional). This test will be true even when

Re: [PATCH] Fix rs6000 sysv4 -fPIC hot/cold partitioning handling (PR target/81979)

2017-09-07 Thread Segher Boessenkool
On Thu, Sep 07, 2017 at 11:46:09AM +0200, Jakub Jelinek wrote: > On Wed, Sep 06, 2017 at 11:48:00AM -0500, Segher Boessenkool wrote: > > On Wed, Sep 06, 2017 at 06:26:10PM +0200, Jakub Jelinek wrote: > > > > Maybe this "switch to the other section" thing should be abstracted out? > > > > Messing

Ping on MIPS specific patch adds `short_call` synonym for `near` attribute

2017-09-07 Thread Simon Atanasyan
This is a ping for a small MIPS specific patch adds `short_call` synonym for existing `near` attribute. The patch has not been approved or commented on. Add 'short_call' attribute for MIPS targets. https://gcc.gnu.org/ml/gcc-patches/2017-08/msg01280.html -- Simon Atanasyan

RE: [RFC, vectorizer] Allow single element vector types for vector reduction operations

2017-09-07 Thread Jon Beniston
Hi Bernd, >This seems to ring a bell. I think I submitted a patch for this here >- is this the same problem? >https://gcc.gnu.org/ml/gcc-patches/2010-12/msg01724.html Looks like it. Cheers, Jon

Re: [PATCH] Fix rs6000 sysv4 -fPIC hot/cold partitioning handling (PR target/81979)

2017-09-07 Thread Richard Biener
On Thu, 7 Sep 2017, Jakub Jelinek wrote: > On Wed, Sep 06, 2017 at 11:48:00AM -0500, Segher Boessenkool wrote: > > On Wed, Sep 06, 2017 at 06:26:10PM +0200, Jakub Jelinek wrote: > > > > Maybe this "switch to the other section" thing should be abstracted out? > > > > Messing with in_cold_section_p

Re: [RFC, vectorizer] Allow single element vector types for vector reduction operations

2017-09-07 Thread Bernd Schmidt
On 08/27/2017 09:36 PM, Jon Beniston wrote: > I have an out-of-tree GCC port and it is struggling supporting > auto-vectorization on some dot product instructions. For example, I have an > instruction that takes three operands which are all 32-bit general > registers. The second and third

Re: RFC: Representation of runtime offsets and sizes

2017-09-07 Thread Richard Sandiford
Thanks for the quick feedback. Richard Biener writes: > On Wed, Sep 6, 2017 at 10:18 PM, Richard Sandiford > wrote: >> The next main step in the SVE submission is to add support for >> offsets and sizes that are a runtime invariant

[Ada] Proper handling of dimension information in a type conversion.

2017-09-07 Thread Arnaud Charlet
This patch implements the proper handling of dimension information on type conversions. Given a conversion T (Expr), where the expression has type TE, the following cases arise: a) If TE has dimension information, the dimensions of the conversion are those of TE. b) If TE has no dimension

[Ada] Adding switch to disable implicit Elaborate_All in task case

2017-09-07 Thread Arnaud Charlet
This patch adds switch -gnatd.y to disable the generation of implicit Elaborate_All on a package X when a task body calls a procedure in the same package, and that procedure calls a procedure in another package X. As documented in the GNAT User Guide, when sources cannot be modified, the

[Ada] Return raise with access class-wide interface

2017-09-07 Thread Arnaud Charlet
This patches fixes a bug in which a function returns an anonymous access type whose designated type is a class-wide interface type, and the return statement returns a raise expression, the compiler crashes. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-09-07 Bob Duff

[Ada] Spurious error in precondition and classwide parameter

2017-09-07 Thread Arnaud Charlet
This patch fixes a spurious error on a classwide precondition for a subprogram S that is a primitive of some type T, when the precondition includes a dispatching call on a classwide formal of S whose type is urelated to T. The following must compile quietly: gnatmake -q main --- with

Re: [PATCH] Fix rs6000 sysv4 -fPIC hot/cold partitioning handling (PR target/81979)

2017-09-07 Thread Jakub Jelinek
On Wed, Sep 06, 2017 at 11:48:00AM -0500, Segher Boessenkool wrote: > On Wed, Sep 06, 2017 at 06:26:10PM +0200, Jakub Jelinek wrote: > > > Maybe this "switch to the other section" thing should be abstracted out? > > > Messing with in_cold_section_p is a bit dirty. > > > > But it reflects the

[Ada] Fix internal error on package instantiation and inlining

2017-09-07 Thread Arnaud Charlet
This fixes a small regression introduced by the recent improvement to the algorithm used by Hide_Public_Entities to compute the final set of external visible entities of a package. Subprogram renamings not only need to be dealt with as declaring a subprogram but also as referencing another one.

[Ada] Fix handling of ghost entity in predicate

2017-09-07 Thread Arnaud Charlet
Ghost types are allowed to mention ghost entities in their predicate. Because Ghost is propagated from type to the generated predicate function, GNAT correctly identified valid from invalid cases, but this modification simplifies the reason for correction. Tested on x86_64-pc-linux-gnu, committed

[Ada] Spurious errors on dynamic predicates and private declarations.

2017-09-07 Thread Arnaud Charlet
This patch fixes spurious visibility errors on the expression for a dynamic predicate in a subtype declaration, when the enclosing package includes private declarations. The following packages much compile quietly: --- package foo is type Kind_Type is (None, Known); type

[Ada] Avoid secondary stack for nondispatching build-in-place calls

2017-09-07 Thread Arnaud Charlet
This patch fixes a performance regression. The compiler was using the secondary stack for a nondispatching build-in-place call, which is unnecessary, and indeed older compilers did not do so. The compiler no longer uses the secondary stack for such calls. Note that the secondary stack is necessary

[Ada] Fix internal error on task allocation and inlining

2017-09-07 Thread Arnaud Charlet
This fixes a small regression introduced by the recent improvement to the algorithm used by Hide_Public_Entities to compute the final set of external visible entities of a package. It now needs to recurse on the Actions list of freeze nodes to find references to subprograms. The following

[Ada] Finalization for b-i-p that raises exception

2017-09-07 Thread Arnaud Charlet
This patch fixes a bug where if a limited object is initialized with a build-in-place function call, and the call does not return on the secondary stack, and the function raises an exception, so that the object is not (successfully) created, the uninitialized object is incorrectly finalized. The

[Ada] Improved error message on malformed null procedure with aspect

2017-09-07 Thread Arnaud Charlet
This patch improve the error reporting on a null procedure with misplaced aspect specification, which the parser first attempts to interpret as a malformed expression function, in spite of the initial keyword in the declaration. Compiling --- package Null_Proc_With_Contract is

Re: [PATCH] Enhance PHI processing in VN

2017-09-07 Thread Richard Biener
On Thu, 7 Sep 2017, Richard Biener wrote: > > This enhances VN to do the same PHI handling as CCP, meeting > undefined and constant to constant. I've gone a little bit > further (and maybe will revisit this again) in also meeting > all-undefined to undefined taking one of the undefined args >

[PATCH] Enhance PHI processing in VN

2017-09-07 Thread Richard Biener
This enhances VN to do the same PHI handling as CCP, meeting undefined and constant to constant. I've gone a little bit further (and maybe will revisit this again) in also meeting all-undefined to undefined taking one of the undefined args as the value number. I feel like this might run into

[PATCH] Fix atomic builtins on arrays (PR target/82112)

2017-09-07 Thread Jakub Jelinek
Hi! The powerpc patch I've just posted led me to try __atomic_* builtins on arrays as in the testcase below. While it works fine if the array is just on the first argument or in C, in C++ for arrays in 2nd or 3rd argument the atomics are rejected (complaining that the argument is not a pointer),

[PATCH] Fix powerpc ICE with __builtin_vec_ld on an array (PR target/82112)

2017-09-07 Thread Jakub Jelinek
Hi! The C and C++ FE handle resolve_overloaded_builtin differently, the C FE calls it when e.g. array-to-pointer and function-to-pointer conversions are already done on the arguments, while C++ FE does that only much later. The c-common code e.g. for __sync/__atomic builtins deals with that e.g.

Re: RFC: Representation of runtime offsets and sizes

2017-09-07 Thread Richard Biener
On Wed, Sep 6, 2017 at 10:18 PM, Richard Sandiford wrote: > The next main step in the SVE submission is to add support for > offsets and sizes that are a runtime invariant rather than a compile > time constant. This is an RFC about our approach for doing that. >

[PATCH] VN TLC, fix default-def handling

2017-09-07 Thread Richard Biener
This fixed default-def handling in VN. We can't really make those VN_TOP as VN_TOP means unvisited rather than uninitialized. When keeping things VN_TOP if unintialized we run into issues like value-numbering a PHI without undefs equal to a PHI with undefs and replacing the well-defined one

Re: [committed] Fix libsanitizer build against recent glibc (PR sanitizer/81066)

2017-09-07 Thread Richard Biener
On Thu, Sep 7, 2017 at 9:08 AM, Matthias Klose wrote: > On 14.07.2017 11:14, Jakub Jelinek wrote: >> Hi! >> >> glibc recently changed a couple of headers. One change was >> that typedef struct sigaltstack { ... } stack_t; is now >> typedef struct { ... } stack_t; >> and the

Re: [patch] [5] fix asan build failure with glibc-2.26

2017-09-07 Thread Richard Biener
On Thu, Sep 7, 2017 at 9:05 AM, Matthias Klose wrote: > Fix asan build failure with glibc-2.26, not finding the SIGSEGV define. > Solved > by explicitly including the signal.h header. Ok for the gcc-5 branch? Ok. Richard. > Matthias > > PS: libsanitizer still needs the

Re: [patch] [5/6] fix libjava build failure with glibc-2.26

2017-09-07 Thread Richard Biener
On Thu, Sep 7, 2017 at 9:01 AM, Matthias Klose wrote: > Fix libjava build failure with glibc-2.26, replacing 'struct ucontext' with > ucontext_t. Ok for the gcc-5 and gcc-6 branches? Doesn't apply to 7 and > trunk, > because libjava is removed. Ok. Richard. > Matthias > >

Re: [committed] Fix libsanitizer build against recent glibc (PR sanitizer/81066)

2017-09-07 Thread Matthias Klose
On 14.07.2017 11:14, Jakub Jelinek wrote: > Hi! > > glibc recently changed a couple of headers. One change was > that typedef struct sigaltstack { ... } stack_t; is now > typedef struct { ... } stack_t; > and the other change is that resolv.h now ignores the former (private glibc > macro)

[patch] [5] fix asan build failure with glibc-2.26

2017-09-07 Thread Matthias Klose
Fix asan build failure with glibc-2.26, not finding the SIGSEGV define. Solved by explicitly including the signal.h header. Ok for the gcc-5 branch? Matthias PS: libsanitizer still needs the backport for PR 81066 * asan/asan_linux.cc: Include ---

Re: Add support to trace comparison instructions and switch statements

2017-09-07 Thread 吴潍浠(此彼)
Hi The trace-div and trace-gep options seems be used to evaluate corpus to trigger specific kind of bugs. And they don't have strong effect to coverage. The trace-pc-guard is useful, but it may be much more complex than trace-pc. I think the best benefit of trace-pc-guard is avoiding dealing

[patch] [5/6] fix libjava build failure with glibc-2.26

2017-09-07 Thread Matthias Klose
Fix libjava build failure with glibc-2.26, replacing 'struct ucontext' with ucontext_t. Ok for the gcc-5 and gcc-6 branches? Doesn't apply to 7 and trunk, because libjava is removed. Matthias * include/x86_64-signal.h (HANDLE_DIVIDE_OVERFLOW): Replace 'struct ucontext' with

[C++, ping] Fix PR bootstrap/81926

2017-09-07 Thread Eric Botcazou
The analysis and original patch: https://gcc.gnu.org/ml/gcc-patches/2017-09/msg00101.html and the amended patch: https://gcc.gnu.org/ml/gcc-patches/2017-09/msg00146.html Thanks in advance. -- Eric Botcazou