Re: [C/C++] Do not pretty-print expressions with caret diagnostics for wrong function call

2012-04-21 Thread Gabriel Dos Reis
I don't think the proper fix is to copy Clang. Clang isn't the gold standard and we shouldn't act as if it was. When caret is not enable, the diagnostic should mention clearly the elements in the input expressions that are problematic without getting obtuse or elliptic -- two extremes easy to fall

Re: [C/C++] Do not pretty-print expressions with caret diagnostics for wrong function call

2012-04-21 Thread Manuel López-Ibáñez
On 21 April 2012 18:49, Jakub Jelinek wrote: > > Before we start to add many similar tests, I wonder if we shouldn't > test not just that caret diagnostics is on, but that it will be actually > printed for the specific locus.  The source could come up from > stdin, or the file no longer available,

Re: [PATCH] Fix PR53031

2012-04-21 Thread H.J. Lu
On Thu, Apr 19, 2012 at 5:47 AM, Richard Guenther wrote: > > This fixes PR53031 and reverts back to using the number of latch > iterations in VRP when computing ranges for induction variables. > Now after ira_allocno_object_iter_cond is fixed this no longer > breaks bootstrap. > > Bootstrapped on

Re: [PATCH][1/2] Fix PR44688, set and preserve the maximum iterations of vectorizer prologue loops

2012-04-21 Thread H.J. Lu
On Wed, Apr 18, 2012 at 4:30 AM, Richard Guenther wrote: > > Finally. > > Boostrapped and tested on x86_64-unknown-linux-gnu, applied to trunk. > > Richard. > > 2012-04-18  Richard Guenther   > >        PR tree-optimization/44688 >        * cfgloop.h (record_niter_bound): Declare. >        * tree-

Re: [PATCH] Fix parts of PR52975

