[PATCH 1/2] VRP: Simplify logic for checking if any asserts need to be inserted

2014-11-10 Thread Patrick Palka
that was approved a few months ago but was never committed. Bootstrapped and regtested on x86_64-unknown-linux-gnu with no new regressions. Is it OK to commit? 2014-08-13 Patrick Palka ppa...@gcc.gnu.org * tree-vrp.c (register_edge_assert_for_2): Change return type to void

[PATCH 2/2] Simplify and extend VRP edge-assertion code

2014-11-10 Thread Patrick Palka
. Full bootstrap + regtesting on x86_64-unknown-linux-gnu is in progress. Is it OK to commit if testing finishes with no new regressions? 2014-11-11 Patrick Palka patr...@parcs.ath.cx gcc/ * tree-vrp.c (extract_code_and_val_from_cond_with_ops): Ensure that NAME always equals

Re: [PATCH 2/2] Simplify and extend VRP edge-assertion code

2014-11-11 Thread Patrick Palka
This patch failed regtesting -- and on second thought I'm not too confident that the refactoring is strictly an improvement so I will try to fix the main issue (that is to make the test vrp-1.c fail to compile) in a more direct way.

[PATCH] Look through widening type conversions for possible edge assertions

2014-11-11 Thread Patrick Palka
that such an edge assertion be inserted. Full bootstrap + regtest on x86_64-unknown-linux-gnu in progress. Does the patch look OK for trunk if no new regressions? 2014-11-11 Patrick Palka ppa...@gcc.gnu.org gcc/ * tree-vrp.c (register_edge_assert_for): Look through widening type

Re: [PATCH 2/2] Simplify and extend VRP edge-assertion code

2014-11-11 Thread Patrick Palka
On Tue, Nov 11, 2014 at 7:52 AM, Richard Biener richard.guent...@gmail.com wrote: On Tue, Nov 11, 2014 at 4:52 AM, Patrick Palka patr...@parcs.ath.cx wrote: This patch refactors the VRP edge-assertion code to make it always traverse SSA-name definitions in order to find suitable edge assertions

Re: [PATCH] Look through widening type conversions for possible edge assertions

2014-11-11 Thread Patrick Palka
On Tue, Nov 11, 2014 at 8:48 AM, Richard Biener richard.guent...@gmail.com wrote: On Tue, Nov 11, 2014 at 1:10 PM, Patrick Palka patr...@parcs.ath.cx wrote: This patch is a replacement for the 2nd VRP refactoring patch. It simply teaches VRP to look through widening type conversions when

[PATCH] driver: ignore SIGINT while waiting on subprocesses to finish

2014-11-15 Thread Patrick Palka
Currently the top-level driver handles SIGINT by immediately killing itself even when the driver has subprocesses (e.g. cc1, as) running. I don't think this is a good idea because 1. if the top-level driver is waiting on a hanging subprocess, pressing ^C will kill the driver but it may not

Re: [PATCH] driver: ignore SIGINT while waiting on subprocesses to finish

2014-11-15 Thread Patrick Palka
On Sat, 15 Nov 2014, Patrick Palka wrote: Currently the top-level driver handles SIGINT by immediately killing itself even when the driver has subprocesses (e.g. cc1, as) running. I don't think this is a good idea because 1. if the top-level driver is waiting on a hanging subprocess

Re: [PATCH] Look through widening type conversions for possible edge assertions

2014-11-15 Thread Patrick Palka
On Wed, Nov 12, 2014 at 3:38 AM, Richard Biener richard.guent...@gmail.com wrote: On Wed, Nov 12, 2014 at 5:17 AM, Patrick Palka patr...@parcs.ath.cx wrote: On Tue, Nov 11, 2014 at 8:48 AM, Richard Biener richard.guent...@gmail.com wrote: On Tue, Nov 11, 2014 at 1:10 PM, Patrick Palka patr

Re: [PATCH] Look through widening type conversions for possible edge assertions

2014-11-16 Thread Patrick Palka
On Sun, Nov 16, 2014 at 8:52 AM, Richard Biener richard.guent...@gmail.com wrote: On November 16, 2014 5:22:26 AM CET, Patrick Palka patr...@parcs.ath.cx wrote: On Wed, Nov 12, 2014 at 3:38 AM, Richard Biener richard.guent...@gmail.com wrote: On Wed, Nov 12, 2014 at 5:17 AM, Patrick Palka patr

Re: [PATCH] driver: ignore SIGINT while waiting on subprocesses to finish

2014-11-17 Thread Patrick Palka
On Mon, Nov 17, 2014 at 5:23 AM, Richard Biener richard.guent...@gmail.com wrote: On Sun, Nov 16, 2014 at 2:01 AM, Patrick Palka patr...@parcs.ath.cx wrote: Currently the top-level driver handles SIGINT by immediately killing itself even when the driver has subprocesses (e.g. cc1, as) running

Re: [PATCH] Look through widening type conversions for possible edge assertions

