[PATCH] gcc.dg/torture/ cleanup

2014-10-02 Thread Marek Polacek
This patch is a cleanup of tests in gcc.dg/torture directory. See https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02656.html for more info. Tested on x86_64-linux: vanilla results == results with this patch == results with this patch and gnu11 as a default. Ok? 2014-10-02 Marek Polacek pola

[PATCH] gcc.dg/tm/ cleanup

2014-10-02 Thread Marek Polacek
This patch is a cleanup of tests in gcc.dg/tm/ directory. See https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02656.html for more info. Tested on x86_64-linux: vanilla results == results with this patch == results with this patch and gnu11 as a default. Ok? 2014-10-02 Marek Polacek pola

Re: [PATCH, i386, Pointer Bounds Checker 38/x] Avoid warning for missed IPA_REF_CHKP in switch

2014-10-02 Thread Marek Polacek
On Thu, Oct 02, 2014 at 05:29:15PM +0400, Ilya Enkovich wrote: Hi, Seems some new warnings appeared lately and now I see a bootstrap failure for mpx branch due to missing IPA_REF_CHKP case in switch statement in process_references function. This function handles varpool_nodes which

[PATCH] gcc.dg/vect/ cleanup

2014-10-02 Thread Marek Polacek
This patch is a cleanup of tests in gcc.dg/vect/ directory. See https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02656.html for more info. Tested on x86_64-linux: vanilla results == results with this patch == results with this patch and gnu11 as a default. Ok? 2014-10-02 Marek Polacek pola

[PATCH] gcc.dg/noncompile/ cleanup

2014-10-02 Thread Marek Polacek
This patch is a cleanup of tests in gcc.dg/noncompile/ directory. See https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02656.html for more info. Tested on x86_64-linux: vanilla results == results with this patch == results with this patch and gnu11 as a default. Ok? 2014-10-02 Marek Polacek pola

[PATCH] gcc.dg/tree-prof/ cleanup

2014-10-02 Thread Marek Polacek
This patch is a cleanup of tests in gcc.dg/tree-prof/ directory. See https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02656.html for more info. Tested on x86_64-linux: vanilla results == results with this patch == results with this patch and gnu11 as a default. Ok? 2014-10-02 Marek Polacek pola

Re: [PATCH] gcc.dg/vect/ cleanup

2014-10-02 Thread Marek Polacek
On Thu, Oct 02, 2014 at 11:58:37AM -0600, Jeff Law wrote: In fact, I think I'll just go ahead and pre-approve the other patches of this nature. Thanks. I have a bunch of similar patches that just need proper CL entries, but they're of the same nature: missing declarations, defaulting to int,

[PATCH] gcc.dg/gomp/ cleanup

2014-10-03 Thread Marek Polacek
This patch is a cleanup of tests in gcc.dg/gomp/ directory. See https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02656.html for more info. Tested on x86_64-linux: vanilla results == results with this patch == results with this patch and gnu11 as a default. Applying to trunk. 2014-10-03 Marek

[C PATCH] Don't warn about gnu_inline functions without definitions (PR c/63453)

2014-10-03 Thread Marek Polacek
on x86_64-linux, ok for trunk? 2014-10-03 Marek Polacek pola...@redhat.com PR c/63453 * c-decl.c (pop_scope): Don't warn about inline function declared but never defined for functions marked with gnu_inline attribute. * gcc.dg/pr63453.c: New test. diff --git gcc

[C PATCH] Use error_operand_p more

2014-10-05 Thread Marek Polacek
It occured to me that we should probably use error_operand_p in the C FE where appropriate. Following change is meant only as a little cleanup. Bootstrapped/regtested on x86_64-linux, ok for trunk? 2014-10-04 Marek Polacek pola...@redhat.com * c-convert.c (convert): Use

Re: [Fortran, Patch] Implement IMPLICIT NONE

2014-10-06 Thread Marek Polacek
On Thu, Oct 02, 2014 at 12:35:47AM +0200, Tobias Burnus wrote: Tobias Burnus wrote: IMPLICIT NONE (external) While I have implemented is as vendor extension (-std=gnu) Ups, I forgot to include the gcc/fortran/libgfortran.h change in the patch. See updated attachment. Seems that

Re: [Fortran, Patch] Implement IMPLICIT NONE

2014-10-06 Thread Marek Polacek
Hi, On Mon, Oct 06, 2014 at 09:20:50AM +0200, Tobias Burnus wrote: Committing patches when having a cold doesn't seem to work. I don't have Having fight with cold last week, I know what you're talking about ;). access to the computer with SVN write permission, thus, I cannot fix it myself

[PATCH] gcc.dg/lto/ cleanup

2014-10-06 Thread Marek Polacek
: vanilla results == results with this patch == results with this patch and gnu11 as a default. Applying to trunk. 2014-10-03 Marek Polacek pola...@redhat.com * gcc.dg/lto/20080924_0.c: Fix defaulting to int. * gcc.dg/lto/20090213_0.c: Likewise. * gcc.dg/lto/20090706-2_0.c

[PATCH] gcc.dg/debug/ cleanup

