Re: Problem in cxx_fundamental_alignment_p?

2016-07-01 Thread Dodji Seketeli
Hello Bernd, Bernd Schmidt writes: > I came across what I think is a bug in cxx_fundamental_alignment_p. > > User alignments are specified in units of bytes. This is documented, > and we can also see the following in handle_aligned_attribute, for the > case when we have no args: > align_expr =

Re: Status of rich location work (was Re: [PATCH 06/10] Track expression ranges in C frontend)

2015-11-05 Thread Dodji Seketeli
> Talking about risks: the reduction of the space for ordinary maps by a > factor of 32, by taking up 5 bits for the packed range information > optimization (patch 10): > https://gcc.gnu.org/ml/gcc-patches/2015-10/msg02539.html > CCing Dodji: Dodji; is this reasonable? FWIW, I am definitely to ge

Re: [PATCH 10/10] Compress short ranges into source_location

2015-11-04 Thread Dodji Seketeli
[...] > diff --git a/libcpp/line-map.c b/libcpp/line-map.c [...] > + > + /* Any ordinary locations ought to be "pure" at this point: no > + compressed ranges. */ > + linemap_assert (locus < RESERVED_LOCATION_COUNT > + || locus >= LINE_MAP_MAX_LOCATION_WITH_COLS > +

Re: [PATCH 5/5] Add plugin to recursively dump the source-ranges in a tree (v2)

2015-09-27 Thread Dodji Seketeli
David Malcolm a écrit: > This patch adds a test plugin that recurses down an expression tree, > printing diagnostics showing the ranges of each node in the tree. > > It corresponds to: > [PATCH 15/22] Add plugin to recursively dump the source-ranges in a tree > https://gcc.gnu.org/ml/gcc-pa

Re: [RFC PATCH] parse #pragma GCC diagnostic in libcpp

2015-09-26 Thread Dodji Seketeli
Manuel López-Ibáñez writes: > On 25 September 2015 at 17:14, Dodji Seketeli wrote: >> The caller of do_pragma(), which is destringize_and_run() then detects >> that pfile->directive_result.type is set, and then puts the tokens of >> the pragma back into the input stream

Re: [PATCH] v3 of diagnostic_show_locus and rich_location (was Re: [PATCH 2/5] Reimplement diagnostic_show_locus, introducing rich_location classes (v2))

2015-09-26 Thread Dodji Seketeli
[Note to libcpp, C, and Fortran maintainers: we still need your input :-)] Hello, David Malcolm writes: [...] > Here's the revised comment I put in the attached patch: [...] > + The class caches the lookup of the color codes for the above. > + > + The class also has responsibility for tr

Re: [PATCH 4/5] Implement tree expression tracking in C FE (v2)

2015-09-25 Thread Dodji Seketeli
David Malcolm a écrit: > On Fri, 2015-09-25 at 16:06 +0200, Dodji Seketeli wrote: >> Hello, >> >> Similarly to a comment I made on the previous patch of the series, >> >> +++ b/libcpp/include/line-map.h >> >> [...] >> >> struc

Re: [PATCH 2/5] Reimplement diagnostic_show_locus, introducing rich_location classes (v2)

2015-09-25 Thread Dodji Seketeli
Manuel López-Ibáñez a écrit: > On 25 September 2015 at 10:51, Dodji Seketeli wrote: >> The line-map parts are OK to me too, but I have no power on those. So I > > You are listed as "line map" maintainer in MAINTAINERS. I rooted for > you! :) Right, I meant the libc

Re: [PATCH 3/5] Implement token range tracking within libcpp and the C FE (v2)

2015-09-25 Thread Dodji Seketeli
David Malcolm a écrit: > On Fri, 2015-09-25 at 11:13 +0200, Dodji Seketeli wrote: [...] >> Funny; I first overlooked this comment of you, and then when reading the >> patch, I asked myself "why keep the existing location_t" ? I mean, in >> here: >> >&g

Re: [RFC PATCH] parse #pragma GCC diagnostic in libcpp

2015-09-25 Thread Dodji Seketeli
Manuel López-Ibáñez writes: > Currently, #pragma GCC diagnostic is handled entirely by the FE. This > has several drawbacks: > > * PR c++/53431 - C++ preprocessor ignores #pragma GCC diagnostic: The > C++ parser lexes (and preprocesses) before handling the pragmas. > > * PR 53920 - "gcc -E" does

Re: [PATCH 4/5] Implement tree expression tracking in C FE (v2)

2015-09-25 Thread Dodji Seketeli
Hello, Similarly to a comment I made on the previous patch of the series, +++ b/libcpp/include/line-map.h [...] struct GTY(()) location_adhoc_data { source_location locus; + source_range src_range; void * GTY((skip)) data; }; Could we just change the type of locus

Re: PR pretty-print/67567 do not pass NULL as a string

2015-09-25 Thread Dodji Seketeli
Manuel López-Ibáñez a écrit: > 2015-09-15 Manuel López-Ibáñez > > PR pretty-print/67567 > * resolve.c (resolve_fl_procedure): Work-around when iface->module > == NULL. This is OK, thanks. -- Dodji

Re: [PATCH 3/5] Implement token range tracking within libcpp and the C FE (v2)

