Re: [RFC][debug] Add -greadable-dwarf

2018-08-21 Thread Jason Merrill
How about adding this name to a -dA comment instead of the actual dwarf? On Tue, Aug 21, 2018, 12:59 AM Richard Biener wrote: > On Wed, 15 Aug 2018, Tom de Vries wrote: > > > Hi, > > > > This patch adds option -greadable-dwarf. In absence of an DW_AT_comment > > attribute, > > What's a DW_AT_co

Re: [RFC][debug] Add -greadable-dwarf

2018-08-21 Thread Richard Biener
On Tue, 21 Aug 2018, Jason Merrill wrote: > How about adding this name to a -dA comment instead of the actual dwarf? That would also work but it requires either sticking that name somewhere in die_struct or keep a reference to the decl we created a DIE for in the same struct. Though we already h

Re: [PATCH][debug] Add debug and earlydebug dumps

2018-08-21 Thread Tom de Vries
On 08/20/2018 02:24 PM, Richard Biener wrote: > On Mon, 13 Aug 2018, Tom de Vries wrote: > >> Hi, >> >> With the introduction of early debug, we've added a phase in the compiler >> which >> produces information which is not visible, unless we run the compiler in the >> debugger and call debug_dwa

Re: patch to bug #86829

2018-08-21 Thread Richard Biener
On Mon, Aug 20, 2018 at 9:40 PM Jeff Law wrote: > > On 08/04/2018 07:22 AM, Giuliano Augusto Faulin Belinassi wrote: > > Closes bug #86829 > > > > Description: Adds substitution rules for both sin(atan(x)) and > > cos(atan(x)). These formulas are replaced by x / sqrt(x*x + 1) and 1 / > > sqrt(x*x

Re: [committed] Add support for grouping of related diagnostics (PR other/84889)