2014-10-06 Thread Marek Polacek
This patch is a cleanup of tests in gcc.dg/debug/ directory. See https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02656.html for more info. Tested on x86_64-linux: vanilla results == results with this patch == results with this patch and gnu11 as a default. Applying to trunk. 2014-10-06 Marek

[PATCH] gcc.dg/ipa/ cleanup

2014-10-06 Thread Marek Polacek
This patch is a cleanup of tests in gcc.dg/ipa/ directory. See https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02656.html for more info. Tested on x86_64-linux: vanilla results == results with this patch == results with this patch and gnu11 as a default. Applying to trunk. 2014-10-06 Marek

[Java PATCH] Generate declarations in jvgenmain.c

2014-10-06 Thread Marek Polacek
. The fix is obvious IMHO. Bootstrapped/regtested on x86_64-linux, ok for trunk? 2014-10-06 Marek Polacek pola...@redhat.com * jvgenmain.c: Generate forward declarations for JvRunMain{,Name}. diff --git gcc/gcc/java/jvgenmain.c gcc/gcc/java/jvgenmain.c index 5b14258..a786d31 100644 --- gcc/gcc

[PATCH] libgomp.c/ cleanup

2014-10-06 Thread Marek Polacek
This patch is a cleanup of tests in libgomp.c/ directory. See https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02656.html for more info. Tested on x86_64-linux: vanilla results == results with this patch == results with this patch and gnu11 as a default. Applying to trunk. 2014-10-06 Marek

[PATCH] gcc.dg/ cleanup

2014-10-06 Thread Marek Polacek
as a default. Applying to trunk. 2014-10-06 Marek Polacek pola...@redhat.com * gcc.dg/20001012-1.c: Fix defaulting to int. * gcc.dg/20001012-2.c: Likewise. * gcc.dg/20001108-1.c: Likewise. * gcc.dg/20010516-1.c: Likewise. * gcc.dg/20011008-2.c: Likewise

Re: [PATCH] libgomp.c/ cleanup

2014-10-06 Thread Marek Polacek
On Mon, Oct 06, 2014 at 12:46:51PM +0200, Jakub Jelinek wrote: On Mon, Oct 06, 2014 at 12:18:33PM +0200, Marek Polacek wrote: --- gcc/libgomp/testsuite/libgomp.c/affinity-1.c +++ gcc/libgomp/testsuite/libgomp.c/affinity-1.c @@ -31,6 +31,7 @@ #ifdef DO_FORK #include signal.h

[PATCH] libitm.c/ cleanup

2014-10-06 Thread Marek Polacek
. Applying to trunk. 2014-10-06 Marek Polacek pola...@redhat.com * testsuite/libitm.c/memcpy-1.c: Declare getpagesize. * testsuite/libitm.c/memset-1.c: Likewise. diff --git gcc/libitm/testsuite/libitm.c/memcpy-1.c gcc/libitm/testsuite/libitm.c/memcpy-1.c index 03b3812..32a4b6c

[PATCH] gcc.target/i386/ cleanup

2014-10-06 Thread Marek Polacek
This patch is a cleanup of tests in gcc.target/i386/ directory. See https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02656.html for more info. Tested on x86_64-linux: vanilla results == results with this patch == results with this patch and gnu11 as a default. Applying to trunk. 2014-10-06 Marek

[PATCH] misc cleanup

2014-10-06 Thread Marek Polacek
This patch fixes some miscellaneous stuff in the testsuite. See https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02656.html for more info. Tested on x86_64-linux: vanilla results == results with this patch == results with this patch and gnu11 as a default. Applying to trunk. 2014-10-06 Marek

[Java PATCH] Generate declarations in jvgenmain.c

2014-10-07 Thread Marek Polacek
for these functions. The following patch generates such a declaration depending on whether -findirect-dispatch is given. Bootstrapped/regtested on x86_64-linux, ok for trunk? 2014-10-07 Marek Polacek pola...@redhat.com * jvgenmain.c (main): Provide declaration for JvRunMain{,Name}. diff

Re: [Java PATCH] Generate declarations in jvgenmain.c

2014-10-07 Thread Marek Polacek
On Mon, Oct 06, 2014 at 11:00:48PM +0200, Mark Wielaard wrote: On Mon, Oct 06, 2014 at 11:54:00AM +0200, Marek Polacek wrote: Java testsuite breaks with -std=gnu11 as a default and/or with -Wimplicit-function-declaration on, since the jvgenmain.c program that generates a C file containing

[C PATCH] Print header hints (PR c/59717)

2014-10-07 Thread Marek Polacek
for such functions we don't print the hint neither. header_for_builtin_fn is ready for them, though. (The cases for ctype.h and wctype.h could be removed.) Bootstrapped/regtested on x86_64-linux, ok for trunk? 2014-10-07 Marek Polacek pola...@redhat.com PR c/59717 * c-decl.c

Re: [C PATCH] Print header hints (PR c/59717)

2014-10-07 Thread Marek Polacek
On Tue, Oct 07, 2014 at 04:39:55PM +0200, Richard Biener wrote: Why not annotate builtins.def with the info? Because I think that would be more hairy, I'd have to change DEF_BUILTIN and all the builtins. That seemed superfluous given that this hint is only for a C FE... Marek

Re: [C PATCH] Print header hints (PR c/59717)