2015-09-25 Thread Dodji Seketeli
Hello, David Malcolm a écrit: > This is an updated version of: > https://gcc.gnu.org/ml/gcc-patches/2015-09/msg00736.html > > Changes in V2 of the patch: > * c_lex_with_flags: don't write through the range ptr if it's NULL > * don't add any fields to the C++ frontend's cp_token for now >

Re: [PATCH 2/5] Reimplement diagnostic_show_locus, introducing rich_location classes (v2)

2015-09-25 Thread Dodji Seketeli
Hello David, I like this! Thank you very much for working on this. I think this patch is in great shape, and once we agree on some of the nits I have commented on below, I think it should go in. Oh, it also needs the first patch (1/5, dejagnu first) to go in first, as this one depends on it. I

Re: [PATCH] Import liboffloadmic from upstream

2015-09-02 Thread Dodji Seketeli
Ilya Verbin writes: > On Tue, Sep 01, 2015 at 09:58:22 +0200, Dodji Seketeli wrote: >> Woops. can you send me the exact two libraries so that I can see what's >> going wrong? You can quickly file an issue to >> https://sourceware.org/bugzilla/enter_bug.cgi?product=lib

Re: [PATCH] Import liboffloadmic from upstream

2015-09-01 Thread Dodji Seketeli
Ilya Verbin writes: (...) > abidiff: ../../src/abg-comparison.cc:10731: virtual void > abigail::comparison::fn_parm_diff::report(std::ostream&, const string&) > const: Assertion `get_type_diff() && get_type_diff()->to_be_reported()' > failed. > Aborted (core dumped) Woops. can you send me t

Re: [obvious fix] fix off-by-one error when printing the caret character

2015-05-21 Thread Dodji Seketeli
Manuel López-Ibáñez writes: > Index: ChangeLog > === > --- ChangeLog (revision 223445) > +++ ChangeLog (working copy) > @@ -1,3 +1,8 @@ > +2015-05-20 Manuel López-Ibáñez > + > + * diagnostic.c (diagnostic_print_caret_li

Re: [PATCH diagnostics/fortran] Handle two locations for the same diagnostic. Convert all gfc_warning_1 and gfc_notify_std_1 calls

2015-05-18 Thread Dodji Seketeli
Manuel López-Ibáñez writes: > On 15 May 2015 at 10:39, Dodji Seketeli wrote: >> Manuel López-Ibáñez writes: >>> -/* Expand the location of this diagnostic. Use this function for >>> consistency. */ >>> +/* Return the location associated to this diagnostic.

Re: [PATCH diagnostics/fortran] Handle two locations for the same diagnostic. Convert all gfc_warning_1 and gfc_notify_std_1 calls

2015-05-15 Thread Dodji Seketeli
Manuel López-Ibáñez writes: > Thanks for the review. I followed all your suggestions. For the > accessor functions, I was not sure what type you would prefer, so I > implemented them as C++ methods and made use of 'private' to be sure > they are the only way to access the locations array. If you

Re: [PATCH diagnostics/fortran] Handle two locations for the same diagnostic. Convert all gfc_warning_1 and gfc_notify_std_1 calls

2015-05-07 Thread Dodji Seketeli
Hello Manuel, Sorry for my late reply, and thank you very much for working on this. I have looked at the patch and I like it! I guess I just have some few lateral nits to pick. > The Fortran FE allows diagnostics with two different locations. > Depending on whether these locations are on the sa

Re: [PATCH] Quiet down -Wlogical-op a bit (PR c/61534)

2015-04-23 Thread Dodji Seketeli
Hi! Marek Polacek writes: > This patch stifles -Wlogical-op a bit: don't warn if either operand > comes from a macro expansion. As the comment says, it doesn't fix the > bug completely, but it's a simple improvement. I cannot approve this patch, but for what it's worth, I like it and would vot

Re: [PATCH] Fix __has_{cpp_}attribute with -traditional-cpp (PR preprocessor/65238)

2015-03-20 Thread Dodji Seketeli
Jason Merrill writes: > On 03/20/2015 12:48 PM, Jakub Jelinek wrote: >> On Fri, Mar 20, 2015 at 12:30:44PM -0400, Jason Merrill wrote: >>> On 03/11/2015 03:10 PM, Jakub Jelinek wrote: __has_{cpp_,}attribute builtin macros are effectively function-like macros taking one argument (and the

Re: [PATCH] Fix __has_{cpp_}attribute with -traditional-cpp (PR preprocessor/65238)

2015-03-19 Thread Dodji Seketeli
Hello Jakub, Jakub Jelinek writes: > __has_{cpp_,}attribute builtin macros are effectively function-like macros > taking one argument (and the ISO preprocessor expands macros in the argument > which is IMHO desirable), but the traditional preprocessor has been crashing > on them or reporting err

Re: [PATCH] PR preprocessor/64803 - __LINE__ inside macro is not constant

2015-02-02 Thread Dodji Seketeli
Jakub Jelinek writes: > On Mon, Feb 02, 2015 at 03:41:50PM +0100, Dodji Seketeli wrote: >> libcpp/ChangeLog: >> >> * internal.h (cpp_reader::top_most_macro_node): New data member. >> * macro.c (enter_macro_context): Pass the location of the end of >>

Re: [PATCH] PR preprocessor/64803 - __LINE__ inside macro is not constant

2015-02-02 Thread Dodji Seketeli
Jakub Jelinek writes: > On Fri, Jan 30, 2015 at 10:19:26AM +0100, Dodji Seketeli wrote: >> [This is a P1 regression for gcc 5] >> libcpp/ChangeLog: >> >> * internal.h (cpp_reader::top_most_macro_node): New data member. >> * macro.c (enter_macro_conte

Re: [PATCH, libcpp] Do not modify a token once it has been initialized

2015-01-30 Thread Dodji Seketeli
Andreas Schwab writes: >> + /* force the location of the token emitted by _cpp_lex_direct() to > > s/force/Force/ Thanks for noticing this, Andreas! I have updated my local copy of the patch to fix that. Cheers! -- Dodji

[PATCH, libcpp] Do not modify a token once it has been initialized

2015-01-30 Thread Dodji Seketeli
to for trunk when stage 1 re-opens? Cheers, Signed-off-by: Dodji Seketeli --- libcpp/macro.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libcpp/macro.c b/libcpp/macro.c index 9571345..ca199ba 100644 --- a/libcpp/macro.c +++ b/libcpp/macro.c @@ -442,9 +442,12

[PATCH] PR preprocessor/64803 - __LINE__ inside macro is not constant

2015-01-30 Thread Dodji Seketeli
function-like macro, or the location of the expansion point of the top-most object-like macro. (cpp_get_token_1): Store the top-most macro node in the new pfile->top_most_macro_node data member. gcc/testsuite/ChangeLog: * gcc.dg/cpp/builtin-macro-

Re: [PATCH] Don't emit backtrace from driver upon fatal compiler signals

2015-01-22 Thread Dodji Seketeli
Ian Lance Taylor writes: > On Thu, Jan 22, 2015 at 12:35 PM, Jakub Jelinek wrote: >> >> 2015-01-22 Jakub Jelinek >> >> * diagnostic-core.h (internal_error_no_backtrace): New prototype. >> * diagnostic.def (DK_ICE_NOBT): New kind. >> * diagnostic.c (diagnostic_action_af

Re: [PATCH] -f{no-sanitize,{,no-}sanitize-recover}=all support

2015-01-06 Thread Dodji Seketeli
Jakub Jelinek writes: > On Mon, Jan 05, 2015 at 10:40:37PM +0100, Jakub Jelinek wrote: >> > Are there any doc updates that need to happen as a result of this patch? >> > Patch itself is fine for the trunk, just want to make sure the doc side is >> > good too. >> >> You're right, I'll add documen

Re: [RFC] diagnostics.c: For terminals, restrict messages to terminal width?

2014-12-11 Thread Dodji Seketeli
Tobias Burnus writes: > 2014-12-06 Tobias Burnus > Manuel L³pez-Ib¡±ez > > gcc/ > * diagnostic.c (get_terminal_width): Renamed from getenv_columns, > removed static, and additionally use ioctl to get width. > (diagnostic_set_caret_max_width): Update call. >

Re: [PATCH fortran/diagnostics] Move gfc_error (buffered) to common diagnostics (try 2)

2014-12-11 Thread Dodji Seketeli
Manuel López-Ibáñez writes: > New version using XNEW. Bootstrapped & tested on x86_64-linux-gnu. > > OK? The diagnostics infrastructure changes are OK for me. Thanks! Cheers, -- Dodji

Re: [RFC] diagnostics.c: For terminals, restrict messages to terminal width?

2014-12-10 Thread Dodji Seketeli
Manuel López-Ibáñez writes: [...] > On 10 December 2014 at 12:10, Dodji Seketeli wrote: [...] >> Manuel, was there a particular reason to avoid mentioning the COLUMNS >> environment variable in the documentation? > > Not that I remember. Perhaps the documentation should

Re: [PATCH fortran/diagnostics] Move gfc_error (buffered) to common diagnostics

2014-12-10 Thread Dodji Seketeli
Hello Manuel, Manuel López-Ibáñez writes: > New version of the patch. Tobias noticed several problems with the > previous version: > > * Due to the use of placement-new for the buffered output_buffers > pp_warning_buffer and pp_error_buffer, the pretty-printer destructor > may end up trying to f

Re: [RFC] diagnostics.c: For terminals, restrict messages to terminal width?

2014-12-10 Thread Dodji Seketeli
Hello Tobias, Thank you for this patch. I have a few comments about it below. Just as a heads-up, I am asking questions to Manuel in there, as well as referring to comments from FX's. Please read below. Tobias Burnus writes: > This patch fixes a Fortran diagnostic "regression". > > With the

Re: [PATCH obvious/diagnostics] Honor override_column when printing the caret

2014-12-03 Thread Dodji Seketeli
Manuel López-Ibáñez writes: > libcpp uses diagnostic->override_column to give a custom column number > to diagnostics. This is taken into account when building the prefix, > but it was missing when placing the caret. > > Before: > > /home/manuel/override_column.c:1:4: warning: "/*" within comment

Re: [PATCH fortran/linemap] Add enough column hint to fit any possible offset

2014-12-02 Thread Dodji Seketeli
Hello Manuel, Tobias, Manuel López-Ibáñez writes: > This patch actually does not touch linemap but I will appreciate > Dodji's comments about the approach. Thanks :-) > The problem is that in case of long lines, the column hint of 120 > might be too small, thus we do not have enough locations

Re: [PATCH linemap] Make some asserts fail gracefully

2014-12-02 Thread Dodji Seketeli
Manuel López-Ibáñez writes: > +/* Assert that becomes a conditional expression when not checking. For the sake of clarity towards newcomers, I'd say: Assert that becomes a conditional expression when checking is disabled at compilation time. > + Use this for conditions that should n

Re: [RFC diagnostics/fortran] Move gfc_warning (buffered) to the common diagnostics machinery

2014-12-01 Thread Dodji Seketeli
Manuel López-Ibáñez writes: > * Dodji: Do the common diagnostics part look reasonable? Yes they do. I just have one minor comment nit: [...] > Index: gcc/pretty-print.h [...] > + > + /* Nonzero means that text should be flushed when > + appropriate. Otherwise, text is buffered until ei

Re: RFA (diagnostics): PATCH to move deprecated source location to separate note

2014-11-18 Thread Dodji Seketeli
Jason Merrill writes: > When I was fixing attribute deprecated for C++ templates, I found it > odd that the source location for the deprecated decl was embedded in > the warning rather than in a separate inform. This patch moves it > out. > > Tested x86_64-pc-linux-gnu. OK for trunk? Yes. Tha

Re: [PR c/52952] More precise locations within format strings

2014-11-17 Thread Dodji Seketeli
Jeff Law writes: > OK, let's go ahead and make that official. Please update MAINTAINERS ;-) I have just added a line for myself as a maintainer for the line map sub system in the MAINTAINERS file. Thanks! -- Dodji

Add more comments to some gimple property accessors

2014-11-14 Thread Dodji Seketeli
accessors. Signed-off-by: Dodji Seketeli --- gcc/gimple.h | 57 +++-- 1 file changed, 51 insertions(+), 6 deletions(-) diff --git a/gcc/gimple.h b/gcc/gimple.h index c7aaa81..27bb7b6 100644 --- a/gcc/gimple.h +++ b/gcc/gimple.h @@ -1585,

Re: [PATCH] Optimize ASAN_CHECK checks

2014-11-14 Thread Dodji Seketeli
Jakub Jelinek writes: >> I am not sure, but I am wondering if we shouldn't save the previous uid >> of 'stmt' here before setting it, and then restore it before getting out >> of this function. > > No, gimple uids are AFAIK undefined at the start of passes, passes that use > them are supposed to

Re: [PATCH] Optimize ASAN_CHECK checks

2014-11-14 Thread Dodji Seketeli
Jakub Jelinek writes: > On Wed, Nov 12, 2014 at 02:09:59PM +0300, Yury Gribov wrote: > > >For asan you're right, we can have addresses of decls there etc. > > >If you have spare cycles, feel free to take over the patch and adjust it. > > > > I guess I'd wait when this gets to trunk? > > Ok, in

Re: [PR c/52952] More precise locations within format strings

2014-11-11 Thread Dodji Seketeli
Joseph Myers writes: [...] >> Neither Per nor Tom are active in GCC anymore. If the FE maintainers >> do not feel comfortable reviewing line-map changes, could you nominate >> Dodji as line-map maintainer if he is willing to accept it? I think he >> is currently the person that understands that

Re: [PATCH diagnostics/fortran] dynamically generate locations from offset + handle %C

2014-10-23 Thread Dodji Seketeli
Sorry, I forgot to make it clear that I have no power to approve the line-map changes. I just gave my casual point view; so please take it for what it is worth. I am CC-ing Tom and Jason who can approve this. Cheers. Dodji Seketeli writes: > Hello Manuel, > > Manuel López-Ibáñe

Re: [PATCH diagnostics/fortran] dynamically generate locations from offset + handle %C

2014-10-23 Thread Dodji Seketeli
Hello Manuel, Manuel López-Ibáñez writes: > Dodji, are the linemap_asserts() appropriate? Yes they are. I have some additional comments though. > libcpp/ChangeLog: > > 2014-10-16 Manuel López-Ibáñez > > PR fortran/44054 > * include/line-map.h (linemap_position_for_loc_and_offset):

Re: C/C++ diagnostics guidelines

2014-10-23 Thread Dodji Seketeli
Manuel López-Ibáñez writes: > On 17 October 2014 20:04, Manuel López-Ibáñez wrote: >> On 17 October 2014 19:33, Joseph S. Myers wrote: >>> On Fri, 17 Oct 2014, Manuel López-Ibáñez wrote: >>> Thus, I drafted some guidelines at:https://gcc.gnu.org/wiki/Better_Diagnostics#guidelines

Re: C/C++ diagnostics guidelines

2014-10-23 Thread Dodji Seketeli
Manuel López-Ibáñez writes: > On 17 October 2014 19:33, Joseph S. Myers wrote: >> On Fri, 17 Oct 2014, Manuel López-Ibáñez wrote: >> >>> Thus, I drafted some guidelines >>> at:https://gcc.gnu.org/wiki/Better_Diagnostics#guidelines >>> >>> Please, could you take a look and comment whether I got i

Re: [PATCH diagnostics] PR 53061 cleanup initialization

2014-10-23 Thread Dodji Seketeli
Hello Manuel, Manuel López-Ibáñez writes: > This is an old patch of mine that never got finished. I updated it following > the suggestions of Gabriel here > https://gcc.gnu.org/ml/gcc-patches/2012-04/msg00443.html Thanks for looking at this again. > Bootstrapped and tested on x86_64-linux-gnu.

Re: [PATCH] cleanups in line-map

2014-10-13 Thread Dodji Seketeli
Manuel López-Ibáñez writes: > A few cleanups in line-map code. Bootstrapped and regression tested on > x86_64-linux-gnu. Thanks for doing this. > OK? Yes, barring this little nit: [...] > Index: libcpp/line-map.c > === > --- lib

Re: [PATCH 2/2] PR debug/63240 Add DWARF representation for C++11 defaulted member function.

2014-10-07 Thread Dodji Seketeli
Jason Merrill writes: > On 10/06/2014 08:50 PM, Siva Chandra wrote: >> On Sat, Oct 4, 2014 at 11:14 AM, Jason Merrill wrote: >>> On 10/03/2014 05:41 PM, Siva Chandra wrote: I understand that knowing whether a copy-ctor or a d-tor has been explicitly defaulted is not sufficient to

Re: [PATCH] Provide global var location info for asan

2014-10-06 Thread Dodji Seketeli
Hello, Jakub Jelinek writes: > 2014-09-24 Jakub Jelinek > > * ubsan.h (ubsan_get_source_location): New prototype. > * ubsan.c (ubsan_source_location_type): New variable. > Function renamed to ... > (ubsan_get_source_location_type): ... this. Cache > return value

Re: [RFC/PATCH] More precise diagnostic locations: dynamic locations for columns vs explicit offset

2014-09-25 Thread Dodji Seketeli
Manuel López-Ibáñez a écrit: > In some situations, we would like to point to a location which was not > encoded when tokenizing. This happens, for example, in two prominent > cases: > > 1) To get precise locations within strings > (https://gcc.gnu.org/PR52952) for example, for Wformat warnings.

Re: [RFC/PATCH] Fix-it hints

2014-09-25 Thread Dodji Seketeli
Hello Manuel, Sorry for taking so long to reply to this. FWIW, I like the direction of this. I find fix-it hints cool in general. So thank you for working on this. Manuel López-Ibáñez a écrit: > This patch implements fix-it hints. See https://gcc.gnu.org/PR62314 > > When the caret line is ac

Re: [PATCH/PR c/59304] #pragma diagnostic pop after warning fails for options unspecified in the command-line and disabled by default

2014-08-20 Thread Dodji Seketeli
Hello Manuel, Manuel López-Ibáñez writes: > The idea is that when we see a change of classification, and the > option was originally unspecified, we record the command-line status. > This way, when doing pop later, we already check if the option was > reclassified so we get the command-line stat

Re: [PATCH diagnostics/Fortran] Implement Fortran prefix/caret style using the common diagnostics machinery

2014-08-20 Thread Dodji Seketeli
Hello Manuel, Manuel López-Ibáñez writes: > Hi, > > This patch is relative to this one here: > https://gcc.gnu.org/ml/gcc-patches/2014-08/msg01652.html > > It implements the Fortran style of prefix and caret line in the > gfc_diagnostic_starter by using the common pretty-printer. > > This requir

Re: [PATCH] Move caret printing to diagnostics_finalizer

2014-08-19 Thread Dodji Seketeli
Manuel López-Ibáñez writes: > This patch is in preparation for further patches moving the Fortran FE > to use the common diagnostics machinery. > > Fortran has its own way of printing the caret information, so we need > a way to override the default in the diagnostics machinery. A simple > way is

Re: [PATCH] Fix UB in diagnostic.c

2014-08-17 Thread Dodji Seketeli
Marek Polacek a écrit: > On Wed, Aug 13, 2014 at 09:03:37PM +0200, Manuel López-Ibáñez wrote: >> I don't think this is the right fix. The problem is that we are trying >> to print the caret in a column that is larger than the line_width. We >> do this because the file given by the line directive

Re: [PATCH] Handle -fsanitize=leak more similarly to address/thread

2014-08-17 Thread Dodji Seketeli
Jakub Jelinek writes: > Right now when -fsanitize=leak adds -llsan, it adds it late on the command > line, so e.g. -lstdc++ comes after it, which seems to be bad. > The following patch puts it early on the link command line like we do for > -lasan or -ltsan. Bootstrapped/regtested on x86_64-lin

Re: [C PATCH] Diagnose predefined identifiers in pedantic mode

2014-08-12 Thread Dodji Seketeli
Marek Polacek a écrit: > Thise testcases use predefined identifiers, and without the > dg-options, they would compile with -ansi -pedantic-errors and fail. > Setting dg-options to "" makes the -ansi -pedantic-errors go away. > Setting it to e.g. -std=gnu99 would work as well. Oh, I see. Thanks.

Re: [C PATCH] Diagnose predefined identifiers in pedantic mode

2014-08-11 Thread Dodji Seketeli
Marek Polacek a écrit: > diff --git gcc/testsuite/gcc.dg/concat.c gcc/testsuite/gcc.dg/concat.c > index 0b9d6f6..e3bfd46 100644 > --- gcc/testsuite/gcc.dg/concat.c > +++ gcc/testsuite/gcc.dg/concat.c > @@ -1,6 +1,7 @@ > /* Copyright (C) 2001 Free Software Foundation, Inc. */ > > /* { dg-do

Re: [PATCH] PR preprocessor/61817 - Fix location of tokens in built-in macro expansion list

2014-08-11 Thread Dodji Seketeli
E__ expands to accordlingly. (builtin_macro): Use cpp_force_token_locations() to set the location of the resulting token to that expansion point location. (enter_macro_context): Pass the expansion point locatoin to builtin_macro. gcc/testsuite/ *

Re: [PATCH Fortran/Diagnostics] Move Fortran to common diagnostics machinery

2014-08-08 Thread Dodji Seketeli
Hello Manuel, Manuel López-Ibáñez writes: > 2014-08-03 Manuel López-Ibáñez > > PR fortran/44054 > c-family/ > * c-format.c: Handle Fortran flags. > * diagnostic.c (build_message_string): Make it extern. > * diagnostic.h (build_message_string): Make it extern. Small nit; the d

[PATCH] PR preprocessor/61817 - Fix location of tokens in built-in macro expansion list

2014-07-16 Thread Dodji Seketeli
builtin_macro_text): Honor the cpp_reader::forced_token_location_p data member to force the value __LINE__ expands to accordlingly. (builtin_macro): Take the expansion point location as parameter. Use cpp_force_token_locations() to set the location of the resulti

Re: [PATCH 1/2] Support location tracking for built-in macro tokens

2014-07-16 Thread Dodji Seketeli
Richard Biener writes: > On Tue, Jul 15, 2014 at 3:27 PM, Dodji Seketeli wrote: >> Hello, >> >> When a built-in macro is expanded, the location of the token in the >> epansion list is the location of the expansion point of the built-in >> macro. >> >&

Re: [PATCH] PR preprocessor/60723 - missing system-ness marks for macro

2014-07-15 Thread Dodji Seketeli
Hello Nicholas, Nicholas Ormrod writes: [...] > If you are also going to fix the locations of built-in tokens, it > would also be worth adjusting their expansion locations. As mentioned > in the bug report, built-in tokens are expanded at the closing paren > of a macro call, whereas non-built-i

Re: [PATCH 1/2] Support location tracking for built-in macro tokens

2014-07-15 Thread Dodji Seketeli
I forgot to say that ... Dodji Seketeli writes: [...] > When a built-in macro is expanded, the location of the token in the > epansion list is the location of the expansion point of the built-in > macro. > > This patch creates a virtual location for that token instead, > ef

[PATCH 2/2] PR preprocessor/60723 - missing system-ness marks for macro tokens

2014-07-15 Thread Dodji Seketeli
/testsuite/ChangeLog: * gcc.dg/cpp/syshdr{4,5}.{c,h}: New test files. Signed-off-by: Dodji Seketeli git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212194 138bc75d-0d04-0410-961f-82ee72b054a4 Signed-off-by: Dodji Seketeli --- gcc/c-family/c-ppoutput.c | 81

[PATCH 1/2] Support location tracking for built-in macro tokens

2014-07-15 Thread Dodji Seketeli
definition. * toplev.c (general_init): Tell libcpp what the pre-defined spelling location for built-in tokens is. Signed-off-by: Dodji Seketeli --- gcc/input.c | 16 gcc/input.h | 1 + gcc/toplev.c | 2 +- libcpp

Re: [PATCH] PR preprocessor/60723 - missing system-ness marks for macro

2014-07-15 Thread Dodji Seketeli
Hello, Jason Merrill writes: >> // preprocessed output >> # 3 "test.cpp" 3 4 >> sys_token >> # 3 "test.cpp" >> 3 >> # 3 "test.cpp" 3 4 >> sys_token >>> Yeah. For Built-in tokens that are expanded like that we only do track their the location of their expans

Re: [PATCH] PR preprocessor/60723 - missing system-ness marks for macro

2014-07-10 Thread Dodji Seketeli
Jason Merrill writes: > On 07/04/2014 05:13 AM, Dodji Seketeli wrote: >>> >// preprocessed output >>> ># 3 "test.cpp" 3 4 >>> >sys_token >>> ># 3 "test.cpp" >>> >3 >>> ># 3 "test.cpp" 3 4

Re: [PATCH] PR preprocessor/60723 - missing system-ness marks for macro

2014-07-04 Thread Dodji Seketeli
Hello Nicholas, Nicholas Ormrod writes: > I found time this morning to run your changes through our system. I > patched our gcc-4.8.1 with your latest change, and ran it through our > folly testsuite. Thanks! > One thing that I immediately noticed was that this increased the preprocessed > si

Re: [PATCH] PR preprocessor/60723 - missing system-ness marks for macro

2014-07-03 Thread Dodji Seketeli
Jason Merrill writes: > On 06/27/2014 03:27 AM, Dodji Seketeli wrote: >> + && print.prev_was_system_token != !!in_system_header_at(loc)) >> +/* The system-ness of this token is different from the one >> + of the previous token.

[PATCH] PR preprocessor/60723 - missing system-ness marks for macro

2014-06-27 Thread Dodji Seketeli
. (scan_translation_unit_directives_only): Adjust. gcc/testsuite/ChangeLog: * gcc.dg/cpp/syshdr{4,5}.{c,h}: New test files. Signed-off-by: Dodji Seketeli --- gcc/c-family/c-ppoutput.c | 76 ++ gcc/testsuite/gcc.dg/cpp/syshdr4.c | 24

Re: [PATCH, cpp] Fix line directive bug

2014-06-25 Thread Dodji Seketeli
Hello Nicholas, Nicholas Ormrod a écrit: > We currently have two possible approaches. I see the trade-offs between these > two solutions as follows: > > Adding full line directives is not implemented, and will be more > complicated than my patch. It will require someone else to implement > it,

Re: [PATCH, cpp] Fix line directive bug‏

2014-06-19 Thread Dodji Seketeli
Hello Nicholas, First of all, thank you for taking the time to dive into this code and provide such a detailed analysis along with a patch. This is appreciated. Please find below my comments to some parts of your message. Nicholas Ormrod a écrit: > PR preprocessor/60723 > > Description: > >

Re: libsanitizer merge from upstream r208536

2014-05-30 Thread Dodji Seketeli
Jakub Jelinek writes: [...] > Here is the GCC side of the thing, [...] > 2014-05-23 Jakub Jelinek > > * asan.c (report_error_func): Add SLOW_P argument, use > BUILT_IN_ASAN_*_N if set. > (build_check_stmt): Likewise. > (instrument_derefs): If T has insufficient ali

Re: libsanitizer merge from upstream r208536

2014-05-30 Thread Dodji Seketeli
Jakub Jelinek writes: > On Thu, May 22, 2014 at 04:07:38PM +0200, Jakub Jelinek wrote: >> 2014-05-22 Jakub Jelinek >> >> * sanitizer.def (BUILT_IN_ASAN_REPORT_LOAD_N, >> BUILT_IN_ASAN_REPORT_STORE_N): New. >> * asan.c (struct asan_mem_ref): Change access_size type to >> HO

Re: libsanitizer merge from upstream r208536

2014-05-30 Thread Dodji Seketeli
Jakub Jelinek writes: [...] > Ok, tried to merge also g++.dg/asan from the same revision as you've merged > libsanitizer. [...] > > 2014-05-22 Jakub Jelinek > > * g++.dg/asan/asan_test.C: Add -std=c++11 and > -DSANITIZER_USE_DEJAGNU_GTEST=1 to dg-options, remove > -DASAN_U

Re: [PATCH] Fix -ftrack-macro-expansion preprocessing of A######A (PR preprocessor/58844)

2014-02-19 Thread Dodji Seketeli
Jakub Jelinek writes: > Hi! > > The following testcase build with -ftrack-macro-expansion=0, > but don't build otherwise. The problem seems to be that > the libcpp for macro redefinition warning/error purposes if it sees > more than one paste operator adds those extra CPP_PASTE tokens at the end

Re: [PATCH] preprocessor/58580 - preprocessor goes OOM with warning for zero literals

2014-01-29 Thread Dodji Seketeli
f --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a468447..2da 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-01-29 Dodji Seketeli + + * c-c++-common/cpp/warning-zero-location-2.c: Fix error message + selector. + 2014

Re: [PATCH] preprocessor/58580 - preprocessor goes OOM with warning for zero literals

2014-01-28 Thread Dodji Seketeli
Dodji Seketeli writes: > Here is the patch I am committing right now. > > gcc/ChangeLog > > * input.c (location_get_source_line): Bail out on when line number > is zero, and test the return value of > lookup_or_add_file_to_cache_tab. > > gcc/testsuit

Re: [PATCH] preprocessor/58580 - preprocessor goes OOM with warning for zero literals

2014-01-28 Thread Dodji Seketeli
Here is the patch I am committing right now. gcc/ChangeLog * input.c (location_get_source_line): Bail out on when line number is zero, and test the return value of lookup_or_add_file_to_cache_tab. gcc/testsuite/ChangeLog * c-c++-common/cpp/warning-zero-location.c

Re: [PATCH] preprocessor/58580 - preprocessor goes OOM with warning for zero literals

2014-01-24 Thread Dodji Seketeli
Jakub Jelinek writes: > On Fri, Jan 24, 2014 at 04:40:52PM +0100, Dodji Seketeli wrote: >> > The patch causes http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59935 . >> > The follow-up patch (fp == NULL check) doesn't help. >> >> I am looking into that, sorry

Re: [PATCH] preprocessor/58580 - preprocessor goes OOM with warning for zero literals

2014-01-24 Thread Dodji Seketeli
Markus Trippelsdorf writes: > On 2014.01.22 at 09:16 +0100, Dodji Seketeli wrote: >> Bernd Edlinger writes: >> >> > Hi, >> >> Hello, >> >> > since there was no progress in the last 2 months on that matter, >> >> Sorry, this is

Re: [PATCH] preprocessor/58580 - preprocessor goes OOM with warning for zero literals

2014-01-23 Thread Dodji Seketeli
Jakub Jelinek writes: > On Wed, Jan 22, 2014 at 09:16:02AM +0100, Dodji Seketeli wrote: >> +static fcache* >> +add_file_to_cache_tab (const char *file_path) >> +{ >> + >> + FILE *fp = fopen (file_path, "r"); >> + if (ferror (fp)) >&

Re: [PATCH] preprocessor/58580 - preprocessor goes OOM with warning for zero literals

2014-01-22 Thread Dodji Seketeli
e reach the size of the line. * Makefile.in: Add vec.o to OBJS-libcommon gcc/testsuite/ChangeLog: * c-c++-common/cpp/warning-zero-in-literals-1.c: New test file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204453 138bc75d-0d04-0410-961f-82ee72b054a4 Signed-off-by: Dodji Seketel

Re: [PATCH] libsanitizer demangling using cp-demangle.c

2014-01-09 Thread Dodji Seketeli
Jakub Jelinek a écrit: > > 2013-12-10 Jakub Jelinek > > * sanitizer_common/sanitizer_symbolizer_libbacktrace.h > (LibbacktraceSymbolizer::Demangle): New declaration. > * sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc > (POSIXSymbolizer::Demangle): Use libbacktr

Re: [PATCH] Use libbacktrace for libsanitizer symbolization (take 2, PR sanitizer/59136)

2014-01-09 Thread Dodji Seketeli
Jakub Jelinek writes: > This is a second attempt at libsanitizer symbolization using > libbacktrace. The compiler-rt maintained bit have been > already added by the recent merge from compiler-rt, so this > patch is mostly configury/Makefile stuff. Rather than using > libbacktrace.la built in li

Re: [PATCH] Allow building if libsanitizer on RHEL5 (i.e. with 2.6.18-ish kernel headers, take 2)

2014-01-09 Thread Dodji Seketeli
Jakub Jelinek writes: > Hi! > > Here is an updated version which doesn't warn about #include_next. > Ok for trunk? > > 2013-12-10 Jakub Jelinek > > * sanitizer_common/Makefile.am (AM_CPPFLAGS): Add > -isystem $(top_srcdir)/include/system. > * sanitizer_common/Makefile.in: Reg

Re: [PATCH] Put a breakpoint on __asan_report_error for ASAN

2013-12-02 Thread Dodji Seketeli
"H.J. Lu" a écrit: >> 2012-11-24 H.J. Lu >> >> * configure.ac: Append gdbasan.in to .gdbinit if CFLAGS contains >> -fsanitize=address. >> * configure: Regenerated. >> >> * gdbasan.in: New file. This is OK, if nobody objects in the next 48h. Thanks. --

Re: [PATCH] Support -fsanitize=leak

2013-11-22 Thread Dodji Seketeli
Jakub Jelinek writes: > This patch adds support for -fsanitize=leak and -static-liblsan options. > If combined with -fsanitize=address, it does nothing, >From this hunk: @@ -8123,7 +8133,10 @@ sanitize_spec_function (int argc, const return (flag_sanitize & SANITIZE_THREAD) ? "" : N

Re: [PATCH] Asan constructor init order checking

2013-11-22 Thread Dodji Seketeli
Jakub Jelinek writes: > On Fri, Nov 22, 2013 at 04:38:58PM +0100, Dodji Seketeli wrote: >> Jakub Jelinek writes: >> >> > --- gcc/cgraph.h.jj2013-11-13 18:32:52.0 +0100 >> > +++ gcc/cgraph.h 2013-11-15 12:05:25.950985500 +0100 >>

Re: [PATCH] Asan constructor init order checking

2013-11-22 Thread Dodji Seketeli
Dodji Seketeli writes: > Also, do we have some tests for this? I am not sure how I'd write > multi-tu dejagnu tests for this myself though ;-) Woops, I have just seen the sub-thread about the tests with Konstantin, you and Alexey. Sorry. Cheers. -- Dodji

Re: [PATCH] Asan constructor init order checking

2013-11-22 Thread Dodji Seketeli
Hello, Jakub Jelinek writes: > --- gcc/cgraph.h.jj 2013-11-13 18:32:52.0 +0100 > +++ gcc/cgraph.h 2013-11-15 12:05:25.950985500 +0100 > @@ -520,6 +520,11 @@ class GTY((tag ("SYMTAB_VARIABLE"))) var > public: >/* Set when variable is scheduled to be assembled. */ >unsigne

Re: [PATCH] preprocessor/58580 - preprocessor goes OOM with warning for zero literals

2013-11-14 Thread Dodji Seketeli
Jakub Jelinek writes: > On Tue, Nov 12, 2013 at 04:33:41PM +0100, Dodji Seketeli wrote: >> + >> + memmove (*line, l, len); >> + (*line)[len - 1] = '\0'; >> + *line_len = --len; > > Shouldn't this be testing that len > 0 &

Re: [patch] Fix ICEs when DEBUG_MANGLE is enabled

2013-11-14 Thread Dodji Seketeli
I guess we should CC Jason for this ... ccout...@google.com (Cary Coutant) a écrit: This patch fixes a few ICEs I encountered when enabling DEBUG_MANGLE. I've also changed dump_substitution_candidates to output the substitution index in base 36, to match the actual mangled name. OK for trunk? -

Re: [PATCH] preprocessor/58580 - preprocessor goes OOM with warning for zero literals

2013-11-13 Thread Dodji Seketeli
Sorry, I missed one question in the previous email. Bernd Edlinger writes: > and what is it if there is no terminal '\n' ? In that case it's that the entire file is made of one line. For that case get_next_line has allocated enough space for one byte-passed-the-end of the file, so that there i

Re: [PATCH] preprocessor/58580 - preprocessor goes OOM with warning for zero literals

2013-11-13 Thread Dodji Seketeli
Bernd Edlinger writes: >>> Using -- on a value that goes out of scope looks >>> awkward IMHO. >> >> I don't understand this sentence. What do you mean by "Using -- on a >> value that goes out of scope"? >> > > I meant the operator --  in  *line_len = --len; Sorry, I don't see how that is an issu

  1   2   3   4   5   6   >