Re: [PATCH] Fix inline memcpy ICE (PR tree-optimization/86526)

2018-07-17 Thread Richard Biener
On Mon, 16 Jul 2018, Jakub Jelinek wrote: > Hi! > > builtin_memcpy_read_str is a function meant to be called just as a callback > and verifies that we don't cross a '\0' boundary in the string. For > inline_string_cmp, we've checked that the length returned from c_getstr > is fine, so we can cro

Re: [Patch, Fortran] PR 85599: warn about short-circuiting of logical expressions for non-pure functions

2018-07-17 Thread Janus Weil
> 2018-07-16 21:50 GMT+02:00 Thomas Koenig : >> What I would suggest is to enable -Wfunction-eliminiation with >> -Wextra and also use that for your new warning. > > Thanks for the comments. Makes sense. Updated patch attached. Huh, after actually trying -Wfunction-elimination, I'm not so sure an

[committed] Fix OpenMP taskloop handling of reference temporaries (PR middle-end/86539)

2018-07-17 Thread Jakub Jelinek
Hi! The FE guarantees that the iterator type the middle-end sees is either some integral type, or pointer type. For taskloop, we need to pass around (firstprivatize) the b and lb expressions if they aren't simple constants, but unfortunately for the middle-end reference vs. pointer type differenc

[Ada] Fix Next_Actual when used on calls "inlined for proof"

2018-07-17 Thread Pierre-Marie de Rodat
The GNATprove backend needs to apply antialiasing checks to subprogram calls that have been rewritten into null statements while "inlining for proof". This requires the First_Actual/Next_Actual to use the Original_Node and not the N_Null_Statement that rewriting leaves as a parent. Only effective

[Ada] Add elaboration-related switches to GNAT UGN

2018-07-17 Thread Pierre-Marie de Rodat
This patch adds compiler switches -gnatH and -gnatJ to section "Alphabetical list of all switches" of the GNAT User Guide for Native. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-07-17 Hristian Kirtchev gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Add

[Ada] Secondary stack leak in loop iterator