2014-10-07 Thread Marek Polacek
On Tue, Oct 07, 2014 at 05:00:05PM +0200, Jakub Jelinek wrote: On Tue, Oct 07, 2014 at 04:51:31PM +0200, Marek Polacek wrote: On Tue, Oct 07, 2014 at 04:39:55PM +0200, Richard Biener wrote: Why not annotate builtins.def with the info? Because I think that would be more hairy, I'd have

Re: [C PATCH] Print header hints (PR c/59717)

2014-10-07 Thread Marek Polacek
On Tue, Oct 07, 2014 at 05:00:26PM +0200, Richard Biener wrote: On Tue, Oct 7, 2014 at 4:51 PM, Marek Polacek pola...@redhat.com wrote: On Tue, Oct 07, 2014 at 04:39:55PM +0200, Richard Biener wrote: Why not annotate builtins.def with the info? Because I think that would be more hairy

Re: [Java PATCH] Generate declarations in jvgenmain.c

2014-10-07 Thread Marek Polacek
On Tue, Oct 07, 2014 at 10:03:26AM -0600, Tom Tromey wrote: Marek == Marek Polacek pola...@redhat.com writes: Marek [CCing java-patches now] Marek Java testsuite breaks with -std=gnu11 as a default and/or with Marek -Wimplicit-function-declaration on I don't recall how one gets warnings

[PATCH] More testsuite cleanups

2014-10-07 Thread Marek Polacek
Some more cleanups revealed by testing on ppc64. Applying to trunk. 2014-10-07 Marek Polacek pola...@redhat.com * gcc.dg/guality/pr41616-1.c: Use -fgnu89-inline. * gcc.dg/iftrap-1.c: Fix implicit declarations. * gcc.target/powerpc/pr26350.c: Likewise

[committed] Fix missing include in check_effective_target_fd_truncate

2014-10-07 Thread Marek Polacek
In -std=gnu11 as a default mode many Fortran tests ended up as UNSUPPORTED, because check_effective_target_fd_truncate routine was missing the string.h header (it uses strncmp) hence it failed. Applying to trunk. 2014-10-07 Marek Polacek pola...@redhat.com * lib/target-supports.exp

Towards GNU11

2014-10-07 Thread Marek Polacek
different rules for compatible types (?) might come in game as well. In turn, you can use all C99 and C11 features even with -pedantic. Comments? Regtested/bootstrapped on powerpc64-linux and x86_64-linux. 2014-10-07 Marek Polacek pola...@redhat.com * doc/invoke.texi: Update to reflect

Re: Towards GNU11

2014-10-08 Thread Marek Polacek
On Wed, Oct 08, 2014 at 09:16:18AM +0200, Richard Biener wrote: I think it makes sense to do this (and I expect C++ will follow with defaulting to -std=c++11 once the ABI stuff has settled). Thanks. Moving to -std=c++11 would be cool! Of course it would be nice to look at the actual fallout

Re: [PATCH] PR debug/38757 gcc does not emit DW_LANG_C99

2014-10-08 Thread Marek Polacek
On Wed, Oct 08, 2014 at 12:13:55PM +0200, Mark Wielaard wrote: Hi, This patch was written a long time ago by Jakub and has been in Fedora gcc for some time. All I did was rebase it to current gcc trunk and add a testcase. Back when it was originally proposed the issue was that because DWARF

[C PATCH] Don't warn on = { } initialization (PR c/63480)

2014-10-08 Thread Marek Polacek
/regtested on x86_64-linux, ok for trunk? 2014-10-08 Marek Polacek pola...@redhat.com PR c/63480 * c-typeck.c (pop_init_level): Don't warn about initializing with { }. * gcc.dg/pr63480.c: New test. diff --git gcc/c/c-typeck.c gcc/c/c-typeck.c index b3b82bb..5c0697a

Re: [PATCH] gcc.dg/torture/ cleanup

2014-10-08 Thread Marek Polacek
On Wed, Oct 08, 2014 at 01:06:50PM +0200, Rainer Orth wrote: This patch completely broke the builtin-apply-4.c execution tests on Solaris 11/x86 (and undoubtedly on many other platforms). stackalign.exp has this comment: # default_flags are replaced by a dg-options test directive, or

Re: Towards GNU11

2014-10-09 Thread Marek Polacek
On Wed, Oct 08, 2014 at 08:39:40PM -0600, Jeff Law wrote: I like it. And one could reasonably argue that now is the time to change since that maximizes the time for folks to find broken code. Yep, this is definitely stage1 stuff. We still have a few weeks, but I wouldn't want to rush such a

[DOC PATCH] Add documentation for -fsanitize=enum,bool

2014-10-09 Thread Marek Polacek
We are missing documentation for -fsanitize=bool and -fsanitize=enum, so I've put something together. Ok for trunk? 2014-10-09 Marek Polacek pola...@redhat.com * doc/invoke.texi: Document -fsanitize=bool and -fsanitize=enum. diff --git gcc/doc/invoke.texi gcc/doc/invoke.texi index

Re: [PATCH] Fix r216010 fallout