2014-11-17 Thread Patrick Palka
On Mon, Nov 17, 2014 at 5:32 AM, Richard Biener richard.guent...@gmail.com wrote: On Sun, Nov 16, 2014 at 3:40 PM, Patrick Palka patr...@parcs.ath.cx wrote: On Sun, Nov 16, 2014 at 8:52 AM, Richard Biener richard.guent...@gmail.com wrote: On November 16, 2014 5:22:26 AM CET, Patrick Palka patr

[PATCH] Disable an unsafe VRP transformation when -fno-strict-overflow is set

2014-11-19 Thread Patrick Palka
VRP may simplify a conditional like i = 5 to i == 5 if it is known that the lower bound of i's range is 5, e.g. [5, +INF]. But if the upper bound of i's range is also overflow infinity, i.e. [5, +INF(OVF)] then this transformation is only valid if -fstrict-overflow is in effect. Likewise for

Re: [PATCH] Disable an unsafe VRP transformation when -fno-strict-overflow is set

2014-11-19 Thread Patrick Palka
On Wed, Nov 19, 2014 at 10:21 PM, Patrick Palka patr...@parcs.ath.cx wrote: VRP may simplify a conditional like i = 5 to i == 5 if it is known that the lower bound of i's range is 5, e.g. [5, +INF]. But if the upper bound of i's range is also overflow infinity, i.e. [5, +INF(OVF

Re: [PATCH] driver: ignore SIGINT while waiting on subprocesses to finish

2014-11-20 Thread Patrick Palka
On Tue, Nov 18, 2014 at 11:14 AM, Michael Matz m...@suse.de wrote: Hi, On Mon, 17 Nov 2014, Richard Biener wrote: This means I can no longer interrupt a compile that is running too long? No, that's not what it means, cc1 will also get the SIGINT. You should instead debug the actual

[PATCH] VRP: don't assume strict overflow semantics when checking if a loop wraps

2014-11-21 Thread Patrick Palka
When adjusting the value range of an induction variable using SCEV, VRP calls scev_probably_wraps_p() with use_overflow_semantics=true. This parameter set to true makes scev_probably_wraps_p() assume that signed induction variables never wrap, so for these variables it always returns false (when

Re: [PATCH] VRP: don't assume strict overflow semantics when checking if a loop wraps

2014-11-21 Thread Patrick Palka
On Fri, Nov 21, 2014 at 7:18 AM, Richard Biener richard.guent...@gmail.com wrote: On Fri, Nov 21, 2014 at 12:29 PM, Patrick Palka patr...@parcs.ath.cx wrote: When adjusting the value range of an induction variable using SCEV, VRP calls scev_probably_wraps_p() with use_overflow_semantics=true

[PATCH] Fix PR c++/44859

2014-03-31 Thread Patrick Palka
bootstrapped and regtested against x86_64-unknown-linux-gnu. 2014-03-31 Patrick Palka patr...@parcs.ath.cx PR c++/44859 * typeck.c (maybe_warn_about_returning_address_of_local): Unwrap COMPONENT_REFs and ARRAY_REFs sooner. --- gcc/cp/typeck.c

[PATCH] Fix PR c++/21113

2014-04-03 Thread Patrick Palka
this change on x86_64-unknown-linux-gnu. 2014-04-03 Patrick Palka patr...@parcs.ath.cx PR c++/21113 * decl.c (decl_jump_unsafe): Consider variably-modified decls. --- gcc/cp/decl.c| 5 ++--- gcc/testsuite/g++.dg/ext/vla14.C | 23 +++ 2

[PATCH] Fix PR c++/44613

2014-04-03 Thread Patrick Palka
(); } } thereby forcing the label foo to be placed before the initialization of saved_stack during gimplification. This is the same approach that the C frontend uses (see r85849). I bootstrapped and regtested this patch on x86_64-unknown-linux-gnu. 2014-04-03 Patrick Palka patr...@parcs.ath.cx

[PATCH] Fix PR c++/60764

2014-04-07 Thread Patrick Palka
Hello, This patch fixes fixes an erroneous -Wnonnull warning when calling a constructor declared with __attribute__ ((nonnull (1))). The issue is that a NULL pointer is used as the placeholder object for the this parameter of the constructor method call until a target object is determined and

[PATCH] Fix PR c++/60765

2014-04-07 Thread Patrick Palka
Hi, This patch teaches the C++ frontend how to handle function attributes attached to pointer-to-member-function declarations. I bootstrapped and regtested this patch on x86_64-unknown-linux-gnu. 2014-04-05 Patrick Palka patr...@parcs.ath.cx PR c++/60765 * decl2.c

[PATCH] [CLEANUP] Mark locally-used functions static

2014-04-14 Thread Patrick Palka
-04-13 Patrick Palka patr...@parcs.ath.cx gcc/c/ * c-array-notation.c (replace_invariant_exprs): Make static. gcc/cp/ * class.c (inherit_targ_abi_tags): Make static. * cp-array-notation.c (create_cmp_incr): Likewise. * mangle.c (tree_string_cmp): Likewise

[PATCH] [CLEANUP] Wrap locally-used functions in anonymous namespaces

2014-04-14 Thread Patrick Palka
as template arguments. The next best thing to marking them static is to define each of these functions inside an anonymous namespace. I bootstrapped and regtested this change on x86_64-unknown-linux-gnu. 2014-04-11 Patrick Palka patr...@parcs.ath.cx * alloc-pool.c

[PATCH] [CLEANUP] Declare global functions before defining them

2014-04-14 Thread Patrick Palka
the appropriate header file within the offending source files. Bootstrapped and regtested on x86_64-unknown-linux-gnu. 2014-04-11 Patrick Palka patr...@parcs.ath.cx gcc/ * builtins.c: Include targhooks.h. * calls.c: Include calls.h. * cfgexpand.c: Include cfgexpand.h

Re: [PATCH] [CLEANUP] Wrap locally-used functions in anonymous namespaces

2014-04-15 Thread Patrick Palka
On Tue, Apr 15, 2014 at 3:51 AM, Richard Biener richard.guent...@gmail.com wrote: On Mon, Apr 14, 2014 at 4:51 PM, Patrick Palka patr...@parcs.ath.cx wrote: Hi everyone, This patch wraps a bunch of locally-used, non-debug functions in an anonymous namespace. These functions can't simply

Re: [PATCH] [CLEANUP] Declare global functions before defining them

2014-04-15 Thread Patrick Palka
On Tue, Apr 15, 2014 at 3:52 AM, Richard Biener richard.guent...@gmail.com wrote: On Mon, Apr 14, 2014 at 4:52 PM, Patrick Palka patr...@parcs.ath.cx wrote: Hi everyone, Many source files currently define a global function that is not previously declared within that source file because

Re: [PATCH] Fix PR c++/60765

2014-04-16 Thread Patrick Palka
Could someone install this on my behalf?

Re: [PATCH] Fix PR c++/60764

2014-04-16 Thread Patrick Palka
Could someone install this for me?

Re: [PATCH] Fix PR c++/60765

2014-04-16 Thread Patrick Palka
Thanks, Paolo!

[PATCH] Typofixes and a trivial change

2014-04-25 Thread Patrick Palka
Hi, This patch fixes a couple of typos in tree-vrp.c and one in invoke.texi. The patch also reorders the operands of an condition in infer_nonnull_range() under the assumption that operand_equal_p() is much more costly than a simple TREE_TYPE() equality test. Bootstrapped and regtested on

Re: [PATCH] Typofixes and a trivial change

2014-04-25 Thread Patrick Palka
I forgot the ChangeLog entry: 2014-04-25 Patrick Palka patr...@parcs.ath.cx * doc/invoke.texi: Fix typo. * tree-vrp.c: Fix typos. * gimple.c (infer_nonnull_range): Reorder operands of an condition.

Re: [PATCH] Typofixes and a trivial change

2014-04-28 Thread Patrick Palka
On Mon, Apr 28, 2014 at 4:57 AM, Richard Biener richard.guent...@gmail.com wrote: On Fri, Apr 25, 2014 at 5:03 PM, Patrick Palka patr...@parcs.ath.cx wrote: I forgot the ChangeLog entry: Ok. Thanks, Richard. Thanks for reviewing. May someone please commit this for me? Thanks in advance.

[PATCH] Clean up and extend VRP edge-assertion code

2014-05-03 Thread Patrick Palka
on x86_64-unknown-linux-gnu though I will do so again tonight to make sure. 2014-05-03 Patrick Palka patr...@parcs.ath.cx * tree-vrp.c (extract_code_and_val_from_cond_with_ops): Add sanity test. (register_edge_assert_for, register_edge_assert_for_1

[PATCH] VRP: simplify assert location check

2014-05-03 Thread Patrick Palka
We can check if any assertions were found by simply inspecting the need_assert_for bitmap. This eliminates the need to pass all these bools around everywhere. 2014-05-03 Patrick Palka patr...@parcs.ath.cx * tree-vrp.c (register_edge_assert_for_1): Change return type to void

Re: [PATCH] Clean up and extend VRP edge-assertion code

2014-05-04 Thread Patrick Palka
This patch causes a latent test failure in gcc.dg/uninit-pred-9_b.c due to an oversight in the tree-ssa-uninit code for which I will send a fix shortly.

Re: [PATCH] Clean up and extend VRP edge-assertion code

2014-05-04 Thread Patrick Palka
On Sun, May 4, 2014 at 12:20 PM, Patrick Palka patr...@parcs.ath.cx wrote: This patch causes a latent test failure in gcc.dg/uninit-pred-9_b.c due to an oversight in the tree-ssa-uninit code for which I will send a fix shortly. Never mind, I spoke too soon.. I haven't been able to solve

Re: [PATCH] Clean up and extend VRP edge-assertion code

2014-05-05 Thread Patrick Palka
On Mon, May 5, 2014 at 8:47 AM, Richard Biener richard.guent...@gmail.com wrote: On Mon, May 5, 2014 at 4:45 AM, Patrick Palka patr...@parcs.ath.cx wrote: On Sun, May 4, 2014 at 12:20 PM, Patrick Palka patr...@parcs.ath.cx wrote: This patch causes a latent test failure in gcc.dg/uninit-pred

[PATCH] Fix issue in uninit analysis (PR middle-end/61112)

2014-05-11 Thread Patrick Palka
from the PHI argument edge down to the root PHI node is irrelevant. Both these changes are required to make the below test case compile without emitting a bogus warning. I bootstrapped and regtested this change on x86_64-unknown-linux-gnu. Is it OK for trunk? 2014-05-10 Patrick Palka patr

[PATCH] Warn on and fold NULL checks against inline functions

2014-05-26 Thread Patrick Palka
-26 Patrick Palka patr...@parcs.ath.cx * c-family/c-common.c (decl_with_nonnull_addr_p): Assume inline functions are non-null. * fold-const.c (tree_single_nonzero_warnv_p): Likewise. --- gcc/c-family/c-common.c | 4 +++- gcc/fold-const.c| 5

Re: [PATCH] Warn on and fold NULL checks against inline functions

2014-05-26 Thread Patrick Palka
On Mon, May 26, 2014 at 4:26 PM, Marc Glisse marc.gli...@inria.fr wrote: On Mon, 26 May 2014, Patrick Palka wrote: This patch teaches the C++ frontend to warn on NULL checks against inline functions and it teaches the middle-end to fold NULL checks against inline functions. These two things

Re: [PATCH] Warn on and fold NULL checks against inline functions

2014-05-27 Thread Patrick Palka
On Tue, May 27, 2014 at 3:33 AM, Richard Biener richard.guent...@gmail.com wrote: On Mon, May 26, 2014 at 9:01 PM, Patrick Palka patr...@parcs.ath.cx wrote: Hi, This patch teaches the C++ frontend to warn on NULL checks against inline functions and it teaches the middle-end to fold NULL

Re: [PATCH] Warn on and fold NULL checks against inline functions

2014-05-27 Thread Patrick Palka
On Tue, May 27, 2014 at 8:32 AM, Patrick Palka patr...@parcs.ath.cx wrote: On Tue, May 27, 2014 at 3:33 AM, Richard Biener richard.guent...@gmail.com wrote: On Mon, May 26, 2014 at 9:01 PM, Patrick Palka patr...@parcs.ath.cx wrote: Hi, This patch teaches the C++ frontend to warn on NULL

[PATCH] Fix PR c++/25940

2014-02-23 Thread Patrick Palka
Hi, The following patch fixes two issues: the first is PR c++/25940 and the second is related to PR c++/13699. The first issue is that the C++ frontend fails to reject duplicate definitions of functions with C language linkage. This results in the compiler emitting ASM that defines the same

[PATCH v2] Fix PR c++/25940

2014-03-01 Thread Patrick Palka
Hi, The following patch fixes two issues: the first issue is PR c++/25940 and the second is related to PR c++/13699. The first issue is that the C++ frontend fails to reject duplicate definitions of functions declared to have C language linkage. This results in the compiler emitting ASM that

Re: [PATCH v2] Fix PR c++/25940

2014-03-01 Thread Patrick Palka
On Sat, Mar 1, 2014 at 7:53 PM, Marc Glisse marc.gli...@inria.fr wrote: On Sat, 1 Mar 2014, Patrick Palka wrote: + error_at (input_location, + redefinition of %q+#D with C language linkage, + x

Re: Why my mail is not achived

2014-03-01 Thread Patrick Palka
On Sat, Mar 1, 2014 at 9:57 PM, lin zuojian manjian2...@gmail.com wrote: Hi, my mail is not achived by http://gcc.gnu.org/ml/gcc-patches/2014-02/. What's happening? That's last month's archive.

Re: Patch RFC: Use internal qsort function in libbacktrace

2014-03-04 Thread Patrick Palka
On Tue, Mar 4, 2014 at 10:34 PM, Ian Lance Taylor i...@google.com wrote: The GNU glibc qsort function will call malloc in some cases. That makes it unsuitable for libbacktrace, which is intended to work when called from a signal handler. This patch changes libbacktrace to use an internal

[PATCH] Add test for PR c++/53711

2014-03-13 Thread Patrick Palka
This patch adds a test case for PR c++/53711 which seems to have been resolved by r199906. PR c++/53711 * d++.dg/warn/anonymous-namespace-6.C: New test. --- gcc/testsuite/g++.dg/warn/anonymous-namespace-6.C | 8 1 file changed, 8 insertions(+) create mode 100644

Re: [PATCH] Add test for PR c++/53711

2014-03-23 Thread Patrick Palka
On Fri, Mar 14, 2014 at 11:20 AM, Jason Merrill ja...@redhat.com wrote: Applied, thanks. Thanks! The commit seems to be missing the corresponding ChangeLog entry though.

[PATCH] Fix PR 63748

2014-11-09 Thread Patrick Palka
destination operand occurs in an abnormal PHI node. To fix PR 63748, this patch extends the fix to PR 57287 to allow propagating such copies too. Full bootstrap + regtesting on x86_64-unknown-linux-gnu is in progress. Is this patch OK if testing succeeds with no new regressions? 2014-11-10 Patrick

Re: [PATCH] Fix PR 63748

2014-11-10 Thread Patrick Palka
On Mon, Nov 10, 2014 at 7:22 AM, Eric Botcazou ebotca...@adacore.com wrote: Full bootstrap + regtesting on x86_64-unknown-linux-gnu is in progress. Is this patch OK if testing succeeds with no new regressions? ... ok. But please watch for fallout. I'd do a bootstrap with Ada enabled, the

Fix build under make --no-builtin-rules

2014-01-06 Thread Patrick Palka
Hi, The following tiny patch allows GCC to be built with the --no-builtin-rules GNU make flag. It replaces two usages of the automatic variable $* within the body of an explicit rule. Using $* inside the body of an explicit rule should be avoided[0] and, as in this scenario, may break an

Re: Fix build under make --no-builtin-rules

2014-01-06 Thread Patrick Palka
On Mon, Jan 6, 2014 at 6:33 PM, Patrick Palka patr...@parcs.ath.cx wrote: Hi, The following tiny patch allows GCC to be built with the --no-builtin-rules GNU make flag. It replaces two usages of the automatic variable $* within the body of an explicit rule. Using $* inside the body

Re: Fix build under make --no-builtin-rules

2014-01-06 Thread Patrick Palka
On Mon, Jan 6, 2014 at 6:47 PM, Andreas Schwab sch...@linux-m68k.org wrote: Patrick Palka patr...@parcs.ath.cx writes: From what I inferred from the make manual[0], $* is functionally equivalent to $(basename $@) in this case. Or $(base), I think. Andreas. -- Andreas Schwab, sch

Re: Fix build under make --no-builtin-rules

2014-01-07 Thread Patrick Palka
On Tue, Jan 7, 2014 at 2:26 PM, Bernhard Reutner-Fischer rep.dot@gmail.com wrote: On 7 January 2014 00:57:47 Patrick Palka patr...@parcs.ath.cx wrote: On Mon, Jan 6, 2014 at 6:47 PM, Andreas Schwab sch...@linux-m68k.org wrote: Patrick Palka patr...@parcs.ath.cx writes: From what I

[PATCH] Fix a nonfatal build error

2014-01-12 Thread Patrick Palka
) and are otherwise nonexistent. Therefore these object files should only be added to $(EXTRA_PARTS) when vtable verification is enabled. 2014-01-11 Patrick Palka patr...@parcs.ath.cx * config.host (extra_parts): Don't include vtv_*.o objects unless vtable verification is enabled

[PATCH] C frontend: cast-expressions sometimes retain type qualifiers

2014-08-16 Thread Patrick Palka
and regtested on x86_64-unknown-linux-gnu. No new testcase is added because an existing testcase already contains the important cases; the existing testcase is then adjusted to expect the new correct behavior. Is this patch OK for trunk? 2014-08-17 Patrick Palka ppa...@gcc.gnu.org * c

Re: [PATCH] C frontend: cast-expressions sometimes retain type qualifiers

2014-08-17 Thread Patrick Palka
On Sun, Aug 17, 2014 at 8:27 AM, Marek Polacek pola...@redhat.com wrote: On Sat, Aug 16, 2014 at 09:54:33PM -0400, Patrick Palka wrote: --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -4947,6 +4947,8 @@ build_c_cast (location_t loc, tree type, tree expr) || TREE_CODE (type

[PATCH] Fix promotion of const local arrays to static storage

2014-08-17 Thread Patrick Palka
think that this code is necessary or useful anymore. Bootstrapped and regtested on x86_64-unknown-linux-gnu, OK for trunk? 2014-08-18 Patrick Palka ppa...@gcc.gnu.org * c-typeck.c (build_array_ref): Don't mark arrays indexed by non-constant or out-of-range values as addressable

Re: [PATCH] Fix promotion of const local arrays to static storage

2014-08-18 Thread Patrick Palka
On Mon, Aug 18, 2014 at 6:48 AM, Richard Biener richard.guent...@gmail.com wrote: On Mon, Aug 18, 2014 at 4:00 AM, Patrick Palka patr...@parcs.ath.cx wrote: Hi, The fix for PR38615 indirectly broke the promotion of const local arrays to static storage in many cases. The commit in question

Re: [PATCH] Fix promotion of const local arrays to static storage

2014-08-18 Thread Patrick Palka
On Mon, Aug 18, 2014 at 8:50 AM, Richard Biener richard.guent...@gmail.com wrote: On Mon, Aug 18, 2014 at 2:31 PM, Patrick Palka patr...@parcs.ath.cx wrote: On Mon, Aug 18, 2014 at 6:48 AM, Richard Biener richard.guent...@gmail.com wrote: On Mon, Aug 18, 2014 at 4:00 AM, Patrick Palka patr

Re: [PATCH] Fix promotion of const local arrays to static storage

2014-08-18 Thread Patrick Palka
On Mon, Aug 18, 2014 at 8:59 AM, Patrick Palka patr...@parcs.ath.cx wrote: On Mon, Aug 18, 2014 at 8:50 AM, Richard Biener richard.guent...@gmail.com wrote: On Mon, Aug 18, 2014 at 2:31 PM, Patrick Palka patr...@parcs.ath.cx wrote: On Mon, Aug 18, 2014 at 6:48 AM, Richard Biener richard.guent

[COMMITTED] Add myself to MAINTAINERS (Write After Approval)

2014-08-18 Thread Patrick Palka
Committed as revision 214127. 2014-08-18 Patrick Palka ppa...@gcc.gnu.org * MAINTAINERS (Write After Approval): Add myself. Index: MAINTAINERS === --- MAINTAINERS (revision 214126) +++ MAINTAINERS (revision 214127

Re: [PATCH] C frontend: cast-expressions sometimes retain type qualifiers

2014-08-19 Thread Patrick Palka
On Mon, Aug 18, 2014 at 2:07 PM, Joseph S. Myers jos...@codesourcery.com wrote: On Sat, 16 Aug 2014, Patrick Palka wrote: 2014-08-17 Patrick Palka ppa...@gcc.gnu.org * c-typeck.c (build_c_cast): Do a conversion even when the TYPE_MAIN_VARIANTs are the same. 2014-08-17

Re: [PATCH] Fix PR c++/16160

2015-01-14 Thread Patrick Palka
On Wed, Jan 14, 2015 at 4:28 PM, Jason Merrill ja...@redhat.com wrote: On 01/14/2015 11:28 AM, Patrick Palka wrote: Second, since the user probably intended to have written an explicit template instantiation (as in the PR), the FE should suggest adding template before such a declaration

[PATCH] Fix PR c++/16160

2015-01-14 Thread Patrick Palka
Here is version 2 of the patch which only adjusts a couple of testcases in g++.old-deja/ that I missed earlier. I am unsure if the extra dg-error in overload.C is correct. No code changes yet in gcc/cp/ versus the original patch. Successfully bootstrapped and regtested on

[PATCH] Fix PR c++/16160

2015-01-13 Thread Patrick Palka
This patch fixes the above PR where it was reported that the C++ frontend does not reject the malformed class declaration struct X5; Instead of rejecting it, the FE treats this declaration as if it were a forward declaration of a template specialization, i.e. as if it were written

Re: [PATCH] Fix PR c++/16160

2015-01-14 Thread Patrick Palka
On Wed, Jan 14, 2015 at 8:05 AM, Jason Merrill ja...@redhat.com wrote: On 01/13/2015 10:54 PM, Patrick Palka wrote: + type = error_mark_node; + goto out; Why exit early in the explicit instantiation cases? Doesn't it work to give the error and continue? Jason Yes

Re: [PATCH] Fix PR c++/16160

2015-01-14 Thread Patrick Palka
On Wed, Jan 14, 2015 at 8:26 AM, Patrick Palka patr...@parcs.ath.cx wrote: On Wed, Jan 14, 2015 at 8:05 AM, Jason Merrill ja...@redhat.com wrote: On 01/13/2015 10:54 PM, Patrick Palka wrote: + type = error_mark_node; + goto out; Why exit early in the explicit instantiation

[PATCH] Emit -Waddress warnings for comparing address of reference against NULL

2015-04-20 Thread Patrick Palka
Implementation is pretty straightforward. The only catch is that the middle-end doesn't actually assume that REFERENCE_TYPEs are non-NULL so code like int a = *(int *)0; if (a != 0) will warn that a will never be NULL yet the middle-end will fold the conditional to false instead of true

Re: Re: [PATCH] Emit -Waddress warnings for comparing address of reference against NULL

2015-04-23 Thread Patrick Palka
On Thu, Apr 23, 2015 at 11:34 AM, Manuel López-Ibáñez lopeziba...@gmail.com wrote: On 04/23/2015 05:12 PM, Jason Merrill wrote: On 04/20/2015 10:36 PM, Patrick Palka wrote: Implementation is pretty straightforward. The only catch is that the middle-end doesn't actually assume

Re: [PATCH] Fix check for whether a function is a variadic function

2015-04-20 Thread Patrick Palka
On Sun, Apr 19, 2015 at 11:17 PM, Jason Merrill ja...@redhat.com wrote: On 04/19/2015 07:45 PM, Patrick Palka wrote: stdarg_p() apparently returns false for a variadic function that has no concrete parameters, e.g. void foo (...);. This patch fixes this issue by removing the predicate's

[PATCH] Emit -Waddress warnings for comparing address of reference against NULL

2015-04-26 Thread Patrick Palka
Here is an updated version of the patch with, hopefully, all your suggestions made. I decided to add calls to STRIP_NOPS before emitting the warning so that we properly warn for cases where there's a cast in between the whole thing, e.g. if (!(int )a) I also added guards to emit the warnings

[PATCH] Fix check for whether a function is a variadic function

2015-04-19 Thread Patrick Palka
stdarg_p() apparently returns false for a variadic function that has no concrete parameters, e.g. void foo (...);. This patch fixes this issue by removing the predicate's seemingly bogus n != NULL_TREE test. (Zero-parameter functions like void bar (void); will always have a void_type_node

Re: [PATCH] Emit -Waddress warnings for comparing address of reference against NULL

2015-05-03 Thread Patrick Palka
On Sun, Apr 26, 2015 at 8:56 PM, Patrick Palka patr...@parcs.ath.cx wrote: Here is an updated version of the patch with, hopefully, all your suggestions made. I decided to add calls to STRIP_NOPS before emitting the warning so that we properly warn for cases where there's a cast in between

[PATCH] Fix memory leak in C++ pretty printer

2015-05-10 Thread Patrick Palka
In gcc/cp/error.c we initialize the C++ pretty printer object twice: first during statics initialization and later in a placement-new in init_error(). This double-initialization causes a memory leak of about 7kb according to valgrind. I don't see a reason to initialize the object a second time

[PATCH] Do not discard the constructors of empty structs [PR c++/64527]

2015-04-15 Thread Patrick Palka
gimplify_init_constructor() only attempts to gimplify a CONSTRUCTOR's elts under two conditions: if the object has not been zero-initialized, or if categorize_ctor_elements() detected more than one nonzero elt in the CONSTRUCTOR. With the PR's testcase, both of these conditions are false: the

Re: [PATCH] Do not discard the constructors of empty structs [PR c++/64527]

2015-04-16 Thread Patrick Palka
On Thu, 16 Apr 2015, Jason Merrill wrote: On 04/15/2015 09:00 PM, Patrick Palka wrote: - if (!cleared || num_nonzero_elements 0) How about adding || TREE_SIDE_EFFECTS (TREE_OPERAND (*expr_p), 1) to this test rather than removing it entirely? That works too. Does the following

Re: [PATCH] Do not discard the constructors of empty structs [PR c++/64527]

2015-04-17 Thread Patrick Palka
On Thu, Apr 16, 2015 at 3:54 PM, Jason Merrill ja...@redhat.com wrote: OK. Thanks, committed as revision 222176. Jason

Re: [PATCH] Refactor -Wmisleading-indentation API and extend coverage

2015-06-08 Thread Patrick Palka
On Mon, Jun 8, 2015 at 2:45 PM, Richard Sandiford rdsandif...@googlemail.com wrote: Patrick Palka patr...@parcs.ath.cx writes: At the same time this patch extends the coverage of the -Wmisleading-indentation implementation to catch misleading indentation involving the semicolon

Re: [PATCH] Refactor -Wmisleading-indentation API and extend coverage

2015-06-08 Thread Patrick Palka
On Mon, Jun 8, 2015 at 2:11 PM, David Malcolm dmalc...@redhat.com wrote: On Sun, 2015-06-07 at 16:06 -0400, Patrick Palka wrote: This patch refactors the entry point of -Wmisleading-indentation Thanks for working on this. I was hoping to submit a patch to propose putting -Wmisleading

[PATCH] Refactor -Wmisleading-indentation API and extend coverage

2015-06-07 Thread Patrick Palka
This patch refactors the entry point of -Wmisleading-indentation from: void warn_for_misleading_indentation (location_t guard_loc, location_t body_loc, location_t next_stmt_loc, enum

[PATCH 3/3] Improve -Wmissing-indentation heuristics

2015-06-09 Thread Patrick Palka
This patch improves the heuristics of the warning in a number of ways. The improvements are hopefully adequately documented in the code comments. The additions to the test case also highlight the improvements. I tested an earlier version of this patch on more than a dozen C code bases. I only

[PATCH 1/3] Refactor entry point to -Wmisleading-indentation

2015-06-09 Thread Patrick Palka
This patch refactors the entry point of -Wmisleading-indentation from: void warn_for_misleading_indentation (location_t guard_loc, location_t body_loc, location_t next_stmt_loc, enum

[PATCH 2/3] Remove is_first_nonwhitespace_on_line(), instead improve get_visual_column()

2015-06-09 Thread Patrick Palka
This patch removes the function is_first_nonwhitespace_on_line() in favor of augmenting the function get_visual_column() to optionally return the visual column corresponding to the first non-whitespace character on the line. Existing usage of is_first_nonwhitespace_on_line() can be trivially

Re: [PATCH] Emit -Waddress warnings for comparing address of reference against NULL

2015-06-09 Thread Patrick Palka
On Sun, May 3, 2015 at 5:29 PM, Patrick Palka patr...@parcs.ath.cx wrote: On Sun, Apr 26, 2015 at 8:56 PM, Patrick Palka patr...@parcs.ath.cx wrote: Here is an updated version of the patch with, hopefully, all your suggestions made. I decided to add calls to STRIP_NOPS before emitting

Re: [PATCH] Refactor -Wmisleading-indentation API and extend coverage

2015-06-07 Thread Patrick Palka
The new heuristic turns out to trigger a common false positive (see test case below) in many programs. I have applied this diff on top of the original patch to make the heuristic more strict. diff --git a/gcc/c-family/c-indentation.c b/gcc/c-family/c-indentation.c index d3e842b..5532ff4 100644

Re: [PATCH 1/3] Refactor entry point to -Wmisleading-indentation

2015-06-23 Thread Patrick Palka
On Mon, Jun 22, 2015 at 2:56 PM, Patrick Palka patr...@parcs.ath.cx wrote: On Mon, Jun 22, 2015 at 1:29 PM, Jeff Law l...@redhat.com wrote: On 06/09/2015 11:31 AM, Patrick Palka wrote: This patch refactors the entry point of -Wmisleading-indentation from: void

Re: [PATCH 1/3] Refactor entry point to -Wmisleading-indentation

2015-06-18 Thread Patrick Palka
On Tue, Jun 9, 2015 at 1:31 PM, Patrick Palka patr...@parcs.ath.cx wrote: This patch refactors the entry point of -Wmisleading-indentation from: void warn_for_misleading_indentation (location_t guard_loc, location_t body_loc

[PATCH] Make debug_tree() print the length of a TREE_VEC

2015-06-25 Thread Patrick Palka
When printing a TREE_VEC, this patch makes its length get printed alongside its prefix, e.g. tree_vec 0x76a4d0a0 length 2 elt 0 Without a reference to its length, an all-NULL TREE_VEC otherwise looks like an empty TREE_VEC, since NULL elts don't get printed. This makes

Re: [PATCH] Fix PR c++/30044

2015-06-24 Thread Patrick Palka
On Wed, Jun 24, 2015 at 5:08 AM, Markus Trippelsdorf mar...@trippelsdorf.de wrote: On 2015.06.23 at 19:40 -0400, Patrick Palka wrote: On Tue, Jun 23, 2015 at 12:38 AM, Jason Merrill ja...@redhat.com wrote: On 06/15/2015 02:32 PM, Patrick Palka wrote: On Mon, Jun 15, 2015 at 2:05 PM, Jason

Re: [PATCH 3/3] Improve -Wmissing-indentation heuristics

2015-06-18 Thread Patrick Palka
On Thu, Jun 18, 2015 at 12:57 PM, Patrick Palka patr...@parcs.ath.cx wrote: On Thu, Jun 18, 2015 at 12:31 PM, David Malcolm dmalc...@redhat.com wrote: On Tue, 2015-06-09 at 13:31 -0400, Patrick Palka wrote: This patch improves the heuristics of the warning in a number of ways. The improvements

Re: [PATCH 1/3] Refactor entry point to -Wmisleading-indentation

2015-06-18 Thread Patrick Palka
On Thu, Jun 18, 2015 at 12:39 PM, David Malcolm dmalc...@redhat.com wrote: On Thu, 2015-06-18 at 11:41 -0400, Patrick Palka wrote: On Tue, Jun 9, 2015 at 1:31 PM, Patrick Palka patr...@parcs.ath.cx wrote: This patch refactors the entry point of -Wmisleading-indentation from: void

Re: [PATCH 3/3] Improve -Wmissing-indentation heuristics

2015-06-18 Thread Patrick Palka
On Thu, Jun 18, 2015 at 12:31 PM, David Malcolm dmalc...@redhat.com wrote: On Tue, 2015-06-09 at 13:31 -0400, Patrick Palka wrote: This patch improves the heuristics of the warning in a number of ways. The improvements are hopefully adequately documented in the code comments. The additions

Re: [PATCH 1/3] Refactor entry point to -Wmisleading-indentation

2015-06-22 Thread Patrick Palka
On Mon, Jun 22, 2015 at 1:29 PM, Jeff Law l...@redhat.com wrote: On 06/09/2015 11:31 AM, Patrick Palka wrote: This patch refactors the entry point of -Wmisleading-indentation from: void warn_for_misleading_indentation (location_t guard_loc

[PATCH] Fix PR c++/66686 (dependent template template substitution)

2015-06-27 Thread Patrick Palka
This patch makes coerce_template_template_parm consider a coercion successful if the result of calling tsubst on a template template parm is a dependent type even when the desired argument type is non-dependent. For the test case below, TREE_TYPE (parm) is B and TREE_TYPE (arg) is int. After

Re: [PATCH] Fix PR c++/30044

2015-06-23 Thread Patrick Palka
On Tue, Jun 23, 2015 at 12:38 AM, Jason Merrill ja...@redhat.com wrote: On 06/15/2015 02:32 PM, Patrick Palka wrote: On Mon, Jun 15, 2015 at 2:05 PM, Jason Merrill ja...@redhat.com wrote: Any reason not to use grow_tree_vec? Doing so causes a lot of ICEs in the testsuite. I think it's

[PATCH] Fix comment documenting make_vector_stat

2015-06-13 Thread Patrick Palka
It actually returns a VECTOR_CST not a TREE_VEC. Committed as obvious. gcc/ChangeLog: * tree.c (make_vector_stat): Fix comment to state that the function returns a VECTOR_CST. --- gcc/tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/tree.c

[PATCH OBV] Remove stale commentary in cp/call.c

2015-06-13 Thread Patrick Palka
r76173 removed the function build_method_call() but did not remove the comment documenting the function. This patch removes the stale comment. Committed as obvious. gcc/cp/ChangeLog: * call.c: Remove comment documenting the long-deleted function build_method_call. ---

  1   2   3   4   5   6   7   8   9   10   >