2018-08-21 Thread Richard Biener
On Mon, Aug 20, 2018 at 11:10 PM David Malcolm wrote: > > We often emit logically-related groups of diagnostics. > > A relatively simple case is this: > > if (warning_at (body_loc, OPT_Wmultistatement_macros, > "macro expands to multiple statements")) > inform (guard_loc, "

Re: [PATCH, rs6000] Improve TREE_TYPE comparisons in fold_mergehl_helper()

2018-08-21 Thread Richard Biener
On Tue, Aug 21, 2018 at 12:07 AM Segher Boessenkool wrote: > > Hi Will, > > On Mon, Aug 20, 2018 at 04:40:35PM -0500, Will Schmidt wrote: > > This is a follow-up to an earlier patch that enabled gimple folding of > > vec_mergeh and vec_mergel for the float and double data types. > > > > Per feedba

Re: [PATCH] Use c_getstr to get the format string in gimple-ssa-sprintf.c

2018-08-21 Thread Richard Biener
On Mon, 20 Aug 2018, Bernd Edlinger wrote: > Hi, > > > this simplifies get_format_string in gimple-ssa-sprintf.c > to use c_getstr. > > > Bootstrapped and reg-tested on x86_64-pc-linux-gnu. > Is it OK for trunk? OK. Thanks, Richard.

Re: [PATCH] Make GO string literals properly NUL terminated

2018-08-21 Thread Richard Biener
On Mon, 20 Aug 2018, Bernd Edlinger wrote: > On 08/20/18 15:19, Richard Biener wrote: > > On Mon, 20 Aug 2018, Bernd Edlinger wrote: > > > >> On 08/20/18 13:01, Richard Biener wrote: > >>> On Wed, Aug 1, 2018 at 3:05 PM Bernd Edlinger > >>> wrote: > > > > On 08/01/18 11:29,

Re: [PATCH] Make strlen range computations more conservative

2018-08-21 Thread Richard Biener
On Mon, 20 Aug 2018, Bernd Edlinger wrote: > > > On 08/20/18 12:23, Richard Biener wrote: > > On Sun, 19 Aug 2018, Bernd Edlinger wrote: > > > >> Hi, > >> > >> > >> I rebased my range computation patch to current trunk, > >> and updated it according to what was discussed here. > >> > >> That me

Re: [PATCH] Add a character size parameter to c_strlen/get_range_strlen

2018-08-21 Thread Richard Biener
On Tue, 21 Aug 2018, Bernd Edlinger wrote: > gcc -S -O2 -Wall -Wformat-overflow -ftrack-macro-expansion=0 -fshort-wchar > builtin-sprintf-warn-20.c > builtin-sprintf-warn-20.c: In function 'test': > builtin-sprintf-warn-20.c:19:39: warning: hex escape sequence out of range > 19 | ? (char*)L"\

Re: [PATCH][C++] Fix PR86763, wrong-code with TYPE_TYPELESS_STORAGE

2018-08-21 Thread Szabolcs Nagy
On 20/08/18 10:33, Richard Biener wrote: On Mon, 20 Aug 2018, Szabolcs Nagy wrote: On 02/08/18 09:30, Richard Biener wrote: ... + clock_gettime(CLOCK_REALTIME, &t); this fails on targets without clock_gettime (baremetal) or targets that need -lrt at link time. can we use something else her

[PATCH] RFC: Refactor std::tuple constraints

2018-08-21 Thread Jonathan Wakely
This refactors some std:tuple constraints, and fixes one bug. This patch was generated with -b to ignore whitespace changes, so the indentation is a little off (but it makes the patch smaller and easier to read). I haven't touched the std::tuple partial specialization yet, this is just a demonstr

Re: [PATCH][C++] Fix PR86763, wrong-code with TYPE_TYPELESS_STORAGE

2018-08-21 Thread Richard Biener
On Tue, 21 Aug 2018, Szabolcs Nagy wrote: > On 20/08/18 10:33, Richard Biener wrote: > > On Mon, 20 Aug 2018, Szabolcs Nagy wrote: > > > On 02/08/18 09:30, Richard Biener wrote: > ... > > > > + clock_gettime(CLOCK_REALTIME, &t); > > > > > > this fails on targets without clock_gettime (baremetal)

Re: P0646R1 for Debug mode

2018-08-21 Thread Jonathan Wakely
On 20/08/18 22:38 +0200, François Dumont wrote: Right after I hit the send button I realized that I had forgotten to remove the definition of __cpp_lib_list_remove_return_type on the Debug forward_list side. I haven't plan to define this macro in this context, I prefer to leave it to normal i

Re: PR libstdc++/68222 Hide safe iterator operators

2018-08-21 Thread Jonathan Wakely
On 18/08/18 22:31 +0200, François Dumont wrote: Here is the new proposal. It is indeed possible to keep _Safe_iterator and just add a _Category template parameter to it. While this is still a large patch (obviously, because it's changing a lot!) I think this version is much easier to understand

[PATCH] Remove redundant { dg-do run } directives in tests

2018-08-21 Thread Jonathan Wakely
These tests accidentally had two dg-do directives. Only the second one is needed. * testsuite/26_numerics/bit/bitops.count/countl_one.cc: Remove redundant dg-do directive. * testsuite/26_numerics/bit/bitops.count/countl_zero.cc: Likewise. * testsuite/26_numerics/bi

Re: [PATCH] Fix P81033 for FDEs in partitioned code.

2018-08-21 Thread Iain Sandoe
> On 20 Aug 2018, at 08:27, Richard Biener wrote: > > On Tue, Aug 14, 2018 at 10:18 PM Mike Stump wrote: >> >> On Aug 14, 2018, at 4:20 AM, Iain Sandoe wrote: >>> When function sub-sections are enabled, Darwin’s assembler needs the FDE >>> local start >>> label for each sub-section to follo

Re: VRP: rewrite the division code (to handle corner cases including 0)

2018-08-21 Thread Richard Biener
On Wed, Aug 15, 2018 at 3:33 AM Aldy Hernandez wrote: > > Howdy! > > In auditing the *_DIV_EXPR code I noticed that we were really botching > some divisions where the divisor included 0. > > Particularly interesting was that we were botching something as simple > as dividing by [0,0]. We were als

Re: [PATCH] Fix P81033 for FDEs in partitioned code.

2018-08-21 Thread Richard Biener
On Tue, Aug 21, 2018 at 11:45 AM Iain Sandoe wrote: > > > > On 20 Aug 2018, at 08:27, Richard Biener wrote: > > > > On Tue, Aug 14, 2018 at 10:18 PM Mike Stump wrote: > >> > >> On Aug 14, 2018, at 4:20 AM, Iain Sandoe wrote: > >>> When function sub-sections are enabled, Darwin’s assembler needs

[C++ Patch, obvious?] Change check_static_variable_definition return type to void

2018-08-21 Thread Paolo Carlini
Hi, over the last couple of weeks I started auditing the front-end about problematic uses of permerror (say, the user passes -fpermissive and after the warning we immediately return error_mark_node anyway: the assembly most likely will not make sense) and noticed that we don't use anywhere th

Re: [C++ Patch, obvious?] Change check_static_variable_definition return type to void

2018-08-21 Thread Jason Merrill
This doesn't seem obvious to me, since it is removing information from the interface of the function. But it is OK. On Tue, Aug 21, 2018 at 10:20 PM, Paolo Carlini wrote: > Hi, > > over the last couple of weeks I started auditing the front-end about > problematic uses of permerror (say, the user

Re: C++ PATCH for c++/86499, non-local lambda with a capture-default

2018-08-21 Thread Jason Merrill
On Tue, Aug 14, 2018 at 6:50 AM, Marek Polacek wrote: > This PR complains about us accepting a lambda with a capture-default > at file scope, which seems to be forbidden. This patch disallows > such a use. clang gives an error, so I did the same, but maybe we > only want a pedwarn. > > Bootstrap

Re: C++ PATCH for c++/65043, missing narrowing warning with bool

2018-08-21 Thread Jason Merrill
On Wed, Aug 15, 2018 at 11:30 AM, Marek Polacek wrote: > We weren't complaining about narrowing when converting to bool because > standard_conversion wasn't setting check_narrowing for the converting to bool > case; it only sets it at the end of the function. Moreover, check_narrowing > wasn't ca

Re: [PATCH] Add a character size parameter to c_strlen/get_range_strlen

2018-08-21 Thread Joseph Myers
On Tue, 21 Aug 2018, Martin Sebor wrote: > I still believe it would be simpler, more robust, and safe > to pass in a flag to either count bytes (the default, for > all callers except sprintf %ls), or elements of the string > type (for sprintf %ls). But the correct thing to count for sprintf %ls i

Re: C++ PATCH for c++/67012, c++/86942, detect invalid cases with function return type deduction

2018-08-21 Thread Jason Merrill
On Fri, Aug 17, 2018 at 2:17 PM, Marek Polacek wrote: > As I promised in , > this patch fixes a couple of invalid cases we weren't detecting. It's got > testcases from two PRs and another case I found out; they're intertwined so > I think

Re: [RFC][debug] Add -greadable-dwarf

2018-08-21 Thread Tom de Vries
On 08/20/2018 02:59 PM, Richard Biener wrote: > On Wed, 15 Aug 2018, Tom de Vries wrote: > >> Hi, >> >> This patch adds option -greadable-dwarf. In absence of an DW_AT_comment >> attribute, > > What's a DW_AT_comment attribute? I don't see this mentioned in the > patch. > It's a hypothetical

Re: [RFC][debug] Add -greadable-dwarf

2018-08-21 Thread Tom de Vries
Hi, That solution is limited: it does not show the extra information in the dump from an executable (which is the only way to see how things look like post-linking). Is your concern leaking compiler internals into the dwarf info? Thanks, - Tom On 08/21/2018 06:53 AM, Jason Merrill wrote: > How

[PATCH][RFC] Add gimple-cfg.h.

2018-08-21 Thread Martin Liška
Hi. I'm considering adding couple of new gimple-related functions that are related to gswitch statement. Is it a good idea? Martin gcc/ChangeLog: 2018-08-06 Martin Liska * gimple-cfg.h: New file. * ipa-fnsummary.c (set_switch_stmt_execution_predicate): Use gimple_swi

Re: [PATCH][Middle-end]patch for fixing PR 86519

2018-08-21 Thread Paul Hua
Hi, Qing, The cfarm machine gcc23 can build mips64el successful, configure with "../configure --prefix=/opt/gcc-9 MISSING=texinfo MAKEINFO=missing --target=mips64el-linux-gnu --enable-languages=c,c++ On Tue, Aug 21, 2018 at 7:02 AM Qing Zhao wrote: > > Hi, Paul, > > I was trying to repeat this is

Re: [PATCH] Merge Ignore and Deprecated in .opt files.

2018-08-21 Thread Martin Liška
On 08/18/2018 12:24 AM, Segher Boessenkool wrote: > Hi! > > On Thu, Aug 16, 2018 at 11:18:15AM +0200, Martin Liška wrote: >> On 08/15/2018 06:38 PM, Joseph Myers wrote: >>> On Wed, 15 Aug 2018, Martin Liška wrote: >>> Ok, so you have very similar opinion as Jakub. Thus I'm sending new v

Re: [PATCH] RFC: Refactor std::tuple constraints

2018-08-21 Thread Ville Voutilainen
On 21 August 2018 at 12:17, Jonathan Wakely wrote: > I think this is slightly simpler and easier to maintain, but I'd like > to hear other views, especially from Ville who added most of these > constraints and does most of the work to maintain std::tuple. +1, OK.

Re: [PATCH][RFC] Add gimple-cfg.h.

2018-08-21 Thread Richard Biener
On Tue, Aug 21, 2018 at 2:58 PM Martin Liška wrote: > > Hi. > > I'm considering adding couple of new gimple-related functions that > are related to gswitch statement. > > Is it a good idea? Just add them to tree-cfg.h? That's what should be really called gimple-cfg.h these days... Richard. > M

Re: Richard Sandiford appointed Global Reviewer

2018-08-21 Thread Richard Sandiford
David Edelsohn writes: > I am pleased to announce that the GCC Steering Committee has > appointed Richard Sandiford as a Global Reviewer. > > Please join me in congratulating Richard on his new role. > Richard, please update your listing in the MAINTAINERS file. Thanks David, and than

Re: C++ PATCH for c++/86981, implement -Wpessimizing-move

2018-08-21 Thread Marek Polacek
On Mon, Aug 20, 2018 at 07:42:10PM -0400, David Malcolm wrote: > On Mon, 2018-08-20 at 18:54 -0400, Marek Polacek wrote: > > On Mon, Aug 20, 2018 at 05:18:49PM -0400, David Malcolm wrote: > > > As of r263675 it's now possible to tell the diagnostics subsystem > > > that > > > the warning and note a

Re: [PATCH][debug] Fix handling of vlas in lto

2018-08-21 Thread Tom de Vries
On 08/20/2018 03:09 PM, Richard Biener wrote: > On Fri, 17 Aug 2018, Tom de Vries wrote: > >> I've rewritten the patch to work generically, not just for DW_AT_upper_bound, >> and to reuse the code already there in add_scalar_info. >> >> OK for trunk? >> >> Thanks, >> - Tom >> >> [debug] Fix handli

Re: C++ PATCH for c++/86981, implement -Wpessimizing-move

2018-08-21 Thread David Malcolm
On Tue, 2018-08-21 at 10:01 -0400, Marek Polacek wrote: > On Mon, Aug 20, 2018 at 07:42:10PM -0400, David Malcolm wrote: > > On Mon, 2018-08-20 at 18:54 -0400, Marek Polacek wrote: > > > On Mon, Aug 20, 2018 at 05:18:49PM -0400, David Malcolm wrote: > > > > As of r263675 it's now possible to tell t

Re: VRP: rewrite the division code (to handle corner cases including 0)

2018-08-21 Thread Jeff Law
On 08/21/2018 03:46 AM, Richard Biener wrote: > > + /* If we're definitely dividing by zero, there's nothing to do. */ > + if (wide_int_range_zero_p (divisor_min, divisor_max, prec)) > +return false; > > I know we didn't do this before but for x / 0 we should compute UNDEFINED > as range.

[PATCH, testsuite] Stringify __USER_LABEL_PREFIX__ in pr85248.

2018-08-21 Thread Iain Sandoe
another missing stringify for _U_L_P_ OK? thanks Iain gcc/testsuite * gcc.dg/lto/pr85248_0.c (test_alias): Stringify __USER_LABEL_PREFIX__. (test_noreturn): Likewise. --- gcc/testsuite/gcc.dg/lto/pr85248_0.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff

Re: patch to bug #86829

2018-08-21 Thread Jeff Law
On 08/21/2018 02:02 AM, Richard Biener wrote: > On Mon, Aug 20, 2018 at 9:40 PM Jeff Law wrote: >> >> On 08/04/2018 07:22 AM, Giuliano Augusto Faulin Belinassi wrote: >>> Closes bug #86829 >>> >>> Description: Adds substitution rules for both sin(atan(x)) and >>> cos(atan(x)). These formulas are r

[Ada] Dynamically resizable, load factor-based hash table

2018-08-21 Thread Pierre-Marie de Rodat
This patch introduces a dynamically resizable, load factor-based hash table in unit GNAT.Dynamic_HTables. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-08-21 Hristian Kirtchev gcc/ada/ * libgnat/g-dynhta.adb, libgnat/g-dynhta.ads: New package Dynamic_HTable. gcc/tes

[Ada] Handle pragmas that come from aspects for GNATprove

2018-08-21 Thread Pierre-Marie de Rodat
In GNATprove we appear to abuse a routine related to cross-references and expect it to deliver exact results, which is not what it was designed for. This patch is a temporary solution to avoid crashes in GNATprove; it doesn't affect the frontend or other backends, because this code is used exclusi

[Ada] General purpose doubly linked list for compiler and tool use

2018-08-21 Thread Pierre-Marie de Rodat
This patch adds unit GNAT.Lists which currently contains the implementation of a general purpose doubly linked list intended for use by the compiler and the tools around it. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-08-21 Hristian Kirtchev gcc/ada/ * impunit.adb: Add g-l

[Ada] Compiler abort on call to expr. function for default discriminant

2018-08-21 Thread Pierre-Marie de Rodat
If a discriminant specification has a default that is a call to an expression function, that function has to be frozen at the point of a call to the initialization procedure for an object of the record type, even though the call does not appear to come from source. Tested on x86_64-pc-linux-gnu, c

[Ada] Enumeration types with non-standard representation

2018-08-21 Thread Pierre-Marie de Rodat
The compiler may report errors on enumeration types with non-standard representation (i.e. at least one literal has a representation value different from its 'Pos value) processing attribute 'Enum_Rep. It may also generate wrong code for the evaluation of 'Enum_Rep raising Constraint_Error at runt

[Ada] Spurious "Duplicated symbol" error with discriminated tasks

2018-08-21 Thread Pierre-Marie de Rodat
This patch fixes a spurious error in a program that contains a discriminated task type and several of its subtype in the same declarative part, when the corresponding discriminant constraints are expressions. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-08-21 Ed Schonberg gcc/ada/

[libiberty patch] pex-unix error behaviour

2018-08-21 Thread Nathan Sidwell
This is the second patch for pex-unix's child spawning. Right now, if we manage to (v)fork, but the execvp fails, we use write to emit an error and then _exit. The parent discovers the child failed when trying to communicate or wait for it. This can be improved in 2 ways. 1) If we know we'r

[Ada] Crash on entry in generic with dynamic elaboration checks

2018-08-21 Thread Pierre-Marie de Rodat
This patch modifies the set of attributes that applies to entries and entry families to include elaboration entities used by the access-before-elaboration mechanism. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-08-21 Hristian Kirtchev gcc/ada/ * einfo.adb (Elaboration_Entit

[Ada] Define versions of dimension system for Float and Long_Float

2018-08-21 Thread Pierre-Marie de Rodat
The dimension system in System.Dim.Mks is based on Long_Long_Float, which may not be convenient to people who want to use Float or Long_Float as basis. These new files provide units that define the dimension system based on Float in System.Dim.Float_Mks and on Long_Float in System.Dim.Long_Mks. Ch

[Ada] Fix internal error on extension of record with representation clause

2018-08-21 Thread Pierre-Marie de Rodat
This fixes a long-standing issue present for extensions of tagged record types with a representation clause: the clause is correctly inherited for components inherited in the extension but the position and size are not, which fools the logic of Is_Possibly_Unaligned_Object. This can result in an a

[Ada] Spurious crash on expression function as completion with contracts

2018-08-21 Thread Pierre-Marie de Rodat
This patch fixes a compiler abort on an expression function that is a completion of a subprogram with preconditions. The problem is caused by the presence of types in the precondition that are not frozen when the subprogram body constructed for the expression function receives the code that enforce

[Ada] Retention of with clauses for ignored Ghost units

2018-08-21 Thread Pierre-Marie de Rodat
This patch ensures that with clauses that mention ignored Ghost units are retained in the tree. The retention is necessary for several reasons: * The with clauses allow the new elaboration order mechanism to produce the same library edges regardless of whether the Ghost unit is checke

[Ada] Crash on expression function and tagged types

2018-08-21 Thread Pierre-Marie de Rodat
This patch fixes a compiler abort on an expression function whose expression includes tagged types that have not been frozen before the generated body of the function is analyzed, even though that body is inserted at the end of the current declarative part. Tested on x86_64-pc-linux-gnu, committed

[Ada] Add a new gnat tool vxlink

2018-08-21 Thread Pierre-Marie de Rodat
VxLink is a helper tool used as a wrapper around g++/gcc to build VxWorks DKM (Downloadable Kernel Modules). Such DKM is a partially linked object that includes entry points for constructors and destructors. This tool thus uses g++ to generate an intermediate partially linked object, retrieves th

[Ada] Improper copying of limited arrays with default initialization

2018-08-21 Thread Pierre-Marie de Rodat
This patch fixes an improper expansion of aggregates for limited array types in an object declaration. Prior to this patch, The presence of the aggregate (which can only consist of box initializations) would create a temporary that was then assigned to the object in the declaration. Apart from a vi

[Ada] Spurious ambiguity error on call returning an access type

2018-08-21 Thread Pierre-Marie de Rodat
If F is a function with a single defaulted parameter that returns an access_to_array type, then F (I) may designate either the return type or an indexing of the result of the call, after implicit dereferencing. If the component type C of the array type AR is accces AR this is ambiguous in a contex

[Ada] Spurious error on overriding protected function in instance

2018-08-21 Thread Pierre-Marie de Rodat
The conformance between an overriding protected operation with progenitors and the overridden interface operation requires subtype conformance; requiring equality of return types in the case of a function is too restrictive and leads to spurious errors when the return type is a generic actual. Tes

[Ada] Crash processing SPARK annotate aspect

2018-08-21 Thread Pierre-Marie de Rodat
The compiler blows up writing the ALI file of a package that has a ghost subprogram with an annotate contract. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-08-21 Javier Miranda gcc/ada/ * lib-writ.adb (Write_Unit_Information): Handle pragmas removed by the expander.

Re: C++ PATCH for c++/86981, implement -Wpessimizing-move

2018-08-21 Thread Marek Polacek
On Tue, Aug 21, 2018 at 04:41:52PM +1200, Jason Merrill wrote: > Let's factor this into a maybe_warn_pessimizing_move function. Ok with that > change. Thanks for the quick review. Thus: Bootstrapped/regtested on x86_64-linux, applying to trunk. 2018-08-21 Marek Polacek PR c++/86981,

C++ PATCH to fix typo in cp-tree.h

2018-08-21 Thread Marek Polacek
We don't have INDIRECT_EXPR. Applying as obvious. 2018-08-21 Marek Polacek * cp-tree.h: Fix typo. --- gcc/cp/cp-tree.h +++ gcc/cp/cp-tree.h @@ -3656,7 +3656,7 @@ struct GTY(()) lang_decl { (LANG_DECL_FN_CHECK (FUNCTION_DECL_CHECK (NODE)) \ ->u.saved_language_function) -/

Re: [PATCH] Add a character size parameter to c_strlen/get_range_strlen

2018-08-21 Thread Jeff Law
On 08/20/2018 05:23 PM, Martin Sebor wrote: >> And I think you're hitting on some of issues already raised in the >> thread. >> >> In this specific case though ISTM 4 is the right answer.  We casted to a >> char *, so that's what we should be counting.  Or am I missing >> something?  Also note that

Re: [PATCH] Add a character size parameter to c_strlen/get_range_strlen

2018-08-21 Thread Jeff Law
On 08/20/2018 11:17 PM, Bernd Edlinger wrote: > On 08/21/18 01:23, Martin Sebor wrote: >> On 08/20/2018 04:17 PM, Jeff Law wrote: >>> On 08/18/2018 11:38 AM, Martin Sebor wrote: On 08/17/2018 09:32 PM, Jeff Law wrote: > On 08/17/2018 02:17 PM, Martin Sebor wrote: >> On 08/17/2018 12:44

Re: [PATCH, testsuite] Stringify __USER_LABEL_PREFIX__ in pr85248.

2018-08-21 Thread Mike Stump
On Aug 21, 2018, at 7:20 AM, Iain Sandoe wrote: > > another missing stringify for _U_L_P_ > > OK? Ok. =

Re: [PATCH] Add a character size parameter to c_strlen/get_range_strlen

2018-08-21 Thread Martin Sebor
On 08/21/2018 05:50 AM, Joseph Myers wrote: On Tue, 21 Aug 2018, Martin Sebor wrote: I still believe it would be simpler, more robust, and safe to pass in a flag to either count bytes (the default, for all callers except sprintf %ls), or elements of the string type (for sprintf %ls). But the

Re: [PATCH] Add a character size parameter to c_strlen/get_range_strlen

2018-08-21 Thread Joseph Myers
On Tue, 21 Aug 2018, Martin Sebor wrote: > Sure, but the only valid argument to %ls is wchar_t*. Passing > it something else is undefined. Well, (wchar_t *)"something\0\0\0\0" would be OK given -fno-strict-aliasing and if you know the alignment is OK. Do we have that information about the typ

Re: [PATCH] Add a character size parameter to c_strlen/get_range_strlen

2018-08-21 Thread Jeff Law
On 08/21/2018 09:37 AM, Martin Sebor wrote: > On 08/21/2018 05:50 AM, Joseph Myers wrote: >> On Tue, 21 Aug 2018, Martin Sebor wrote: >> >>> I still believe it would be simpler, more robust, and safe >>> to pass in a flag to either count bytes (the default, for >>> all callers except sprintf %ls),

Re: [PATCH] Add a character size parameter to c_strlen/get_range_strlen

2018-08-21 Thread Martin Sebor
On 08/21/2018 02:59 AM, Richard Biener wrote: On Tue, 21 Aug 2018, Bernd Edlinger wrote: gcc -S -O2 -Wall -Wformat-overflow -ftrack-macro-expansion=0 -fshort-wchar builtin-sprintf-warn-20.c builtin-sprintf-warn-20.c: In function 'test': builtin-sprintf-warn-20.c:19:39: warning: hex escape sequ

Re: [PATCH] Add a character size parameter to c_strlen/get_range_strlen

2018-08-21 Thread Jeff Law
On 08/21/2018 09:57 AM, Martin Sebor wrote: > On 08/21/2018 02:59 AM, Richard Biener wrote: >> On Tue, 21 Aug 2018, Bernd Edlinger wrote: >> >>> gcc -S -O2 -Wall -Wformat-overflow -ftrack-macro-expansion=0 >>> -fshort-wchar builtin-sprintf-warn-20.c >>> builtin-sprintf-warn-20.c: In function 'test'

[PATCH] Optimise sqrt reciprocal multiplications

2018-08-21 Thread Kyrill Tkachov
Hi all, This patch aims to optimise sequences involving uses of 1.0 / sqrt (a) under -freciprocal-math and -funsafe-math-optimizations. In particular consider: x = 1.0 / sqrt (a); r1 = x * x; // same as 1.0 / a r2 = a * x; // same as sqrt (a) If x, r1 and r2 are all used further on in the cod

Re: [PATCH] Add a character size parameter to c_strlen/get_range_strlen

2018-08-21 Thread Martin Sebor
On 08/21/2018 09:27 AM, Jeff Law wrote: On 08/20/2018 11:17 PM, Bernd Edlinger wrote: On 08/21/18 01:23, Martin Sebor wrote: On 08/20/2018 04:17 PM, Jeff Law wrote: On 08/18/2018 11:38 AM, Martin Sebor wrote: On 08/17/2018 09:32 PM, Jeff Law wrote: On 08/17/2018 02:17 PM, Martin Sebor wrote:

Re: [PATCH] Add a character size parameter to c_strlen/get_range_strlen

2018-08-21 Thread Martin Sebor
On 08/21/2018 09:59 AM, Jeff Law wrote: On 08/21/2018 09:57 AM, Martin Sebor wrote: On 08/21/2018 02:59 AM, Richard Biener wrote: On Tue, 21 Aug 2018, Bernd Edlinger wrote: gcc -S -O2 -Wall -Wformat-overflow -ftrack-macro-expansion=0 -fshort-wchar builtin-sprintf-warn-20.c builtin-sprintf-war

Re: [libiberty patch] pex-unix error behaviour

2018-08-21 Thread Ian Lance Taylor via gcc-patches
On Tue, Aug 21, 2018 at 8:03 AM, Nathan Sidwell wrote: > > 1) If we know we're using vfork, we can tell the parent directly via the > current stack frame and suitable use of volatiles. I'm pretty reluctant to rely on this special behavior of vfork. A system could plausibly #define vfork fork and

Re: [PATCH] Add a character size parameter to c_strlen/get_range_strlen

2018-08-21 Thread Martin Sebor
On 08/21/2018 09:56 AM, Jeff Law wrote: On 08/21/2018 09:37 AM, Martin Sebor wrote: On 08/21/2018 05:50 AM, Joseph Myers wrote: On Tue, 21 Aug 2018, Martin Sebor wrote: I still believe it would be simpler, more robust, and safe to pass in a flag to either count bytes (the default, for all cal

Re: [PATCH] Optimize more boolean functions

2018-08-21 Thread MCC CS
Hello all, I have updated the testcase and run "make check" on Ubuntu x86_64. All of them passed. (However the last part "do-check" couldn't be run, probably due to a missing testsuite dependency?) The match.pd is the same as the original patch, and I have updated change-summaries and improved te

Re: VRP: rewrite the division code (to handle corner cases including 0)

2018-08-21 Thread Aldy Hernandez
On 08/21/2018 05:46 AM, Richard Biener wrote: On Wed, Aug 15, 2018 at 3:33 AM Aldy Hernandez wrote: Howdy! In auditing the *_DIV_EXPR code I noticed that we were really botching some divisions where the divisor included 0. Particularly interesting was that we were botching something as sim

Re: [PATCH] Add a character size parameter to c_strlen/get_range_strlen

2018-08-21 Thread Martin Sebor
On 08/21/2018 09:44 AM, Joseph Myers wrote: On Tue, 21 Aug 2018, Martin Sebor wrote: Sure, but the only valid argument to %ls is wchar_t*. Passing it something else is undefined. Well, (wchar_t *)"something\0\0\0\0" would be OK given -fno-strict-aliasing and if you know the alignment is OK.

Re: [libiberty patch] pex-unix error behaviour

2018-08-21 Thread Nathan Sidwell
On 08/21/2018 12:37 PM, Ian Lance Taylor wrote: On Tue, Aug 21, 2018 at 8:03 AM, Nathan Sidwell wrote: 1) If we know we're using vfork, we can tell the parent directly via the current stack frame and suitable use of volatiles. I'm pretty reluctant to rely on this special behavior of vfork.

Re: [libiberty patch] pex-unix error behaviour

2018-08-21 Thread Ian Lance Taylor via gcc-patches
On Tue, Aug 21, 2018 at 11:15 AM, Nathan Sidwell wrote: > On 08/21/2018 12:37 PM, Ian Lance Taylor wrote: >> >> On Tue, Aug 21, 2018 at 8:03 AM, Nathan Sidwell wrote: >>> >>> >>> 1) If we know we're using vfork, we can tell the parent directly via the >>> current stack frame and suitable use of v

Re: Async I/O patch with compilation fix

2018-08-21 Thread Thomas Koenig
Hi everybody, Nicolas has committed the patch as r263750. PR 87048 now traces the armeb regression, which is assumed to resurface now. Let's really try and fix that one before 9.0 :-) Regards Thomas

Re: [libiberty patch] pex-unix error behaviour

2018-08-21 Thread Nathan Sidwell
On 08/21/2018 03:04 PM, Ian Lance Taylor wrote: On Tue, Aug 21, 2018 at 11:15 AM, Nathan Sidwell wrote: OK, but what about a system that does int vfork() { return fork(); } ? Isn't such a system just buggy? Hm, apparently not. Because of the requirement the user just calls 'exec(), _exi

Re: patch to bug #86829

2018-08-21 Thread Giuliano Augusto Faulin Belinassi
> Just as an example, compare the results for > x = 0x1.fp1023 Thank you for your answer and the counterexample. :-) > If we had useful range info on floats we might conditionalize such > transforms appropriately. Or we can enable it on floats and do > the sqrt (x*x + 1) in double.

Re: PR libstdc++/68222 Hide safe iterator operators

2018-08-21 Thread François Dumont
On 21/08/2018 11:33, Jonathan Wakely wrote: On 18/08/18 22:31 +0200, François Dumont wrote: Here is the new proposal. It is indeed possible to keep _Safe_iterator and just add a _Category template parameter to it. While this is still a large patch (obviously, because it's changing a lot!) I th

Re: [C++ PATCH] Speed up inplace_merge algorithm & fix inefficient logic(PR libstdc++/83938)

2018-08-21 Thread François Dumont
I missed a test that was failing because of this patch. So I revert a small part of it and here is the new proposal. Tested under Linux x86_64, ok to commit ? François On 24/07/2018 12:22, François Dumont wrote: Hi     Any chance to review this patch ? François On 06/06/2018 18:39, Franç

[Patch, Fortran, F08] PR 86888: allocatable components of indirectly recursive type

2018-08-21 Thread Janus Weil
Hi all, the attached patch fixes the PR in the subject line in a rather straightforward fashion. Pointer components of indirectly recursive type are working already, as well as allocatable components of directly recursive type. It seems this case was simply forgotten. The patch regtests cleanly o

Walk pointer_to and reference_to chain in free_lang_data

2018-08-21 Thread Jan Hubicka
Hi, extra sanity checking I am going to send in followup patch noticed that we stream pointer types that was never seen by free_lang_data. This is because they are referenced by TYPE_POINTER_TO list and are inserted into the gimple statements later when we wrap everything in MEM_REF (by make_point

Re: patch to bug #86829

2018-08-21 Thread Jeff Law
On 08/21/2018 02:08 PM, Giuliano Augusto Faulin Belinassi wrote: >> Just as an example, compare the results for >> x = 0x1.fp1023 > > Thank you for your answer and the counterexample. :-) > >> If we had useful range info on floats we might conditionalize such >> transforms appropriate

Re: [PATCH v2][C][ADA] use function descriptors instead of trampolines in C

2018-08-21 Thread Joseph Myers
On Tue, 21 Aug 2018, Uecker, Martin wrote: > > I don't see why this is target-specific (if it is, the documentation for  > > users in invoke.texi should explain what targets it works for and what it  > > doesn't work for) anyway.  I'd expect it to be a target-independent  > > feature with a target

Re: [libiberty patch] pex-unix error behaviour

2018-08-21 Thread Ian Lance Taylor via gcc-patches
On Tue, Aug 21, 2018 at 12:46 PM, Nathan Sidwell wrote: > On 08/21/2018 03:04 PM, Ian Lance Taylor wrote: >> >> On Tue, Aug 21, 2018 at 11:15 AM, Nathan Sidwell wrote: > > >> OK, but what about a system that does >> >> int vfork() { return fork(); } >> >> ? > > > Isn't such a system just buggy? H

Re: [PATCH] Add a character size parameter to c_strlen/get_range_strlen

2018-08-21 Thread Joseph Myers
On Tue, 21 Aug 2018, Martin Sebor wrote: > On 08/21/2018 09:44 AM, Joseph Myers wrote: > > On Tue, 21 Aug 2018, Martin Sebor wrote: > > > > > Sure, but the only valid argument to %ls is wchar_t*. Passing > > > it something else is undefined. > > > > Well, (wchar_t *)"something\0\0\0\0" would be

Re: [PATCH] Add a character size parameter to c_strlen/get_range_strlen

2018-08-21 Thread Jeff Law
On 08/21/2018 10:46 AM, Martin Sebor wrote: > On 08/21/2018 09:56 AM, Jeff Law wrote: >> On 08/21/2018 09:37 AM, Martin Sebor wrote: >>> On 08/21/2018 05:50 AM, Joseph Myers wrote: On Tue, 21 Aug 2018, Martin Sebor wrote: > I still believe it would be simpler, more robust, and safe >>

Re: patch to bug #86829

2018-08-21 Thread Joseph Myers
On Tue, 21 Aug 2018, Jeff Law wrote: > The problem is our VRP implementation doesn't handle any floating point > types at this time. If we had range information for FP types, then > this kind of analysis is precisely what we'd need to do the > transformation regardless of -ffast-math. I don't t

Re: [PATCH] Make strlen range computations more conservative

2018-08-21 Thread Jeff Law
On 08/20/2018 09:15 AM, Bernd Edlinger wrote: > On 08/20/18 16:26, Jeff Law wrote: >> On 08/20/2018 04:23 AM, Bernd Edlinger wrote: >>> On 08/20/18 12:12, Richard Biener wrote: On Wed, Aug 15, 2018 at 6:39 AM Jeff Law wrote: > > On 08/10/2018 10:56 AM, Martin Sebor wrote: >> On 08

Re: [PATCH] Make strlen range computations more conservative

2018-08-21 Thread Jeff Law
On 08/21/2018 02:43 AM, Richard Biener wrote: > On Mon, 20 Aug 2018, Bernd Edlinger wrote: [ snip. ] >> Yes, I found some peanuts on my way. >> >> For instance this fix for PR middle-end/86121 survives bootstrap on >> it's own, and fixes one xfail. >> >> Is it OK for trunk? > > Yes, that's OK for

Re: [PATCH] Make strlen range computations more conservative

2018-08-21 Thread Jeff Law
[ I'm still digesting, but saw something in this that ought to be broken out... ] On 08/19/2018 09:55 AM, Bernd Edlinger wrote: > diff -Npur gcc/tree-ssa-dse.c gcc/tree-ssa-dse.c > --- gcc/tree-ssa-dse.c2018-07-18 21:21:34.0 +0200 > +++ gcc/tree-ssa-dse.c2018-08-19 14:29:32

Re: [PATCH][Middle-end]patch for fixing PR 86519

2018-08-21 Thread Paul Hua
On Wed, Aug 22, 2018 at 2:15 AM Qing Zhao wrote: > > > > On Aug 21, 2018, at 8:07 AM, Paul Hua wrote: > > > > Hi, Qing, > > > > The cfarm machine gcc23 can build mips64el successful, configure with > > "../configure --prefix=/opt/gcc-9 MISSING=texinfo MAKEINFO=missing > > --target=mips64el-linux-

[PATCH] warn for sprintf argument mismatches (PR 87034)

2018-08-21 Thread Martin Sebor
It didn't seem like we were making progress in the debate about warning for sprintf argument mismatches earlier today so I took a couple of hours this afternoon to prototype one of the solutions I was trying to describe. It mostly keeps the existing interface and just extends c_strlen() and the o

Re: Richard Sandiford appointed Global Reviewer

2018-08-21 Thread Bin.Cheng
On Tue, Aug 21, 2018 at 9:59 PM Richard Sandiford wrote: > > David Edelsohn writes: > > I am pleased to announce that the GCC Steering Committee has > > appointed Richard Sandiford as a Global Reviewer. > > > > Please join me in congratulating Richard on his new role. > > Richard, ple

Re: [PATCH] Add a character size parameter to c_strlen/get_range_strlen

2018-08-21 Thread Martin Sebor
On 08/21/2018 03:44 PM, Joseph Myers wrote: On Tue, 21 Aug 2018, Martin Sebor wrote: On 08/21/2018 09:44 AM, Joseph Myers wrote: On Tue, 21 Aug 2018, Martin Sebor wrote: Sure, but the only valid argument to %ls is wchar_t*. Passing it something else is undefined. Well, (wchar_t *)"somethi

[PATCH] print full STRING_CST in Gimple dumps (PR 87052)

2018-08-21 Thread Martin Sebor
In the discussion of the fallout from the enhancement for pr71625 it was pointed out that STRING_CSts in Gimple dumps extend only to the first nul and don't include any subsequent characters, and that this makes the dumps harder to read and might give rise to the question whether the code is corre

Re: [PATCH] Make strlen range computations more conservative

2018-08-21 Thread Bernd Edlinger
On 08/22/18 00:25, Jeff Law wrote: > On 08/21/2018 02:43 AM, Richard Biener wrote: >> On Mon, 20 Aug 2018, Bernd Edlinger wrote: > [ snip. ] > >>> Yes, I found some peanuts on my way. >>> >>> For instance this fix for PR middle-end/86121 survives bootstrap on >>> it's own, and fixes one xfail. >>>

Re: [PATCH] Make strlen range computations more conservative

2018-08-21 Thread Bernd Edlinger
On 08/22/18 00:43, Jeff Law wrote: > [ I'm still digesting, but saw something in this that ought to be broken > out... ] > > On 08/19/2018 09:55 AM, Bernd Edlinger wrote: >> diff -Npur gcc/tree-ssa-dse.c gcc/tree-ssa-dse.c >> --- gcc/tree-ssa-dse.c 2018-07-18 21:21:34.0 +0200 >> +++

  1   2   >