2012-04-21 Thread H.J. Lu
On Mon, Apr 16, 2012 at 2:22 AM, Richard Guenther wrote: > > When looking at the code we produce from if-conversion and vectorization > I noticed several things.  For one, we are not handling TARGET_MEM_REF > in operand_equal_p which means that DOM does not clean up loads/stores > of that form (to

[committed] Clean up ADDRESS handling in alias.c, take 2

2012-04-21 Thread Richard Sandiford
To compound my woe on this one: it turns out that there's also a use of ADDRESS in store-motion.c. Obviously a very poor grep session on my part. dse.c and store-motion.c are checking for the same thing, and they are also the only two external users of find_base_term. It seemed better to define

[committed] Restore fold checking

2012-04-21 Thread Richard Sandiford
Noticed after making yes,rtl,df,fold my default --enable-checking option (the rtl and df bits being long overdue). Bootstrapped & regression-tested on x86_64-linux-gnu and installed as obvious. Richard gcc/ * fold-const.c (fold_checksum_tree): Fix VECTOR_CST case. Index: gcc/fold-const

libgo patch committed: More syscall package improvements

2012-04-21 Thread Ian Lance Taylor
This patch to libgo brings the syscall package closer to the one provided on GNU/Linux systems by the master Go library. This is mostly additional constants, but also corrects the Tgkill and Mount functions. This an incremental step; there is more work to do. Bootstrapped and ran Go testsuite on

Re: rfa: vectorize strided loads [2/2] [PR 18437]

2012-04-21 Thread H.J. Lu
On Sat, Apr 21, 2012 at 11:11 AM, H.J. Lu wrote: > On Tue, Apr 10, 2012 at 6:46 AM, Michael Matz wrote: >> Hi, >> > >> Michael. >> >>        PR tree-optimization/18437 >> >>        * tree-vectorizer.h (_stmt_vec_info.stride_load_p): New member. >>        (STMT_VINFO_STRIDE_LOAD_P): New accessor.

Re: rfa: vectorize strided loads [2/2] [PR 18437]

2012-04-21 Thread H.J. Lu
On Tue, Apr 10, 2012 at 6:46 AM, Michael Matz wrote: > Hi, > > Michael. > >        PR tree-optimization/18437 > >        * tree-vectorizer.h (_stmt_vec_info.stride_load_p): New member. >        (STMT_VINFO_STRIDE_LOAD_P): New accessor. >        (vect_check_strided_load): Declare. >        * tree-

Re: [PATCH] Fix PR53011

2012-04-21 Thread H.J. Lu
On Sat, Apr 21, 2012 at 10:19 AM, H.J. Lu wrote: > On Tue, Apr 17, 2012 at 6:38 AM, Richard Guenther wrote: >> >> This fixes PR53011 - EH cleanup needs to cater for loops now >> (or avoid some transforms). >> >> Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk. >> >> Richard.

Re: [C/C++] Do not pretty-print expressions with caret diagnostics for wrong function call

2012-04-21 Thread Jakub Jelinek
On Sat, Apr 21, 2012 at 04:06:17PM +0200, Manuel López-Ibáñez wrote: > This patch avoids pretty-printing expressions when the caret is > enabled for the error given when calling as a function something that > is not a function. > > This fixes (when caret is enabled) the bugs described in PR35441 a

Re: [PATCH] Fix PR53011

2012-04-21 Thread H.J. Lu
On Tue, Apr 17, 2012 at 6:38 AM, Richard Guenther wrote: > > This fixes PR53011 - EH cleanup needs to cater for loops now > (or avoid some transforms). > > Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk. > > Richard. This caused: http://gcc.gnu.org/bugzilla/show_bug.cgi?id

[PATCH] genattrtab: avoid NULL-deref on error

2012-04-21 Thread Jim Meyering
I see that no one responded when I posted this in February. Ok to commit, now? 2012-02-24 Jim Meyering * genattrtab.c (gen_attr): Avoid NULL-deref after diagnosing absence of an define_enum call. diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c index 4a4c2a2..bfbe3e8 100644 -

Re: [RFC] improve caret diagnostics for overload failures

2012-04-21 Thread Gabriel Dos Reis
On Sat, Apr 21, 2012 at 9:42 AM, Jakub Jelinek wrote: > On Sat, Apr 21, 2012 at 04:26:32PM +0200, Manuel López-Ibáñez wrote: >> On 21 April 2012 16:22, Gabriel Dos Reis >> wrote: >> > Do no use 'char' as the type of a flag.  Prefer 'unsigned int'. >> > >> >> Thanks, good catch! Should I worry ab

Re: [RFC] improve caret diagnostics for overload failures

2012-04-21 Thread Jakub Jelinek
On Sat, Apr 21, 2012 at 04:26:32PM +0200, Manuel López-Ibáñez wrote: > On 21 April 2012 16:22, Gabriel Dos Reis > wrote: > > Do no use 'char' as the type of a flag.  Prefer 'unsigned int'. > > > > Thanks, good catch! Should I worry about memory here and use something > shorter? If it is a bool

Re: [C/C++] Do not pretty-print expressions with caret diagnostics for wrong function call

2012-04-21 Thread Gabriel Dos Reis
On Sat, Apr 21, 2012 at 9:41 AM, Manuel López-Ibáñez wrote: > Hi Gabriel, > > I hope you meant to send this OK also to gcc-patches. Indeed. > > Cheers, > > Manuel. > > On 21 April 2012 16:25, Gabriel Dos Reis > wrote: >> OK. >> >> On Sat, Apr 21, 2012 at 9:06 AM, Manuel López-Ibáñez >> wrote:

Re: [C/C++] Do not pretty-print expressions with caret diagnostics for wrong function call

2012-04-21 Thread Manuel López-Ibáñez
Hi Gabriel, I hope you meant to send this OK also to gcc-patches. Cheers, Manuel. On 21 April 2012 16:25, Gabriel Dos Reis wrote: > OK. > > On Sat, Apr 21, 2012 at 9:06 AM, Manuel López-Ibáñez > wrote: >> This patch avoids pretty-printing expressions when the caret is >> enabled for the error

Re: [RFC] improve caret diagnostics for overload failures

2012-04-21 Thread Manuel López-Ibáñez
On 21 April 2012 16:22, Gabriel Dos Reis wrote: > Do no use 'char' as the type of a flag.  Prefer 'unsigned int'. > Thanks, good catch! Should I worry about memory here and use something shorter? Cheers, Manuel.

Re: [RFC] improve caret diagnostics for overload failures

2012-04-21 Thread Gabriel Dos Reis
Do no use 'char' as the type of a flag. Prefer 'unsigned int'. On Sat, Apr 21, 2012 at 8:57 AM, Manuel López-Ibáñez wrote: > As noticed by Jason in PR 2485. The current output with caret > diagnostics is a bit verbose in some cases: > > wa2.C: In function ‘int main()’: > wa2.C:6:6: error: no mat

[C/C++] Do not pretty-print expressions with caret diagnostics for wrong function call

2012-04-21 Thread Manuel López-Ibáñez
This patch avoids pretty-printing expressions when the caret is enabled for the error given when calling as a function something that is not a function. This fixes (when caret is enabled) the bugs described in PR35441 and also shown here http://clang.llvm.org/diagnostics.html (No Pretty Printing o

[RFC] improve caret diagnostics for overload failures

2012-04-21 Thread Manuel López-Ibáñez
As noticed by Jason in PR 2485. The current output with caret diagnostics is a bit verbose in some cases: wa2.C: In function ‘int main()’: wa2.C:6:6: error: no matching function for call to ‘f(int)’ f(1); ^ wa2.C:6:6: note: candidates are: f(1); ^ wa2.C:1:6: note: void f() void

Re: [libcpp] maybe canonicalize system paths in line-map

2012-04-21 Thread Manuel López-Ibáñez
On 21 April 2012 14:56, Jason Merrill wrote: > It seems like we'll do this for every line in the header, which could lead > to a lot of leaked memory.  Instead, we should canonicalize when setting > ORDINARY_MAP_FILE_NAME. Hum, my understanding of the code is that this is exactly what I implement

Re: [RFA, C++] Symbol table 12/many: Remove cxx_analyze_expr hook

2012-04-21 Thread Jan Hubicka
Jason, thank you. My goal is to get rid of places where C++ FE is forcing symbols to be output unconditoinally. I think the remaining cases are those where mark_decl_referenced is called. My understnading is that those are 1) COMDAT symbols that must be output because they are keyed, but for we