2018-07-17 Thread Pierre-Marie de Rodat
When the evaluation of the loop iterator invokes a function whose result relies on the secondary stack the compiler does not generate code to release the consumed memory as soon as the loop terminates. After this patch the following test works fine. with Text_IO; use Text_IO; pragma Warnings (Off

[Ada] Attach the special GNATprove HEAP entity to the Standard package

2018-07-17 Thread Pierre-Marie de Rodat
In GNATprove mode we use frontend cross-references to synthesize the Global contract of subprograms with SPARK_Mode => Off and represent a read/write via a pointer as a read/write of a special entity called HEAP. This entity is now attached to the Standard package, so that we can safely check the E

[Ada] Crash on case expression in build-in-place function

2018-07-17 Thread Pierre-Marie de Rodat
This patch modifies the recursive tree replication routine New_Copy_Tree to create new entities and remap old entities to the new ones for constructs in N_Expression_With_Actions nodes when requested by a caller. This in turn allows the build-in-place mechanism to avoid sharing entities between the

[Ada] New ignored Ghost code removal mechanism

2018-07-17 Thread Pierre-Marie de Rodat
This patch reimplements the mechanism which removes ignored Ghost code from the tree. The previous mechanism proved to be unreliable because it assumed that no new scoping constructs would be created after some ignored Ghost code had already notified its enclosing scoping constructs that they cont

[Ada] Spurious error on unused Part_Of constituent

2018-07-17 Thread Pierre-Marie de Rodat
This patch updates the analysis of indicator Part_Of (or the lack thereof), to ignore generic formal parameters for purposes of determining the visible state space because they are not visible outside the generic and related instances. -- Source -- -- gen_pack.ads gene

[PATCH] Fix PR86456

2018-07-17 Thread Richard Biener
This cures the ICEs and wrong assembler that currently happen when using -flto with -gdwarf-5. gdb is also happy with small test programs but readelf is still complaining (see PR, I have no clue what goes wrong). Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. LTO bootstrap with

[Ada] Secondary stack leak in statements block located in a loop

2018-07-17 Thread Pierre-Marie de Rodat
When a loop iterator has a block declaration containing statements that invoke functions whose result is returned on the secondary stack (such as a string-returning function), the compiler fails to generate code to release the allocated memory when the loop terminates. After this patch the followi

[Ada] Spurious error on Part_Of indicator

2018-07-17 Thread Pierre-Marie de Rodat
This patch modifies the verification of a missing Part_Of indicator to avoid considering constants as visible state of a package instantiation because the compiler cannot determine whether their values depend on variable input. This diagnostic is left to GNATprove. -- Source -- --

[Ada] Avoid confusing warning on exception propagation in GNATprove mode

2018-07-17 Thread Pierre-Marie de Rodat
When compiling with the restriction No_Exception_Propagation, GNAT compiler may issue a warning about exceptions not being propagated. This warning is useless and confusing to users for GNATprove analysis, as GNATprove precisely detects possible exceptions, so disable the warning in that mode. Tes

[Ada] Crash processing abstract state aspect of a package

2018-07-17 Thread Pierre-Marie de Rodat
The compiler may crash processing an aspect Part_Of used in a package spec which has also an Initial_Condition aspect. After this patch the following test compiles fine. package P with SPARK_Mode => On, Abstract_State => (Count_State), Initial_Condition => (Get_Count = 0) -- Tes

[Ada] Missing check on illegal equality operation in subprogram

2018-07-17 Thread Pierre-Marie de Rodat
In Ada2012 it is illegal to declare an equality operation on an untagged type when the operation is primitive and the type is already frozem (see RM 4.5.2 (9.8)). previously the test to detect this illegality only examined declarations within a package. This patch covers the case where type and ope

[Ada] Argument_String_To_List creates empty items from whitespace

2018-07-17 Thread Pierre-Marie de Rodat
This patch corrects an issue whereby leading whitespace in a non-quoted argument list passed to Argument_String_To_List caused extraneous empty arguments to be returned. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-07-17 Justin Squirek gcc/ada/ * libgnat/s-os_lib.adb (Argum

[Ada] Minor fix for imported C++ constructors

2018-07-17 Thread Pierre-Marie de Rodat
C++ constructors are imported as functions and then internally rewritten into procedures taking the "this" pointer as first parameter. Now this parameter is not of an access type but of the type directly, so it must be In/Out and not just In. Tested on x86_64-pc-linux-gnu, committed on trunk 201

[Ada] Assertion_Policy for class-wide precondition

2018-07-17 Thread Pierre-Marie de Rodat
This patch fixes the compiler to that class-wide preconditions on primitive operations of interfaces are not checked at run time when the Assertion_Policy indicates that they should be ignored. This is required by the RM. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-07-17 Bob Duff g

[Ada] Configuration state not observed for instance bodies

2018-07-17 Thread Pierre-Marie de Rodat
This patch ensures that the processing of instantiated and inlined bodies uses the proper configuration context available at the point of the instantiation or inlining. Previously configuration pragmas which appear prior to the context items of a unit would lose their effect when a body is instant

[Ada] Use standard version of s-memory.adb for mingw32

2018-07-17 Thread Pierre-Marie de Rodat
This patch switches mingw32 targets to use the standard version of s-memory.adb as Windows now has the capability of limiting the amount of memory used by process. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-07-17 Patrick Bernardi gcc/ada/ * libgnat/s-memory__mingw.adb: Re

[Ada] Faulty ignored Ghost code removal

2018-07-17 Thread Pierre-Marie de Rodat
This patch ensures that removal of ignored Ghost code is the absolute last operation performed on the tree. Previously the removal was performed prior to issuing delayed warnings, however the warning mechanism may see a heavily modified tree and fail. No small reproducer available. Tested on x86_

[Ada] Fix incompatibility Default_Scalar_Storage_Order/tagged types

2018-07-17 Thread Pierre-Marie de Rodat
The pragma Default_Scalar_Storage_Order cannot reliably be used to set the non-default scalar storage order for a program that declares tagged types, if it also declares user-defined primitives. This is fixed by making Make_Tags use the same base array type as Make_DT and Make_Secondary_DT when ac

[Ada] Spurious error on prefixed call in an instantiation

2018-07-17 Thread Pierre-Marie de Rodat
This patch fixes a spurious error on a prefixed call in an instance, when the generic parameters include an interface type and an abstract operation of that type, and the actuals in the instance include an interface type and a corresponding abstract operation of it, with a different name than the c

Re: [PR fortran/83184] Fix matching code for clist/old-style initializers when encountering assumed-rank declarations

2018-07-17 Thread Janus Weil
Did someone actually approve this patch? Apparently it was committed as r262744 and caused the following regression: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86543 Cheers, Janus 2018-06-27 23:07 GMT+02:00 Fritz Reese : > The attached patch fixes PR fortran/83184, which is actually two > di

Re: [PATCH] Fix PR86523

2018-07-17 Thread Rainer Orth
Hi Richard, > The following fixes PR86523, we failed to assing DIE parents to some > function-local entities with the idea scope vars would pick them up > but that's not true for some of them. > > Bootstrapped and tested on x86_64-unknown-linux-gnu, LTO bootstrapped > on the GCC 8 branch (it's sai

Re: [PATCH] Fix PR86523

2018-07-17 Thread Richard Biener
On Tue, 17 Jul 2018, Rainer Orth wrote: > Hi Richard, > > > The following fixes PR86523, we failed to assing DIE parents to some > > function-local entities with the idea scope vars would pick them up > > but that's not true for some of them. > > > > Bootstrapped and tested on x86_64-unknown-linu

Re: [PATCH][debug] Fix pre_dec handling in vartrack

2018-07-17 Thread Rainer Orth
Hi Jakub, > On Mon, Jul 16, 2018 at 09:24:10AM +0200, Jakub Jelinek wrote: >> On Sun, Jul 15, 2018 at 11:21:56PM +0200, Tom de Vries wrote: >> > 2018-07-15 Tom de Vries >> > >> >* var-tracking.c (vt_initialize): Fix pre_dec handling. Print adjusted >> >insn slim if dump_flags request

Re: [PATCH][debug] Fix pre_dec handling in vartrack

2018-07-17 Thread Jakub Jelinek
On Tue, Jul 17, 2018 at 11:17:33AM +0200, Rainer Orth wrote: > it turns out the test FAILs on i386-pc-soalris2.11 with -m64: the dump > doesn't even contain argp: However, adding -fomit-frame-pointer makes > it work, and still PASSes on x86_64-pc-linux-gnu. > > Ok for for mainline? Ok, thanks.

Re: [PATCH 1/4] Clean up of new format of -falign-FOO.

2018-07-17 Thread Martin Liška
On 07/16/2018 11:24 PM, Jeff Law wrote: > All 4 patches in this kit are fine after you fix the minor issue Pat > reported with patch #1 on ppc. > > Jeff Thank you Jeff for the trust. I fixed the minor issue and installed the patch set. Martin

Re: [PATCH] Make function clone name numbering independent.

2018-07-17 Thread Richard Biener
On Tue, Jul 17, 2018 at 8:10 AM Bernhard Reutner-Fischer wrote: > > On 16 July 2018 21:38:36 CEST, Michael Ploujnikov > wrote: > >Hi, > > > > >+clone_fn_ids = hash_map::create_ggc > >(1000); > > Isn't 1000 a bit excessive? What about 64 or thereabouts? I'm not sure we should throw memory at

[Ada] Fix spurious check failure for Character discriminant

2018-07-17 Thread Eric Botcazou
This is a regression present on the mainline, 8 and 7 branches. The compiler generates a spurious check failure for a Character discriminant declared in a discriminated record type with variant part if one of the variants is selected by a range of values which contains at least the values at po

[PATCH] S/390: Add CFI for mcount call sequences

2018-07-17 Thread Ilya Leoshkevich
Fixes unwind for mcount. 2018-07-17 Ilya Leoshkevich * config/s390/s390.c (s390_function_profiler): Generate CFI. --- gcc/config/s390/s390.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c

[committed] Fix OpenMP taskloop lowering (PR middle-end/86542)

2018-07-17 Thread Jakub Jelinek
Hi! Another bug I've ran into while working on OpenMP 5.0 range for support. For collapse(2) and higher taskloops, if there is any clause that needs a cpyfn callback (e.g. firstprivate with non-POD, or VLA), we wouldn't be copying over the temporaries needed for collapsed loop; without cpyfn the

Re: [PATCH, ARM] PR85434: Prevent spilling of stack protector guard's address on ARM

2018-07-17 Thread Thomas Preudhomme
Fixed in attached patch. ChangeLog entries are unchanged: *** gcc/ChangeLog *** 2018-07-05 Thomas Preud'homme PR target/85434 * target-insns.def (stack_protect_combined_set): Define new standard pattern name. (stack_protect_combined_test): Likewise. * cfgexpand.c (stack_pr

Re: Avoid assembler warnings from AArch64 constructor/destructor priorities

2018-07-17 Thread Kyrill Tkachov
On 02/02/18 15:14, Kyrill Tkachov wrote: On 01/02/18 17:26, Joseph Myers wrote: On Thu, 1 Feb 2018, Kyrill Tkachov wrote: Hi Joseph, aarch64 maintainers, On 28/09/17 13:31, Joseph Myers wrote: Many GCC tests fail for AArch64 with current binutils because of assembler warnings of the form

[C++ Patch] Another permerror related tweak

2018-07-17 Thread Paolo Carlini
Hi again, here I noticed a pair of consecutive permerrors (instead of permerror + inform) and also that the first one isn't exploiting DECL_SOURCE_LOCATION (which makes a real difference at least in a couple of cases which I'm explicitly testing below). Tested x86_64-linux. Thanks, Paolo. /

Re: Avoid assembler warnings from AArch64 constructor/destructor priorities

2018-07-17 Thread Richard Earnshaw (lists)
On 28/09/17 13:31, Joseph Myers wrote: > Many GCC tests fail for AArch64 with current binutils because of > assembler warnings of the form "Warning: ignoring incorrect section > type for .init_array.00100". The same issue was fixed for ARM in > r247015 by using SECTION_NOTYPE when creating those s

Re: Avoid assembler warnings from AArch64 constructor/destructor priorities

2018-07-17 Thread Richard Earnshaw (lists)
On 17/07/18 12:09, Kyrill Tkachov wrote: > > On 02/02/18 15:14, Kyrill Tkachov wrote: >> >> On 01/02/18 17:26, Joseph Myers wrote: >>> On Thu, 1 Feb 2018, Kyrill  Tkachov wrote: >>> Hi Joseph, aarch64 maintainers, On 28/09/17 13:31, Joseph Myers wrote: > Many GCC tests fail for

[PATCH][COMMITTED][ARC] Don't use deprecated align_labels_log variable.

2018-07-17 Thread Claudiu Zissulescu
From: claziss Use new align_lables struct instead of the deprecated align_labels_log variable. Committed as obvious. 2018-07-17 Claudiu Zissulescu * config/arc/arc.c (arc_label_align): Use align_labels instead of deprecated align_labels_log. git-svn-id: svn+ssh://gcc.gnu.or

[PATCH][C++] Fix PR86523

2018-07-17 Thread Richard Biener
The following makes sure to generate early debug for globals that end up being pushed to the backend via the write_out_vars call in c_parse_final_cleanups. rest_of_decl_compilation is confused by seeing current_function_decl set and skips the debug-hook invocation because of that. So the easy f

[PATCH][Fortran] Use MIN/MAX_EXPR for intrinsics or __builtin_fmin/max when appropriate

2018-07-17 Thread Kyrill Tkachov
Hi all, This is my first Fortran patch, so apologies if I'm missing something. The current expansion of the min and max intrinsics explicitly expands the comparisons between each argument to calculate the global min/max. Some targets, like aarch64, have instructions that can calculate the min/max

[PATCH] Remove unused explicit instantiation of __bind_simple

2018-07-17 Thread Jonathan Wakely
The explicit instantiation of std::call_once used to require an instantiation of __bind_simple, but call_once was changed by r241031 to not use __bind_simple. The instantiation of __bind_simple (and the definitions it uses) are not needed. They should have been removed instead of doing the changes

[PATCH] PR libstdc++/86450 use -Wabi=2 and simplify -Werror use

2018-07-17 Thread Jonathan Wakely
Use -Wabi=2 to fix warnings about -Wabi having no effect on its own. This requires suppressing two warnings in src/c++11/debug.cc which do not affect the library ABI. Previously libstdc++ defaulted to --enable-werror but the -Werror flag was not actually added unless --enable-maintainer-mode was

Re: [PATCH][Fortran] Use MIN/MAX_EXPR for intrinsics or __builtin_fmin/max when appropriate

2018-07-17 Thread Richard Biener
On Tue, Jul 17, 2018 at 2:35 PM Kyrill Tkachov wrote: > > Hi all, > > This is my first Fortran patch, so apologies if I'm missing something. > The current expansion of the min and max intrinsics explicitly expands > the comparisons between each argument to calculate the global min/max. > Some targ

New Japanese PO file for 'gcc' (version 8.1.0)

2018-07-17 Thread Translation Project Robot
Hello, gentle maintainer. This is a message from the Translation Project robot. A revised PO file for textual domain 'gcc' has been submitted by the Japanese team of translators. The file is available at: http://translationproject.org/latest/gcc/ja.po (This file, 'gcc-8.1.0.ja.po', has jus

Re: [GCC][PATCH][Aarch64] Exploiting BFXIL when OR-ing two AND-operations with appropriate bitmasks

2018-07-17 Thread Richard Earnshaw (lists)
On 17/07/18 02:33, Richard Henderson wrote: > On 07/16/2018 10:10 AM, Sam Tebbs wrote: >> +++ b/gcc/config/aarch64/aarch64.c >> @@ -1439,6 +1439,14 @@ aarch64_hard_regno_caller_save_mode (unsigned regno, >> unsigned, >> return SImode; >> } >> >> +/* Implement IS_LEFT_CONSECUTIVE. Check if

Re: [PR fortran/83184] Fix matching code for clist/old-style initializers when encountering assumed-rank declarations

2018-07-17 Thread Fritz Reese
On Tue, Jul 17, 2018, 04:31 Janus Weil wrote: > Did someone actually approve this patch? Apparently it was committed > as r262744 and caused the following regression: > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86543 > > Cheers, > Janus > > > > 2018-06-27 23:07 GMT+02:00 Fritz Reese : > > Th

Re: [PATCH][Fortran] Use MIN/MAX_EXPR for intrinsics or __builtin_fmin/max when appropriate

2018-07-17 Thread Kyrill Tkachov
Hi Richard, On 17/07/18 14:27, Richard Biener wrote: On Tue, Jul 17, 2018 at 2:35 PM Kyrill Tkachov wrote: Hi all, This is my first Fortran patch, so apologies if I'm missing something. The current expansion of the min and max intrinsics explicitly expands the comparisons between each argumen

Re: [PATCH][C++] Fix PR86523

2018-07-17 Thread Nathan Sidwell
On 07/17/2018 08:32 AM, Richard Biener wrote: The following makes sure to generate early debug for globals that end up being pushed to the backend via the write_out_vars call in c_parse_final_cleanups. rest_of_decl_compilation is confused by seeing current_function_decl set and skips the debug-

Re: [Patch, Fortran] PR 85599: warn about short-circuiting of logical expressions for non-pure functions

2018-07-17 Thread Janus Weil
2018-07-17 9:52 GMT+02:00 Janus Weil : >> 2018-07-16 21:50 GMT+02:00 Thomas Koenig : >>> What I would suggest is to enable -Wfunction-eliminiation with >>> -Wextra and also use that for your new warning. >> >> Thanks for the comments. Makes sense. Updated patch attached. > > > Huh, after actually t

[PATCH] Fix error level of warning about C++ style comments

2018-07-17 Thread Jason Franklin
Greetings, Below is a simple patch for fixing the error level of an additional note that follows a warning about using C++ style comments. The ChangeLog entry is below, followed by the patch. Tried to figure out how to run the tests, but not sure if it's necessary for something so simple... w

Re: [AArch64][PATCH 1/2] Fix addressing printing of LDP/STP

2018-07-17 Thread James Greenhalgh
On Mon, Jun 25, 2018 at 03:48:13AM -0500, Andre Simoes Dias Vieira wrote: > On 18/06/18 09:08, Andre Simoes Dias Vieira wrote: > > Hi Richard, > > > > Sorry for the delay I have been on holidays. I had a look and I think you > > are right. With these changes Umq and Uml seem to have the same >

Re: [AArch64][PATCH 2/2] PR target/83009: Relax strict address checking for store pair lanes

2018-07-17 Thread James Greenhalgh
On Mon, Jun 25, 2018 at 03:48:43AM -0500, Andre Simoes Dias Vieira wrote: > On 14/06/18 12:47, Richard Sandiford wrote: > > Kyrill Tkachov writes: > >> Hi Andre, > >> On 07/06/18 18:02, Andre Simoes Dias Vieira wrote: > >>> Hi, > >>> > >>> See below a patch to address PR 83009. > >>> > >>> Tested

Re: [PATCH] Fix error level of warning about C++ style comments

2018-07-17 Thread Jakub Jelinek
On Tue, Jul 17, 2018 at 07:51:42AM -0700, Jason Franklin wrote: > Greetings, > > Below is a simple patch for fixing the error level of an additional note > that follows a warning about using C++ style comments. The ChangeLog > entry is below, followed by the patch. > > Tried to figure out how

Re: [Patch, Fortran] PR 85599: warn about short-circuiting of logical expressions for non-pure functions

2018-07-17 Thread Fritz Reese
On Tue, Jul 17, 2018 at 10:32 AM Janus Weil wrote: > > 2018-07-17 9:52 GMT+02:00 Janus Weil : > >> 2018-07-16 21:50 GMT+02:00 Thomas Koenig : > >>> What I would suggest is to enable -Wfunction-eliminiation with > >>> -Wextra and also use that for your new warning. > >> > >> Thanks for the comments

[PATCH] fix a couple of bugs in const string folding (PR 86532)

2018-07-17 Thread Martin Sebor
My enhancement to extract constant strings out of complex aggregates committed last week introduced a couple of bugs in dealing with non-constant indices and offsets. One of the bugs was fixed earlier today (PR 86528) but another one remains. It causes strlen (among other functions) to incorrect

Re: [PATCH, GCC, AARCH64] Add support for +profile extension

2018-07-17 Thread James Greenhalgh
On Mon, Jul 09, 2018 at 08:20:53AM -0500, Andre Vieira (lists) wrote: > Hi, > > This patch adds support for the Statistical Profiling Extension (SPE) on > AArch64. Even though the compiler will not generate code any differently > given this extension, it will need to pass it on to the assembler in

C++ PATCH for c++/86480, nested variadic lambda and constexpr if

2018-07-17 Thread Jason Merrill
The problem here was that when looking for unexpanded packs, we looked into IF_STMT_EXTRA_ARGS of a constexpr if, which includes the bindings for function parameter packs, but not in a way that uses them. So we shouldn't look there for unexpanded packs. Trying to write a smaller testcase revealed

Re: [PATCH][Fortran] Use MIN/MAX_EXPR for intrinsics or __builtin_fmin/max when appropriate

2018-07-17 Thread Thomas Koenig
Hi Kyrill, The current implementation expands to:     mvar = a1;     if (a2 .op. mvar || isnan (mvar))   mvar = a2;     if (a3 .op. mvar || isnan (mvar))   mvar = a3;     ...     return mvar; That is, if one of the operands is a NaN it will return the other argument. If both (all

Re: [PATCH] fix a couple of bugs in const string folding (PR 86532)

2018-07-17 Thread Jeff Law
On 07/17/2018 09:19 AM, Martin Sebor wrote: > My enhancement to extract constant strings out of complex > aggregates committed last week introduced a couple of bugs in > dealing with non-constant indices and offsets.  One of the bugs > was fixed earlier today (PR 86528) but another one remains.  It

Re: [PATCH] Fix error level of warning about C++ style comments

2018-07-17 Thread Jason Franklin
Jakub, Thanks so much for the review! Below is an updated ChangeLog entry and patch. 2018-07-17 Jason Franklin * lex.c (_cpp_lex_direct): Fix error level for note following warning about the use of C++ style comments. >From 1380d73031d76be76019e67f203cb7d98fb5ee60 Mon Sep

[PATCH, testsuite] Restrict some PPC tests

2018-07-17 Thread David Edelsohn
Two of the powerpc testcases have additional requirements. Fixed thus. Thanks, David * gcc.target/powerpc/pr57150.c: Require longdouble128. * gcc.target/powerpc/pr79916.c: Require dfp. Index: pr79916.c === --- pr79916.c (revision

Re: [GCC][PATCH][Aarch64] Exploiting BFXIL when OR-ing two AND-operations with appropriate bitmasks

2018-07-17 Thread Richard Henderson
On 07/17/2018 06:33 AM, Richard Earnshaw (lists) wrote: >> (define_predicate "pow2m1_operand" >> (and (match_code "const_int") >>(match_test "exact_pow2 (INTVAL(op) + 1) > 0"))) > ITYM exact_log2() Yes of course. Thanks, r~

Re: [PATCH] fix a couple of bugs in const string folding (PR 86532)

2018-07-17 Thread Martin Sebor
On 07/17/2018 09:38 AM, Jeff Law wrote: On 07/17/2018 09:19 AM, Martin Sebor wrote: My enhancement to extract constant strings out of complex aggregates committed last week introduced a couple of bugs in dealing with non-constant indices and offsets. One of the bugs was fixed earlier today (PR

Re: [PATCH][Fortran] Use MIN/MAX_EXPR for intrinsics or __builtin_fmin/max when appropriate

2018-07-17 Thread Kyrill Tkachov
Hi Thomas, On 17/07/18 16:36, Thomas Koenig wrote: Hi Kyrill, The current implementation expands to: mvar = a1; if (a2 .op. mvar || isnan (mvar)) mvar = a2; if (a3 .op. mvar || isnan (mvar)) mvar = a3; ... return mvar; That is, if one of the operands is

Re: [PATCH, PR86257, i386/debug] Fix insn prefix in tls_global_dynamic_64_

2018-07-17 Thread Tom de Vries
On 06/25/2018 03:02 PM, Tom de Vries wrote: > On 06/25/2018 02:45 PM, Nathan Sidwell wrote: >> On 06/25/2018 08:25 AM, Tom de Vries wrote: >> >>> If we'd implemented something like this in gas: >>> ... >>> .insn >>> .byte 0x66 >>> .endinsn >>> ... >>> we could fix this more generically. >> >> Doesn

Re: [Patch, Fortran] PR 85599: warn about short-circuiting of logical expressions for non-pure functions

2018-07-17 Thread Janus Weil
2018-07-17 17:18 GMT+02:00 Fritz Reese : >> 2018-07-17 9:52 GMT+02:00 Janus Weil : >> > In other words: Does it make sense to tone down >> > -Wfunction-elimination, by only warning about impure functions? >> >> Here is an update of the patch which does that. Regtesting now ... > > Would not this br

Go patch committed: Connect the concrete type and the placeholder for circular types

2018-07-17 Thread Ian Lance Taylor
This patch by Cherry Zhang changes the Go frontend to more clearly connect the concrete type and the placeholder for circular types. Previously, when creating the backend representation of a circular type, we resolved the placeholder to a circular_pointer_type. The backend didn't know what the con

Re: [Patch, Fortran] PR 85599: warn about short-circuiting of logical expressions for non-pure functions

2018-07-17 Thread Thomas Koenig
Am 17.07.2018 um 19:19 schrieb Janus Weil: 2018-07-17 17:18 GMT+02:00 Fritz Reese : 2018-07-17 9:52 GMT+02:00 Janus Weil : In other words: Does it make sense to tone down -Wfunction-elimination, by only warning about impure functions? Here is an update of the patch which does that. Regtesting

[PATCH, testsuite] PPC testsuite pr85456.c

2018-07-17 Thread David Edelsohn
And another test that needs to be restricted because it assumes 128 bit long double. Thanks, David * gcc.target/powerpc/pr85456.c: Require longdouble128. Index: pr85456.c === --- pr85456.c (revision 262824) +++ pr85456.c (workin

Re: [PATCH][Fortran] Use MIN/MAX_EXPR for intrinsics or __builtin_fmin/max when appropriate

2018-07-17 Thread Thomas Koenig
Hi Kyrill, Because the expansion now emits straightline code rather than conditionals and branches it should be easier to optimise in general, so I'd expect this to be an improvement overall. That said, I have benchmarked it on SPEC2017 on aarch64. If you have any benchmarks of interest to y

Re: [PATCH] Fix error level of warning about C++ style comments

2018-07-17 Thread Jakub Jelinek
On Tue, Jul 17, 2018 at 08:39:30AM -0700, Jason Franklin wrote: > Thanks so much for the review! Below is an updated ChangeLog entry and > patch. Thanks. I've fixed some formatting issues and testsuite (3 tests started FAILing), plus added one more test, bootstrapped/regtested on x86_64-linux an

Go patch committed: Don't set btype_ field too early for an alias type

2018-07-17 Thread Ian Lance Taylor
This patch by Cherry Zhang fixes a problem in the Go frontend introduced by https://golang.org/cl/123362. A type's btype_ field should not be set before named types are converted if it is a placeholder. For alias type, it iwas set too early. That could result in unresolved placeholders. This pa

Re: [Patch, Fortran] PR 85599: warn about short-circuiting of logical expressions for non-pure functions

2018-07-17 Thread Janus Weil
2018-07-17 19:34 GMT+02:00 Thomas Koenig : > Am 17.07.2018 um 19:19 schrieb Janus Weil: >> However, the test case above seems to indicate that the >> function-elimination optimization is not applied to impure functions >> anyway (which is good IMHO). > > If you specify -faggressive-function-elimina

Fix invalid cc_status after [const_][us]mulsi3_highpart

2018-07-17 Thread Andreas Schwab
The mulu.l insn sets the CC according to the 64-bit result, but we are only using the high part, so the Z flag cannot be used. The other flags would still be valid, but we have no cc_status flag for that case. * config/m68k/m68k.md (umulsi3_highpart+1, const_umulsi3_highpart) (smu

Re: [Patch, Fortran] PR 85599: warn about short-circuiting of logical expressions for non-pure functions

2018-07-17 Thread Fritz Reese
On Tue, Jul 17, 2018 at 2:36 PM Janus Weil wrote: > > 2018-07-17 19:34 GMT+02:00 Thomas Koenig : > > Am 17.07.2018 um 19:19 schrieb Janus Weil: [...] > > I do hope that things have converged by now and that this will be the > last incarnation of the patch. If there is no more feedback in the > nex

[C++ PATCH] Disallow type specifiers among lambda-declarator decl-specifier-seq (PR c++/86550)

2018-07-17 Thread Jakub Jelinek
Hi! The standard says: "In the decl-specifier-seq of the lambda-declarator, each decl-specifier shall either be mutable or constexpr." and the C++ FE has CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR flag for that. But as implemented, it is actually CP_PARSER_FLAGS_ONLY_TYPE_OR_MUTABLE_OR_CONSTEXPR as

Re: [Patch, Fortran] PR 85599: warn about short-circuiting of logical expressions for non-pure functions

2018-07-17 Thread Janus Weil
2018-07-17 20:55 GMT+02:00 Fritz Reese : > On Tue, Jul 17, 2018 at 2:36 PM Janus Weil wrote: >> >> 2018-07-17 19:34 GMT+02:00 Thomas Koenig : >> > Am 17.07.2018 um 19:19 schrieb Janus Weil: > [...] >> >> I do hope that things have converged by now and that this will be the >> last incarnation of t

Re: [PATCH, testsuite] PPC testsuite pr85456.c

2018-07-17 Thread Segher Boessenkool
On Tue, Jul 17, 2018 at 01:34:18PM -0400, David Edelsohn wrote: > And another test that needs to be restricted because it assumes 128 > bit long double. Thanks :-) Segher

Re: [PATCH][Fortran] Use MIN/MAX_EXPR for intrinsics or __builtin_fmin/max when appropriate

2018-07-17 Thread Janne Blomqvist
On Tue, Jul 17, 2018 at 6:36 PM, Thomas Koenig wrote: > Hi Kyrill, > > The current implementation expands to: >> mvar = a1; >> if (a2 .op. mvar || isnan (mvar)) >>mvar = a2; >> if (a3 .op. mvar || isnan (mvar)) >>mvar = a3; >> ... >> return mvar; >> >> Tha

[committed] Restore nios2 builds

2018-07-17 Thread Jeff Law
The recent alignment changes broke nios2 as it referenced align_labels_log. This patch updates it to use align_labels.levels[0].log. Installing on the trunk. Jeff diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2e724217fa4..d8057a074a1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,

[PATCH] Make function clone name numbering independent.

2018-07-17 Thread Michael Ploujnikov
On 2018-07-17 06:02 AM, Richard Biener wrote: > On Tue, Jul 17, 2018 at 8:10 AM Bernhard Reutner-Fischer > wrote: >> >> On 16 July 2018 21:38:36 CEST, Michael Ploujnikov >> wrote: >>> Hi, >>> >> >>> +clone_fn_ids = hash_map::create_ggc >>> (1000); >> >> Isn't 1000 a bit excessive? What about

[committed] Fix FRV builds

2018-07-17 Thread Jeff Law
More fallout from the alignment changes. This time in frv_align_label. Committed to the trunk. jeff diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d8057a074a1..51e91221147 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ 2018-07-17 Jeff Law + * config/frv/frv.c (frv

Re: [PATCH][Fortran] Use MIN/MAX_EXPR for intrinsics or __builtin_fmin/max when appropriate

2018-07-17 Thread Janne Blomqvist
On Tue, Jul 17, 2018 at 11:06 PM, Janne Blomqvist wrote: > On Tue, Jul 17, 2018 at 6:36 PM, Thomas Koenig > wrote: > >> Hi Kyrill, >> >> The current implementation expands to: >>> mvar = a1; >>> if (a2 .op. mvar || isnan (mvar)) >>>mvar = a2; >>> if (a3 .op. mvar || isnan

[PATCH, rs6000] Sort Altivec/VSX built-in functions into subsubsections according to configuration requirements

2018-07-17 Thread Kelvin Nilsen
The many PowerPC built-in functions (intrinsics) that are enabled by including each have different configuration requirements. To simplify the description of the requirements, this patch sorts these functions into different subsubsections. A subsequent patch will add and remove various func

Re: [PATCH] Fix PR86456

2018-07-17 Thread Jeff Law
On 07/17/2018 02:23 AM, Richard Biener wrote: > > This cures the ICEs and wrong assembler that currently happen when > using -flto with -gdwarf-5. gdb is also happy with small test programs > but readelf is still complaining (see PR, I have no clue what goes > wrong). > > Bootstrapped on x86_64-

[committed] Restoring MIPS builds after alignment changes

2018-07-17 Thread Jeff Law
Similar to the others... Committed to the trunk. Jeff diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 51e91221147..ac4abdaf1ba 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ 2018-07-17 Jeff Law + * config/mips/mips.c (vr4130_align_insns): Update for recent + ch

Re: [PATCH, rs6000] Sort Altivec/VSX built-in functions into subsubsections according to configuration requirements

2018-07-17 Thread Segher Boessenkool
On Tue, Jul 17, 2018 at 03:44:43PM -0500, Kelvin Nilsen wrote: > The many PowerPC built-in functions (intrinsics) that are enabled by > including each have different configuration requirements. To > simplify the description of the requirements, this patch sorts these > functions into different

[PATCH, rs6000] Fix AIX test case failures

2018-07-17 Thread Carl Love
Segher: I was requested to backport the patch for the AIX test case failures to GCC 8. The trunk patch applied cleanly to GCC 8. I updated the changelog patch, built and retested the patch on:     powerpc64le-unknown-linux-gnu (Power 8 LE)   powerpc64-unknown-linux-gnu (Power 8 BE) AIX

backporting fix for 85602 to GCC 8

2018-07-17 Thread Martin Sebor
If there are no objections I'd like to backport the solution for PR 85602 to avoid a class of unnecessary warnings for safe uses of nonstring arrays. With the release coming up later this week I'll go ahead and commit the patch tomorrow. https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=261

[committed] Fix typo/thinko in recent tree-ssa-dse.c change

2018-07-17 Thread Jeff Law
I meant to mask off low bits in the head trim and wrote... -*trim_head &= (UNITS_PER_WORD - 1); Which, of course is wrong as it's missing the bit-not. This led to a regression on at least one 32bit target for pr30375's testcase. This patch adds the missing bit-not. It fixes the regressi

Re: [C++ PATCH] Disallow type specifiers among lambda-declarator decl-specifier-seq (PR c++/86550)

2018-07-17 Thread Jason Merrill
On Wed, Jul 18, 2018 at 4:57 AM, Jakub Jelinek wrote: > The standard says: > "In the decl-specifier-seq of the lambda-declarator, each decl-specifier shall > either be mutable or constexpr." > and the C++ FE has CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR flag for that. > But as implemented, it is a

Re: [C++ Patch] Another permerror related tweak

2018-07-17 Thread Jason Merrill
OK. And I think this qualifies as obvious; you don't need to wait for approval on further patches like this. Jason On Tue, Jul 17, 2018 at 10:17 PM, Paolo Carlini wrote: > Hi again, > > here I noticed a pair of consecutive permerrors (instead of permerror + > inform) and also that the first one

Re: C++ PATCH for c++/86190, bogus -Wsign-conversion warning

2018-07-17 Thread Jason Merrill
OK. On Fri, Jul 13, 2018 at 11:43 PM, Marek Polacek wrote: > Ping. > > On Tue, Jul 03, 2018 at 09:35:24AM -0400, Marek Polacek wrote: >> This PR complains about bogus -Wsign-conversion warning even with an >> explicit static_cast. It started with this hunk from the delayed folding >> merge: >> >

[PR86544] Fix Popcount detection generates different code on C and C++

2018-07-17 Thread Kugan Vivekanandarajah
Attached patch fixes phi-opt not optimizing c++ testcase where we have if (b_4(D) == 0) instead of if (b_4(D) != 0) as shown in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86544 Patch bootstrapped and regression tested on x86_64-linux-gnu with no new regressions. Is this OK for trunk? Thanks,

Re: [PATCH] fix a couple of bugs in const string folding (PR 86532)

2018-07-17 Thread Martin Sebor
The attached update takes care of a couple of problems pointed out by Bernd Edlinger in his comments on the bug. The ICE he mentioned in comment #20 was due mixing sizetype, ssizetype, and size_type_node in c_strlen(). AFAICS, some of it predates the patch but my changes made it worse and also m

Re: [PATCH 1/4] Clean up of new format of -falign-FOO.

2018-07-17 Thread Michael Collison
Hi Martin, Your alignment patch breaks the arm port. In the file arm.c, function 'get_label_padding' the code uses: static HOST_WIDE_INT get_label_padding (rtx label) { HOST_WIDE_INT align, min_insn_size; align = 1 << label_to_alignment (label); min_insn_size = TARGET_THUMB ? 2 : 4; ret

[committed] And now fixing alignment stuff for ARM

2018-07-17 Thread Jeff Law
Just like the others.Committing to the trunk. Jeff diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bccc0c76b04..0249082f618 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ 2018-07-17 Jeff Law + * config/arm/arm.c (get_label_padding): Update for recent + chang

[PATCH] Introduce instance discriminators

2018-07-17 Thread Alexandre Oliva
This patch is a rewrite of an earlier patch submitted at https://gcc.gnu.org/ml/gcc-patches/2012-11/msg02340.html With -gnateS, the Ada compiler sets itself up to output discriminators for different instantiations of generics, but the middle and back ends have lacked support for that. This patch

  1   2   >