2014-10-09 Thread Marek Polacek
On Thu, Oct 09, 2014 at 04:47:05PM +0200, Markus Trippelsdorf wrote: 2014-10-09 Markus Trippelsdorf mar...@trippelsdorf.de * /g++.dg/ipa/polymorphic-call-1.C: New testcase. Please drop the leading '/' when you commit this patch. Marek

Re: Towards GNU11

2014-10-10 Thread Marek Polacek
On Thu, Oct 09, 2014 at 02:34:51PM -0700, Mike Stump wrote: On Oct 7, 2014, at 2:07 PM, Marek Polacek pola...@redhat.com wrote: I'd like to kick off a discussion about moving the default standard for C from gnu89 to gnu11. I endorse the change of default. Thanks for chiming in. A wiki

Re: [PATCH] Implement -fsanitize=object-size

2014-10-10 Thread Marek Polacek
location. We set the location properly in instrument_object_size, but in this case the location was UNKNOWN_LOCATION. So for UNKNOWN_LOCATION I use input_location. Bootstrapped/regtested on x86_64-linux, ok for trunk? 2014-10-09 Marek Polacek pola...@redhat.com * asan.c (pass_sanopt

Re: [PATCH] Implement -fsanitize=object-size

2014-10-10 Thread Marek Polacek
On Fri, Oct 10, 2014 at 12:26:44PM +0200, Jakub Jelinek wrote: On Fri, Oct 10, 2014 at 12:04:08PM +0200, Marek Polacek wrote: I couldn't test bootstrap-ubsan, because of error: /home/polacek/x/trunk/prev-x86_64-unknown-linux-gnu/libsanitizer/ubsan/.libs/libubsan.a(ubsan_init.o

Re: Towards GNU11

2014-10-14 Thread Marek Polacek
On Tue, Oct 07, 2014 at 11:07:56PM +0200, Marek Polacek wrote: I'd like to kick off a discussion about moving the default standard for C from gnu89 to gnu11. The consensus seems to be to go forward with this change. I will commit the patch in 24 hours unless I hear objections. Thanks

Re: Towards GNU11

2014-10-15 Thread Marek Polacek
On Tue, Oct 14, 2014 at 09:23:29AM +0200, Marek Polacek wrote: The consensus seems to be to go forward with this change. I will commit the patch in 24 hours unless I hear objections. I made the change. Please report any fallout to me. Enjoy. Marek

[wwwdocs] Update changes.html

2014-10-15 Thread Marek Polacek
A trivial patch to document that the C default has been changed. Applying. Index: changes.html === RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-5/changes.html,v retrieving revision 1.16 diff -u -r1.16 changes.html --- changes.html

Re: [wwwdocs] Update changes.html

2014-10-15 Thread Marek Polacek
On Wed, Oct 15, 2014 at 12:50:55PM +0200, Richard Biener wrote: On Wed, Oct 15, 2014 at 12:21 PM, Marek Polacek pola...@redhat.com wrote: A trivial patch to document that the C default has been changed. This should be also mentioned at the toplevel Caveats section. Ok, I'll commit

Re: [wwwdocs] Update changes.html

2014-10-15 Thread Marek Polacek
On Wed, Oct 15, 2014 at 12:51:41PM +0200, Jakub Jelinek wrote: And porting_to.html. I plan to prepare porting to this week. Marek

[C PATCH] Clamp down incomplete type error (PR c/63543)

2014-10-15 Thread Marek Polacek
print the error message more than once. Bootstrapped/regtested on x86_64-linux, ok for trunk? 2014-10-15 Marek Polacek pola...@redhat.com PR c/63543 * c-typeck.c (build_indirect_ref): Print the dereferencing... error only once for each type. Print also the type

[committed] gnu11 fallout: i686

2014-10-16 Thread Marek Polacek
The following is a patch by Jakub that ought to fix gnu11 fallout on i686. Applying to trunk. 2014-10-16 Jakub Jelinek ja...@redhat.com Marek Polacek pola...@redhat.com * gcc.dg/20020122-2.c: Use dg-additional-options. Fix implicit declarations. * gcc.dg

[committed] gnu11 fallout: ada

2014-10-16 Thread Marek Polacek
This fixes one test in the Ada testsuite (there may be more of these). Applying to trunk. 2014-10-16 Marek Polacek pola...@redhat.com * ada/acats/tests/cd/cd300051.c: Fix defaulting to int. diff --git gcc/testsuite/ada/acats/tests/cd/cd300051.c gcc/testsuite/ada/acats/tests/cd

[committed] gnu11 fallout: graphite

2014-10-16 Thread Marek Polacek
This fixes fallout of graphite tests. Applying to trunk. 2014-10-16 Marek Polacek pola...@redhat.com * gcc.dg/graphite/id-1.c: Fix defaulting to int. * gcc.dg/graphite/id-2.c: Likewise. * gcc.dg/graphite/id-4.c: Likewise. * gcc.dg/graphite/id-8.c: Likewise

[committed] gnu11 fallout: powerpc

2014-10-16 Thread Marek Polacek
Markus reported on IRC that gnu11 default broke these two tests on powerpc. Applying to trunk. 2014-10-16 Marek Polacek pola...@redhat.com * gcc.target/powerpc/pr58673-1.c: Fix defaulting to int. * gcc.target/powerpc/pr58673-2.c: Add declarations. diff --git gcc/testsuite

Re: cp/constexpr.c change needs gengtype update?

2014-10-16 Thread Marek Polacek
On Thu, Oct 16, 2014 at 10:11:33AM -0400, Andrew MacLeod wrote: Just updated to trunk and I have a compilation error: /gcc/2014-10-14/gcc/gcc/cp/constexpr.c:3391:29: fatal error: gt-cp-constexpr.h: No such file or directory #include gt-cp-constexpr.h ^ I

Re: [C PATCH] Clamp down incomplete type error (PR c/63543)

2014-10-16 Thread Marek Polacek
On Wed, Oct 15, 2014 at 09:46:20PM +, Joseph S. Myers wrote: On Wed, 15 Oct 2014, Marek Polacek wrote: We've got a complaint that the dereferencing pointer to incomplete type error is printed for all occurrences of the incomplete type, which is too verbose. Also it'd be nicer

Re: [C PATCH] Clamp down incomplete type error (PR c/63543)

2014-10-16 Thread Marek Polacek
On Wed, Oct 15, 2014 at 11:52:59PM +0200, Jakub Jelinek wrote: On Wed, Oct 15, 2014 at 03:48:20PM -0600, Jeff Law wrote: Isn't slamming error_mark_node well established at this point? I fact I recall seeing it documented to be used in this kind of way to prevent future errors. I think

[C PATCH] Don't ICE on invalid code (PR c/63549)

2014-10-16 Thread Marek Polacek
. Fixed by bailing out if default_conversion returns unusable expr. Bootstrapped/regtested on x86_64-linux, ok for trunk? 2014-10-16 Marek Polacek pola...@redhat.com PR c/63549 * c-typeck.c (build_array_ref): Bail if the index in an incomplete type. * gcc.dg

[C PATCH] Enable initializing statics with COMPOUND_LITERAL_EXPR in C99 (PR c/63567)

2014-10-17 Thread Marek Polacek
unless -pedantic. In gnu89, this will work as before even with -pedantic. Bootstrapped/regtested on x86_64-linux, ok for trunk? 2014-10-17 Marek Polacek pola...@redhat.com PR c/63567 * c-typeck.c (digest_init): Allow initializing objects with static storage duration

[C PATCH] Make -Wno-implicit-int work in C99 mode

2014-10-17 Thread Marek Polacek
and -Wimplicit-int should work as intended (following the rule that more specific option takes precedence over the less specific). There should be no changes in GNU89 mode. Bootstrapped/regtested on x86_64-linux, ok for trunk? 2014-10-17 Marek Polacek pola...@redhat.com c-family/ * c-opts.c

Re: [C PATCH] Enable initializing statics with COMPOUND_LITERAL_EXPR in C99 (PR c/63567)

2014-10-17 Thread Marek Polacek
On Fri, Oct 17, 2014 at 03:53:46PM +, Joseph S. Myers wrote: On Fri, 17 Oct 2014, Marek Polacek wrote: Building Linux kernel failed with 'error: initializer element is not constant', because they're initializing objects with static storage duration with (T){ ...} - and that isn't

[C PATCH] Another initialization fix (PR c/63567)

2014-10-19 Thread Marek Polacek
? 2014-10-18 Marek Polacek pola...@redhat.com PR c/63567 * c-typeck.c (output_init_element): Allow initializing objects with static storage duration with compound literals even in C99 and add pedwarn for it. * gcc.dg/pr63567-3.c: New test. * gcc.dg

[DOC PATCH] Fix up __builtin_ffs* args (PR c/50347)

2014-03-25 Thread Marek Polacek
ffs builtins had wrong type of parameters. 2014-03-25 Marek Polacek pola...@redhat.com PR c/50347 * doc/extend.texi (ffs Builtins): Change unsigned types to signed types. diff --git gcc/doc/extend.texi gcc/doc/extend.texi index c0da713..cb28bc9 100644 --- gcc/doc

[DOC PATCH] Amend designated inits doc (PR c/39525)

2014-03-25 Thread Marek Polacek
Apparently some users would like to see what happens to omitted field members when initializing a structure in GCC docs. Ok for trunk? 2014-03-25 Marek Polacek pola...@redhat.com PR c/39525 * doc/extend.texi (Designated Inits): Describe what happens to omitted field

Re: [DOC PATCH] Fix up __builtin_ffs* args (PR c/50347)

2014-03-27 Thread Marek Polacek
Actually I suppose this is obvious enough, so will commit it today. On Tue, Mar 25, 2014 at 09:59:39PM +0100, Marek Polacek wrote: ffs builtins had wrong type of parameters. 2014-03-25 Marek Polacek pola...@redhat.com PR c/50347 * doc/extend.texi (ffs Builtins): Change

[DOC PATCH] Clarify docs about stmt exprs (PR c/51088)

2014-03-28 Thread Marek Polacek
PR51088 contains some Really Bizzare code. We should tell users not to do any shenanigans like that. Ok for trunk? 2014-03-28 Marek Polacek pola...@redhat.com PR c/51088 * doc/extend.texi (Statement Exprs): Add note about taking addresses of labels inside of statement

[PATCH] Remove stale declaration

2014-04-02 Thread Marek Polacek
I noticed that we declare this function, but its definition was removed in 2009 by P. Bonzini, thus the decl serves no purpose. Regtested/bootstrapped on x86_64-linux, ok for trunk? 2014-04-02 Marek Polacek pola...@redhat.com * c-common.h (c_expand_expr): Remove declaration. diff

Re: [PATCH][LTO/PGO] Warn when both -flto and -fprofile-generate are enabled

2014-04-02 Thread Marek Polacek
On Wed, Apr 02, 2014 at 01:50:31PM +0200, Markus Trippelsdorf wrote: + if (opts-x_flag_generate_lto opts-x_flag_profile_generate) +warning_at (loc, 0, Enabling both -fprofile-generate and -flto is a bad idea.); s/Enabling/enabling/ + no dot at the end. Marek

[PATCH] Initialize sanitizer builtins (PR sanitizer/60745)

2014-04-03 Thread Marek Polacek
. No testcase attached since it's not trivial to reproduce this. Bootstrapped/ran ubsan testsuite on x86_64-linux, ok for trunk? 2014-04-03 Marek Polacek pola...@redhat.com PR sanitizer/60745 * c-ubsan.c: Include asan.h. (ubsan_instrument_return): Call

Re: [PATCH] Initialize sanitizer builtins (PR sanitizer/60745)

2014-04-04 Thread Marek Polacek
On Fri, Apr 04, 2014 at 04:48:48PM +0100, Jonathan Wakely wrote: On 04/04/14 09:17 -0600, Jeff Law wrote: So what are those circumstances? ISTM this deserves some kind of comment at the least. I found the ICE using ubsan on the libstdc++ testsuite. Including the bits/stdc++.h PCH'd header

Re: [PATCH] Initialize sanitizer builtins (PR sanitizer/60745)

2014-04-04 Thread Marek Polacek
On Fri, Apr 04, 2014 at 11:50:04AM -0600, Jeff Law wrote: On 04/04/14 11:14, Marek Polacek wrote: So what happens here is that normally we initialize the builtins via c_common_nodes_and_builtins, which has: 5711 if (!flag_preprocess_only) 5712 c_define_builtins

Re: [PATCH] Initialize sanitizer builtins (PR sanitizer/60745)

2014-04-05 Thread Marek Polacek
-04-05 Marek Polacek pola...@redhat.com PR sanitizer/60745 * c-ubsan.c: Include asan.h. (ubsan_instrument_return): Call initialize_sanitizer_builtins. diff --git gcc/c-family/c-ubsan.c gcc/c-family/c-ubsan.c index dc4d981..e89ebc1 100644 --- gcc/c-family/c-ubsan.c +++ gcc

Re: [PATCH] Initialize sanitizer builtins (PR sanitizer/60745)

2014-04-07 Thread Marek Polacek
On Sun, Apr 06, 2014 at 09:46:12AM -0700, Mike Stump wrote: On Apr 5, 2014, at 10:36 AM, Marek Polacek pola...@redhat.com wrote: I'll wait a day or two for possible comments. So, my only comment would be it would be nice to document the flags that can vary between pch creation and use

Re: [DOC PATCH] Clarify docs about stmt exprs (PR c/51088)

2014-04-08 Thread Marek Polacek
On Fri, Mar 28, 2014 at 02:44:21PM +, Joseph S. Myers wrote: On Fri, 28 Mar 2014, Marek Polacek wrote: PR51088 contains some Really Bizzare code. We should tell users not to do any shenanigans like that. Ok for trunk? I don't think a doc patch resolves this bug. The compiler

Re: [C PATCH] Warn if inline attributes conflict (PR c/18079)

2014-04-08 Thread Marek Polacek
the stage1 opens. 2014-04-08 Marek Polacek pola...@redhat.com PR c/18079 c/ * c-decl.c (diagnose_mismatched_decls): Warn for mismatched always_inline/noinline and hot/cold attributes. c-family/ * c-common.c (handle_noinline_attribute): Warn if the attribute

[C PATCH] Quash spurious warnings (PR c/60784)

2014-04-13 Thread Marek Polacek
-initializers=2 that should warn even for designated initializers. Regtested/bootstrapped on x86_64-linux, ok for trunk? 2014-04-13 Marek Polacek pola...@redhat.com PR c/60784 * c-typeck.c (push_init_level): Set constructor_designated to p-designated for structures

[C PATCH] Make attributes accept enum values (PR c/50459)

2014-04-14 Thread Marek Polacek
does along with some clean ups. Regtested/bootstrapped on x86_64-linux, ok for trunk? 2014-04-14 Marek Polacek pola...@redhat.com PR c/50459 c-family/ * c-common.c (get_attrib_value): New function. (get_priority): Call get_attrib_value. (check_user_alignment

Re: [C PATCH] Make attributes accept enum values (PR c/50459)

2014-04-14 Thread Marek Polacek
fine, but having different code for the 2 languages would not be nice, right? Right. Incidentally, C's default_conversion can handle CONST_DECLs too, so I tweaked get_attrib_value routine a bit. Is it any better? Tested x86_64. 2014-04-14 Marek Polacek pola...@redhat.com PR c/50459 c

Re: [C PATCH] Make attributes accept enum values (PR c/50459)

2014-04-15 Thread Marek Polacek
On Tue, Apr 15, 2014 at 09:59:10AM -0400, Jason Merrill wrote: On 04/14/2014 11:10 AM, Marek Polacek wrote: + else if (TREE_CODE (val) == IDENTIFIER_NODE) +{ + tree t = lookup_name (val); + if (t TREE_CODE (t) == CONST_DECL) +return DECL_INITIAL (t); +} I'm

Re: [C PATCH] Make attributes accept enum values (PR c/50459)

2014-04-17 Thread Marek Polacek
On Wed, Apr 16, 2014 at 01:40:22PM -0400, Jason Merrill wrote: On 04/15/2014 03:56 PM, Marek Polacek wrote: The testsuite doesn't hit this code with C++, but does hit this code with C. The thing is, if we have e.g. enum { A = 128 }; void *fn1 (void) __attribute__((assume_aligned

[C PATCH] Warn if switch has boolean value (PR c/60439)

2014-04-17 Thread Marek Polacek
clang does the former, I did it too and currently this warning is enabled by default. Regtested/bootstrapped on x86_64-linux, ok for trunk? 2014-04-17 Marek Polacek pola...@redhat.com PR c/60439 c/ * c-typeck.c (c_start_case): Warn if switch condition has boolean value

Re: [C PATCH] Warn if switch has boolean value (PR c/60439)

2014-04-18 Thread Marek Polacek
On Fri, Apr 18, 2014 at 07:49:22AM +0200, Marc Glisse wrote: On Fri, 18 Apr 2014, Marek Polacek wrote: This patch implements a new warning that warns when controlling expression of a switch has boolean value. (Intentionally I don't warn if the controlling expression is (un)signed:1 bit

Re: [C PATCH] Warn if switch has boolean value (PR c/60439)

2014-04-18 Thread Marek Polacek
On Fri, Apr 18, 2014 at 08:00:45AM +0200, Marek Polacek wrote: On Fri, Apr 18, 2014 at 07:49:22AM +0200, Marc Glisse wrote: On Fri, 18 Apr 2014, Marek Polacek wrote: This patch implements a new warning that warns when controlling expression of a switch has boolean value. (Intentionally

Re: [C PATCH] Warn if switch has boolean value (PR c/60439)

2014-04-18 Thread Marek Polacek
On Fri, Apr 18, 2014 at 01:20:59PM +0200, Steven Bosscher wrote: On Fri, Apr 18, 2014 at 7:30 AM, Marek Polacek wrote: + if (TREE_CODE (type) == BOOLEAN_TYPE + || exp_code == TRUTH_ANDIF_EXPR + || exp_code == TRUTH_AND_EXPR + || exp_code

[C PATCH] Fix up diagnostics (PR c/25801)

2014-04-18 Thread Marek Polacek
of just say arithmetic on, but I'm not changing that now.) Regtested on x86_64-unknown-linux-gnu, bootstrapped on powerpc64-unknown-linux-gnu, ok for trunk? 2014-04-18 Marek Polacek pola...@redhat.com PR c/25801 * c-typeck.c (c_size_in_bytes): Don't call error

Re: [C PATCH] Make attributes accept enum values (PR c/50459)

2014-04-23 Thread Marek Polacek
On Sat, Apr 19, 2014 at 09:56:02AM -0400, Jason Merrill wrote: On 04/17/2014 12:00 PM, Marek Polacek wrote: == CPP_CLOSE_PAREN))) { tree arg1 = c_parser_peek_token (parser)-value; + if (!attr_takes_id_p

[PATCH] Tweak an error msg a little

2014-04-23 Thread Marek Polacek
I think it's better to be consistent and always quote the transaction_wrap name, it even looks nicer. I ran tm.exp tests, ok for trunk? 2014-04-23 Marek Polacek pola...@redhat.com * c-common.c (handle_tm_wrap_attribute): Tweak error message. diff --git gcc/c-family/c-common.c gcc/c

[C PATCH] Improve error on attrs after declarator in a fndef (PR c/60915)

2014-04-24 Thread Marek Polacek
This PR is about not very clear error message when one tries to add attributes *after* the declarator in a function definition. cc1plus already handles this well, so I used the same message. Regtested/bootstrapped on x86_64-linux, ok for trunk? 2014-04-24 Marek Polacek pola...@redhat.com

Re: [C PATCH] Improve error on attrs after declarator in a fndef (PR c/60915)

2014-04-24 Thread Marek Polacek
On Thu, Apr 24, 2014 at 08:25:52PM +0200, Marc Glisse wrote: On Thu, 24 Apr 2014, Marek Polacek wrote: This PR is about not very clear error message when one tries to add attributes *after* the declarator in a function definition. cc1plus already handles this well, so I used the same message

Re: [C PATCH] Warn about variadic main (PR c/60156)

2014-04-25 Thread Marek Polacek
On Thu, Apr 24, 2014 at 03:11:15PM -0600, Jeff Law wrote: OK. Though in practice I doubt this is going to catch many real bugs. Are people still giving main a stdargs style signature? I doubt too, it's more a matter of QOI. I've actually never seen main (int, ...). But it seemed wrong to not

Re: [C PATCH] remove goto in c_parser_sizeof_expression

2014-04-25 Thread Marek Polacek
On Thu, Apr 24, 2014 at 03:27:42PM -0600, Jeff Law wrote: On 02/24/14 12:28, Marek Polacek wrote: On Tue, Feb 25, 2014 at 12:01:25AM +0530, Prathamesh Kulkarni wrote: Replaced tab by 4 spaces before error_at. * c-parser.c (c_parser_sizeof_expression): Remove goto sizeof_expr. Looks good now

Re: [C PATCH] Improve column info of initializers (PR c/60114)

2014-04-25 Thread Marek Polacek
On Tue, Feb 11, 2014 at 12:09:39AM +, Joseph S. Myers wrote: On Mon, 10 Feb 2014, Marek Polacek wrote: This patch improves location information in a bunch of various initializers; see the testcase. Main issue was that digest_init was getting only input_location. Regtested

[C PATCH] Better column info for shift warnings (PR c/60351)

2014-04-25 Thread Marek Polacek
A trivial patch to improve column info of warnings about shift count. Tested x86_64-linux, ok for trunk? 2014-04-25 Marek Polacek pola...@redhat.com PR c/60351 * c-typeck.c (build_binary_op): Use location when warning about shift count. * gcc.dg/pr60351.c: New

[PATCH] Fix test for PR18079

2014-04-25 Thread Marek Polacek
A while ago I committed a fix for PR18079, but only later on discovered that the test fails because of wrong quoting in dg-warning. Sorry. Committed. 2014-04-25 Marek Polacek pola...@redhat.com * gcc.dg/pr18079-2.c: Fix quoting in dg-warning. diff --git gcc/testsuite/gcc.dg/pr18079

[C PATCH] Better column info for initializers (PR c/60139)

2014-04-25 Thread Marek Polacek
as well -- that should greatly improve initializer warnings/errors. Bootstrapped/regtested on x86_64-linux, ok for trunk? 2014-04-25 Marek Polacek pola...@redhat.com PR c/60139 * c-typeck.c (output_init_element): Pass OPT_Wpedantic to pedwarn and pedwarn_init. Use loc insted

[C PATCH] Some c-typeck.c TLC

2014-04-25 Thread Marek Polacek
on x86_64-linux, ok for trunk? 2014-04-25 Marek Polacek pola...@redhat.com * c-tree.h (error_init): Remove declaration. (pedwarn_init): Likewise. * c-typeck.c (error_init): Make static and move above. (pedwarn_init): Likewise. (warning_init): Move above

[C PATCH] Another locus improvements (PR c/60257)

2014-04-26 Thread Marek Polacek
on powerpc64-unknown-linux-gnu and x86_64-unknown-linux-gnu, ok for trunk? 2014-04-25 Marek Polacek pola...@redhat.com PR c/60257 * c-typeck.c (warning_init): Add location_t parameter. Call warning_at instead of warning. (push_init_level): Pass input_location

Re: [PATCH][testsuite] Fix gcc.dg/pr60114.c on arm/aarch64

2014-04-28 Thread Marek Polacek
On Mon, Apr 28, 2014 at 12:18:05PM +0100, Kyrill Tkachov wrote: Hi all, I noticed this test is failing on aarch64: FAIL: gcc.dg/pr60114.c (test for warnings, line 7) FAIL: gcc.dg/pr60114.c (test for warnings, line 8) FAIL: gcc.dg/pr60114.c (test for warnings, line 21) FAIL:

[PATCH] Implement -fsanitize=float-divide-by-zero

2014-04-28 Thread Marek Polacek
be a valid way of obtaining infinities and NaNs, I'm not 100% sure this ought to be enabled by default (that is, enabled when -fsanitize=undefined is specified). Regtested/bootstrapped/ran bootstrap-ubsan on x86_64-linux, ok for trunk? 2014-04-28 Marek Polacek pola...@redhat.com * flag

Re: [PATCH] Implement -fsanitize=float-divide-by-zero

2014-04-29 Thread Marek Polacek
/-m64) + bootstrap-ubsan on x86_64-linux, ok now? 2014-04-29 Marek Polacek pola...@redhat.com * gcc.c (sanitize_spec_function): Handle SANITIZE_FLOAT_DIVIDE. * builtins.def: Initialize builtins even for SANITIZE_FLOAT_DIVIDE. * flag-types.h (enum sanitize_code): Add

[C PATCH] Improve warn msg (PR c/43395)

2014-04-29 Thread Marek Polacek
It's correct to warn about returning an address of a local label, but it's clumsy to say it's local variable. We can easily distinguish between a label and a variable. Regtested/bootstrapped on x86_64-linux, ok for trunk? 2014-04-29 Marek Polacek pola...@redhat.com PR c/43395 c

[C PATCH] Warn about booleans in C89 mode (PR c/29467)

2014-04-29 Thread Marek Polacek
of that to fix some fortran tests (it's not possible to add dg-options, since these tests we're using C files via dg-additional-source). Regtested/bootstrapped on x86_64-linux, ok for trunk? 2014-04-29 Marek Polacek pola...@redhat.com PR c/29467 * c-decl.c (declspecs_add_type

<    1   2   3   4   5   6   7   8   9   10   >