Enhance __gnu_debug::string debug assertion

2018-07-04 Thread François Dumont
    This patch improves the assertion message generated in 2 __gnu_debug::string constructors giving the assertion context thanks to the __FUNCTION__ macro. Was: /home/fdt/dev/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/debug/string:56: const _CharT* __gnu_debug::__check_string(const

[PATCH] Enable decimal float on x86_64 kFreeBSD and Hurd

2018-07-04 Thread James Clarke
config/ * dfp.m4 (enable_decimal_float): Enable for x86_64*-*-gnu* to catch x86_64 kFreeBSD and Hurd. gcc/ * configure: Regenerate. libdecnumber/ * configure: Regenerate. libgcc/ * configure: Regenerate. --- config/dfp.m4 | 2 +- gcc/configure

[PATCH] use TYPE_SIZE instead of TYPE_DOMAIN to compute array size (PR 86400)

2018-07-04 Thread Martin Sebor
A change of mine to the strlen pass assumes that the strlen argument points to an object of the correct type and does not correctly handle GIMPLE where the argument has the wrong type such as in: extern char a[1][2]; n = strlen (*a); where the strlen pass actually sees n = strlen (a);

[PATCH v2] Enable decimal float on x86_64 kFreeBSD and Hurd

2018-07-04 Thread James Clarke
config/ * dfp.m4 (enable_decimal_float): Enable for x86_64*-*-gnu* to catch x86_64 kFreeBSD and Hurd. gcc/ * configure: Regenerate. libdecnumber/ * configure: Regenerate. libgcc/ * configure: Regenerate. --- Hi, Apologies; I accidentally sent an older

[PR 86371] Remove spurious $HOME include from BRIG FE Makefile

2018-07-04 Thread Martin Jambor
Hi, a spurious include directory from $HOME slipped into a BRIG FE Makefile. I've bootstrapped and tested the following fix, which I am going to commit in a few moments. Martin 2018-07-04 Martin Jambor PR hsa/86371 * Make-lang.in (BRIGINCLUDES): Remove erroneous include

[PATCH] Fix _Pragma GCC diagnostic in macro expansions

2018-07-04 Thread Bernd Edlinger
Hi, currently _Pragma("GCC diagnostic ...") does not properly work in macro expansions. Consider the following code: #define B _Pragma("GCC diagnostic push") \ _Pragma("GCC diagnostic ignored \"-Wattributes\"") #define E _Pragma("GCC diagnostic pop") #define X() B int

Re: [testsuite/guality, committed] Prevent optimization of local in vla-1.c

2018-07-04 Thread Tom de Vries
On 07/03/2018 11:05 AM, Tom de Vries wrote: > On 07/02/2018 10:16 AM, Jakub Jelinek wrote: >> On Mon, Jul 02, 2018 at 09:44:04AM +0200, Richard Biener wrote: >>> Given the array has size i + 1 it's upper bound should be 'i' and 'i' >>> should be available via DW_OP_[GNU_]entry_value. >>> >>> I see

Fix old thinko in choose_multiplier

2018-07-04 Thread Eric Botcazou
As spotted by the reporter of the bug, there is a small thinko at the end of choose_multiplier whereby the (N + 1)th bit of the result is set when the computed value is exactly 2**N. But it turns out that this case can never actually happen given how the function is invoked in the compiler.

[PATCH] Fix PR84829

2018-07-04 Thread Richard Biener
The following removes adding -lieee to the link command when -mieee-fp is specified for GNU targets as suggested by Joseph in the PR. It doesn't touch m32r so the fix may be incomplete depending on the C library used. I've added a testcase that makes sure we can link but not functional tests

Re: [PATCH] P0556R3 Integral power-of-2 operations, P0553R2 Bit operations

2018-07-04 Thread Jonathan Wakely
On 04/07/18 10:09 +0200, Jakub Jelinek wrote: On Tue, Jul 03, 2018 at 11:24:00PM +0100, Jonathan Wakely wrote: > Wouldn't it be better to use some branchless pattern that > GCC can also optimize well, like: > return (__x << __sN) | (__x >> ((-_sN) & (_Nd - 1))); > (iff _Nd is always power

Re: [14/n] PR85694: Rework overwidening detection

2018-07-04 Thread Richard Sandiford
Christophe Lyon writes: > On Tue, 3 Jul 2018 at 12:02, Richard Sandiford > wrote: >> >> Richard Biener writes: >> > On Fri, Jun 29, 2018 at 1:36 PM Richard Sandiford >> > wrote: >> >> >> >> Richard Sandiford writes: >> >> > This patch is the main part of PR85694. The aim is to recognise > at

Re: extract_range_from_binary* cleanups for VRP

2018-07-04 Thread Martin Liška
On 07/03/2018 07:48 PM, Aldy Hernandez wrote: > > > On 07/03/2018 08:16 AM, Martin Liška wrote: >> Hi. >> >> It caused UBSAN errors: >> >> $ cat ubsan.i >> int a; >> void d() { int c, b = 8 - a; } >> >> $ /home/marxin/Programming/gcc2/objdir/./gcc/xgcc >>

Re: [PATCH] Fix bootstrap on ia64 with old GCC version.

2018-07-04 Thread Martin Liška
On 07/03/2018 07:32 PM, Jakub Jelinek wrote: > On Tue, Jul 03, 2018 at 07:22:19PM +0200, Martin Liška wrote: >> In order to make GCC 4.1 happy and build current tip, we need to define >> static constants out of a class definition. >> >> Ready for trunk? >> Thanks, >> Martin >> >> gcc/ChangeLog: >>

Re: [patch, fortran] Asynchronous I/O, take 3

2018-07-04 Thread Rainer Orth
Hi Thomas, > Ah, I see what was wrong. > > The attached patch should fix this. it almost did the trick indeed. With the new patch, only two failures remain: FAIL: gfortran.dg/flush_1.f90 -O0 execution test FAIL: gfortran.dg/flush_1.f90 -O1 execution test FAIL: gfortran.dg/flush_1.f90

Re: [PATCH] relax lower bound for infinite arguments in gimple-ssa-sprinf.c (PR 86274)

2018-07-04 Thread Richard Biener
On Tue, 3 Jul 2018, Martin Sebor wrote: > Committed to trunk in r86274. Jakub/Richard, can you please > also review and approve the corresponding fix for the release > branches? If it is a regression and the patch was approved for trunk it is automatically OK for release branches without

Re: [PATCH] P0556R3 Integral power-of-2 operations, P0553R2 Bit operations

2018-07-04 Thread Jonathan Wakely
On 03/07/18 23:23 +0100, Jonathan Wakely wrote: On 03/07/18 23:40 +0200, Jakub Jelinek wrote: On Tue, Jul 03, 2018 at 10:02:47PM +0100, Jonathan Wakely wrote: +#ifndef _GLIBCXX_BIT +#define _GLIBCXX_BIT 1 + +#pragma GCC system_header + +#if __cplusplus >= 201402L + +#include +#include +

Re: [PATCH] P0556R3 Integral power-of-2 operations, P0553R2 Bit operations

2018-07-04 Thread Jakub Jelinek
On Tue, Jul 03, 2018 at 11:24:00PM +0100, Jonathan Wakely wrote: > > Wouldn't it be better to use some branchless pattern that > > GCC can also optimize well, like: > > return (__x << __sN) | (__x >> ((-_sN) & (_Nd - 1))); > > (iff _Nd is always power of two), > > _Nd is 20 for one of the

Re: [patch] jump threading multiple paths that start from the same BB

2018-07-04 Thread Aldy Hernandez
On 07/03/2018 08:16 PM, Jeff Law wrote: On 07/03/2018 03:31 AM, Aldy Hernandez wrote: On 07/02/2018 07:08 AM, Christophe Lyon wrote: On 11/07/2017 10:33 AM, Aldy Hernandez wrote: While poking around in the backwards threader I noticed that we bail if we have already seen a starting BB.

Re: [PATCH] P0556R3 Integral power-of-2 operations, P0553R2 Bit operations

2018-07-04 Thread Jakub Jelinek
On Wed, Jul 04, 2018 at 09:14:04AM +0100, Jonathan Wakely wrote: > > Unfortunately it is not correct if _Nd is not power of two. > > E.g. for __sN 1, -1U % 20 is 15, not 19. > > So it would need to be > > return (__x << __sN) | (__x >> ((_Nd - __sN) % _Nd)); > > Unfortunately, our rotate

Re: [PATCH 18/n, 386]: Fix PR85694, Generation of vectorized AVG (Average) instruction

2018-07-04 Thread Uros Bizjak
On Tue, Jul 3, 2018 at 7:38 PM, Uros Bizjak wrote: > Hello! > > Attached patch implements unsigned HImode and QImode vector average > instructions. This is all x86 has to offer... FYI, I have tried the effectiveness of patched gcc with SPEC CPU2006 464.h264 (actually, jm19.0.zip source from

Re: extract_range_from_binary* cleanups for VRP

2018-07-04 Thread Richard Biener
On Tue, Jul 3, 2018 at 7:49 PM Aldy Hernandez wrote: > > > > On 07/03/2018 08:16 AM, Martin Liška wrote: > > Hi. > > > > It caused UBSAN errors: > > > > $ cat ubsan.i > > int a; > > void d() { int c, b = 8 - a; } > > > > $ /home/marxin/Programming/gcc2/objdir/./gcc/xgcc > >

[PATCH] PR libstdc++/86398 fix std::is_trivially_constructible regression

2018-07-04 Thread Jonathan Wakely
The intrinsic doesn't check for allowed conversions between scalar types, so restore the std::is_constructible check. Also make some trivial whitespace changes. PR libstdc++/86398 * include/std/type_traits (is_trivially_constructible): Check is_constructible before

Re: [patch] jump threading multiple paths that start from the same BB

2018-07-04 Thread Richard Biener
On Wed, Jul 4, 2018 at 10:12 AM Aldy Hernandez wrote: > > > > On 07/03/2018 08:16 PM, Jeff Law wrote: > > On 07/03/2018 03:31 AM, Aldy Hernandez wrote: > >> On 07/02/2018 07:08 AM, Christophe Lyon wrote: > >> > > On 11/07/2017 10:33 AM, Aldy Hernandez wrote: > >> While poking around in

[C++ PATCH] PR c++/86398

2018-07-04 Thread Ville Voutilainen
This has been buggy for a while, but since we were implementing the library triviality traits in terms of just the intrinsic since GCC 8, not too many users ran into it. The bug has been worked around in the library, but I'd rather have the intrinsic give the right answer and not require the

Re: [PATCH] relax lower bound for infinite arguments in gimple-ssa-sprinf.c (PR 86274)

2018-07-04 Thread Christophe Lyon
Hi, On Wed, 4 Jul 2018 at 09:26, Richard Biener wrote: > > On Tue, 3 Jul 2018, Martin Sebor wrote: > > > Committed to trunk in r86274. Jakub/Richard, can you please > > also review and approve the corresponding fix for the release > > branches? > > If it is a regression and the patch was

Re: [PATCH] P0556R3 Integral power-of-2 operations, P0553R2 Bit operations

2018-07-04 Thread Jonathan Wakely
On 04/07/18 10:26 +0200, Jakub Jelinek wrote: On Wed, Jul 04, 2018 at 09:14:04AM +0100, Jonathan Wakely wrote: > Unfortunately it is not correct if _Nd is not power of two. > E.g. for __sN 1, -1U % 20 is 15, not 19. > So it would need to be > return (__x << __sN) | (__x >> ((_Nd - __sN) %

[patch, committed, fortran] PR82009 [F08] ICE with block construct

2018-07-04 Thread Jerry DeLisle
This patch committed as obvious after regression testing and auditing the code. New test case added. Author: jvdelisle Date: Wed Jul 4 18:08:16 2018 New Revision: 262416 URL: https://gcc.gnu.org/viewcvs?rev=262416=gcc=rev Log: 2018-07-04 Jerry DeLisle PR fortran/82009 *

[PATCH] P0458R2 Checking for Existence of an Element in Associative Containers

2018-07-04 Thread Jonathan Wakely
* include/bits/stl_map.h (map::contains): Add for C++2a. * include/bits/stl_multimap.h (multimap::contains): Likewise. * include/bits/stl_multiset.h (multiset::contains): Likewise. * include/bits/stl_set.h (set::contains): Likewise. *

Re: [patch, committed, fortran] PR82009 [F08] ICE with block construct

2018-07-04 Thread Paul Richard Thomas
Thanks, Jerry. On Wed, 4 Jul 2018 at 19:14, Jerry DeLisle wrote: > > This patch committed as obvious after regression testing and auditing > the code. New test case added. > > Author: jvdelisle > Date: Wed Jul 4 18:08:16 2018 > New Revision: 262416 > > URL:

Re: [C++ PATCH] PR c++/86398

2018-07-04 Thread Jason Merrill
Ok. On Wed, Jul 4, 2018, 11:52 AM Ville Voutilainen wrote: > This has been buggy for a while, but since we were implementing > the library triviality traits in terms of just the intrinsic since GCC 8, > not too many users ran into it. The bug has been worked around > in the library, but I'd

Re: Extend tree code folds to IFN_COND_*

2018-07-04 Thread Richard Sandiford
Finally getting back to this... Richard Biener writes: > On Wed, Jun 6, 2018 at 10:16 PM Richard Sandiford > wrote: >> >> > On Thu, May 24, 2018 at 11:36 AM Richard Sandiford >> > wrote: >> >> >> >> This patch adds match.pd support for applying normal folds to their >> >> IFN_COND_* forms.

Re: [PATCH] relax lower bound for infinite arguments in gimple-ssa-sprinf.c (PR 86274)

2018-07-04 Thread Martin Sebor
On 07/04/2018 08:04 AM, Christophe Lyon wrote: Hi, On Wed, 4 Jul 2018 at 09:26, Richard Biener wrote: On Tue, 3 Jul 2018, Martin Sebor wrote: Committed to trunk in r86274. Jakub/Richard, can you please also review and approve the corresponding fix for the release branches? If it is a

Re: [RFC, testsuite/guality] Use relative line numbers in gdb-test

2018-07-04 Thread Richard Sandiford
Tom de Vries writes: > [ was: [PATCH, testsuite/guality] Use line number vars in gdb-test ] > On Thu, Jun 28, 2018 at 07:49:30PM +0200, Tom de Vries wrote: >> Hi, >> >> I played around with pr45882.c and ran into FAILs. It took me a while to >> realize that the FAILs where due to the gdb-test

Re: [PATCH][PR sanitizer/84250] Avoid global symbols collision when using both ASan and UBSan

2018-07-04 Thread Maxim Ostapenko
Hi Jeff, On 07/04/2018 05:45 AM, Jeff Law wrote: > On 05/23/2018 11:15 AM, Maxim Ostapenko wrote: >> Hi, >> >> >> as described in PR, when using both ASan and UBSan >> (-fsanitize=address,undefined ), we have symbols collision for global >> functions, like __sanitizer_set_report_path. This leads

Re: [PATCH] Add experimental::sample and experimental::shuffle from N4531

2018-07-04 Thread Jonathan Wakely
On 29/06/18 10:45 +0100, Jonathan Wakely wrote: On 29/06/18 09:39 +0200, Christophe Lyon wrote: On Fri, 29 Jun 2018 at 09:21, Jonathan Wakely wrote: On 29/06/18 08:55 +0200, Christophe Lyon wrote: On Mon, 25 Jun 2018 at 18:23, Jonathan Wakely wrote: The additions to were added in 2015

Re: [RFC PATCH] diagnose built-in declarations without prototype (PR 83656)

2018-07-04 Thread Martin Sebor
On 07/03/2018 08:33 PM, Jeff Law wrote: On 06/29/2018 09:54 AM, Martin Sebor wrote: All the warnings I have seen are because of declarations like the one in the test below that checks for the presence of symbol sin in the library: char sin (); int main () { return sin (); } GCC has

[PATCH] P0646R1 Improving the Return Value of Erase-Like Algorithms I

2018-07-04 Thread Jonathan Wakely
In C++2a the remove, remove_if and unique members of std::list and std::forward_list have been changed to return the number of elements removed. This is an ABI change for the remove members and the non-template unique members, so an abi-tag is used to give those symbols new mangled names in C++2a

[wwwdocs] Document more C++2a support in libstdc++

2018-07-04 Thread Jonathan Wakely
Committed to CVS. ? htdocs/gcc-9/.changes.html.swp Index: htdocs/gcc-9/changes.html === RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-9/changes.html,v retrieving revision 1.10 diff -u -r1.10 changes.html --- htdocs/gcc-9/changes.html 2 Jul

Re: [wwwdocs] Document more C++2a support in libstdc++

2018-07-04 Thread Tim Song
On Wed, Jul 4, 2018 at 4:17 PM, Jonathan Wakely wrote: > + std::is_trivially_convertible, and s/trivially/nothrow/

Re: [wwwdocs] Document more C++2a support in libstdc++

2018-07-04 Thread Jonathan Wakely
On 04/07/18 16:19 -0400, Tim Song wrote: On Wed, Jul 4, 2018 at 4:17 PM, Jonathan Wakely wrote: + std::is_trivially_convertible, and s/trivially/nothrow/ Oops, thanks - fixed by this patch, also committed. Index: htdocs/gcc-9/changes.html