Re: [libcpp] maybe canonicalize system paths in line-map

2012-04-21 Thread Jason Merrill
It seems like we'll do this for every line in the header, which could lead to a lot of leaked memory. Instead, we should canonicalize when setting ORDINARY_MAP_FILE_NAME. Jason

Re: [C/ObjC/C++/ObjC++] cleanup diagnostics initialization

2012-04-21 Thread Manuel López-Ibáñez
I created PR 53061 to track this. I prefer to focus on other things, so feel free to take the patch there and do whatever you need to get it approved. Cheers, Manuel.

Re: [RFA, C++] Symbol table 12/many: Remove cxx_analyze_expr hook

2012-04-21 Thread Jason Merrill
OK. Jason

Re: [libcpp] maybe canonicalize system paths in line-map

2012-04-21 Thread Jonathan Wakely
I think this patch is a *huge* improvement for C++ diagnostics that refer to standard library files, I really hope it will be approved in some form. On 21 April 2012 12:58, Manuel López-Ibáñez wrote: > Ping: http://gcc.gnu.org/ml/gcc-patches/2012-04/msg00903.html > > On 15 April 2012 20:44, Manu

[C] improve missing initializers diagnostics

2012-04-21 Thread Manuel López-Ibáñez
This patch improves missing initializers diagnostics. From: pr36446.c:13:3: warning: missing initializer [-Wmissing-field-initializers] .h = {1}, ^ pr36446.c:13:3: warning: (near initialization for ‘m0.h.b’) [-Wmissing-field-initializers] .h = {1}, ^ to: pr36446.c:13:3: warning: miss

Re: [libcpp] maybe canonicalize system paths in line-map

2012-04-21 Thread Manuel López-Ibáñez
Ping: http://gcc.gnu.org/ml/gcc-patches/2012-04/msg00903.html On 15 April 2012 20:44, Manuel López-Ibáñez wrote: > This patch tries to store the shortest form of a path to a system > file, either the original given or the canonical form returned by > realpath. User files are left untouched. This