Re: [PATCH 1/2, i386] cmpstrnsi needs string length

2016-11-03 Thread Uros Bizjak
Hello! > This patch adds a test to the cmpstrnsi pattern in i386.md so that it > will bail out (FAIL) if neither of the strings is a constant string. It > can only work as a proper strncmp if the length is not longer than both > of the strings. This change is required if expand_builtin_strncmp is

[patch, avr] Make pmem-wrap-around option as default

2016-11-03 Thread Pitchumani Sivanupandi
Most of the AVR's 8k memorydevices have only rjmp instruction, not jmp. So, it is important to wrap around jump destination to check if it can reach backwards. Currently link specs passes --pmem-wrap-around=xxK when mrelax and mpmem-wrap-around options are enabled. Attached patch changes the

Re: [PATCH] bb-reorder: Improve compgotos pass (PR71785)

2016-11-03 Thread Richard Biener
On Wed, Nov 2, 2016 at 4:27 PM, Segher Boessenkool wrote: > On Wed, Nov 02, 2016 at 02:51:41PM +0100, Richard Biener wrote: >> >> I don't believe it needs a cleanup on every iteration. One cleanup at >> >> the end should work fine. >> > >> > But as the comment there

[Patch, testsuite] Fix bogus PR 78170 failure for avr

2016-11-03 Thread Senthil Kumar Selvaraj
Hi, The below patch requires int32plus for gcc.c-torture/execute/pr78170.c, as it has int bitfields that are more than 16 bits wide. Committed to trunk as obvious. Regards Senthil gcc/testsuite/ChangeLog 2016-11-03 Senthil Kumar Selvaraj *

[Patch, testsuite] Add new effective-target_store_merge

2016-11-03 Thread Senthil Kumar Selvaraj
Hi, The below patch adds a new effective target keyword (store_merge) for use in the store_merging_xxx.c tests. The tests currently require non_strict_align, but they still fail for the avr. Eyeballing the dump, I found that the pass doesn't attempt merging as it is unprofitable for a

Re: [PATCH] Fix PR78185

2016-11-03 Thread Richard Biener
On Wed, 2 Nov 2016, Richard Biener wrote: > > The following fixes PR78185 by properly honoring possibly infinite child > loops when computing what blocks are always executed during loop invariant > motion. Such loops behave as if the loop would exit at this point. > > Both GIMPLE and RTL level

[PATCH] Add mcpu flag for Qualcomm falkor core

2016-11-03 Thread Siddhesh Poyarekar
This adds an mcpu option for the upcoming Qualcomm Falkor core. This is identical to the qdf24xx part that was added earlier and hence retains the same tuning structure and continues to have the a57 pipeline for now. The part number has also been changed and this patch fixes this for both

[match.pd] Fix for PR35691

2016-11-03 Thread Prathamesh Kulkarni
Hi Richard, The attached patch tries to fix PR35691, by adding the following two transforms to match.pd: (x == 0 && y == 0) -> (x | typeof(x)(y)) == 0. (x != 0 || y != 0) -> (x | typeof(x)(y)) != 0. For GENERIC, the "and" operator is truth_andif_expr, and it seems for GIMPLE, it gets transformed

Re: RFC: Warnings silenced when macros from system headers are used (PR c/78000, c/71613)

2016-11-03 Thread Marek Polacek
On Wed, Nov 02, 2016 at 01:39:22PM -0400, Jason Merrill wrote: > On Wed, Nov 2, 2016 at 12:37 PM, Joseph Myers wrote: > > On Wed, 2 Nov 2016, Jason Merrill wrote: > > > >> It seems to me that the general principle is that we should consider > >> the location where the

RE: [PATCH,gcc/MIPS] Make loongson3a use fused madd.d

2016-11-03 Thread Matthew Fortune
Paul Hua writes: > Loongson3a has 4 operand fused madd instrcution. This patch set > loongson3a use fused madd.d. Hi Paul, Thanks for the fix. I was vaguely aware that this was wrong for loongson-3a but never confirmed it. I suspect this change is mechanical enough that

[PATCH] PR77359: Properly align local variables in functions calling alloca.

2016-11-03 Thread Dominik Vogt
The attached patch fixes the stack layout problems on AIX and Power as described here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77359 The patch has been bootstrapped on AIX (32 Bit) and bootstrappend and regression tested on Power (biarch). It needs more testing that I cannot do with the

Re: [match.pd] Fix for PR35691

2016-11-03 Thread Richard Biener
On Thu, 3 Nov 2016, Prathamesh Kulkarni wrote: > Hi Richard, > The attached patch tries to fix PR35691, by adding the following two > transforms to match.pd: > (x == 0 && y == 0) -> (x | typeof(x)(y)) == 0. > (x != 0 || y != 0) -> (x | typeof(x)(y)) != 0. > > For GENERIC, the "and" operator is

RE: [PATCH] [ARC] define SIZE_TYPE and PTRDIFF_TYPE correctly

2016-11-03 Thread Claudiu Zissulescu
Hi Vineet, Thank you for your contribution. > gcc/ > 2016-10-28 Vineet Gupta > > * config/arc/arc.h (SIZE_TYPE): define as unsigned int. > * (PTRDIFF_TYPE): define as int. > Approved and committed. However, the entry changelog line is not as expected and

Re: Implement -Wduplicated-branches (PR c/64279) (v3)

2016-11-03 Thread Marek Polacek
On Tue, Nov 01, 2016 at 02:53:58PM +0100, Jakub Jelinek wrote: > On Tue, Nov 01, 2016 at 09:41:20AM -0400, Jason Merrill wrote: > > On Tue, Oct 25, 2016 at 9:59 AM, Marek Polacek wrote: > > > On Mon, Oct 24, 2016 at 04:10:21PM +0200, Marek Polacek wrote: > > >> On Thu, Oct 20,

Re: [PATCH 2/2, i386]: Implement TARGET_EXPAND_DIVMOD_LIBFUNC

2016-11-03 Thread Eric Botcazou
> The same approach can also be used on other targets without hardware > divmod insn. This should be made generic instead: can't we automatically create a divmod libfunc for double-word mode & define a default TARGET_EXPAND_DIVMOD_LIBFUNC? This would save the code duplication in the ~50

RE: [PATCH] MIPS: If a test in the MIPS testsuite requires standard library support check the sysroot supports the required test options.

2016-11-03 Thread Andrew Bennett
Ping. Regards, Andrew > -Original Message- > From: Andrew Bennett > Sent: 28 August 2015 16:50 > To: Matthew Fortune; Moore, Catherine; gcc-patches@gcc.gnu.org > Subject: RE: [PATCH] MIPS: If a test in the MIPS testsuite requires standard > library support check the sysroot supports

Change default level for -Wimplicit-fallthrough

2016-11-03 Thread Bernd Schmidt
I'm concerned about the number of false positives for this warning, and judging by previous discussions, I'm not alone in this. This patch limits it to level 1 (any comment before the case label disables the warning) for cases where the user specified no explicit level. It'll still generate

Re: [PATCH 2/2, i386]: Implement TARGET_EXPAND_DIVMOD_LIBFUNC

2016-11-03 Thread Uros Bizjak
On Thu, Nov 3, 2016 at 12:29 PM, Eric Botcazou wrote: >> The same approach can also be used on other targets without hardware >> divmod insn. > > This should be made generic instead: can't we automatically create a divmod > libfunc for double-word mode & define a default

Re: Change default level for -Wimplicit-fallthrough

2016-11-03 Thread Jakub Jelinek
On Thu, Nov 03, 2016 at 12:51:15PM +0100, Bernd Schmidt wrote: > I'm concerned about the number of false positives for this warning, and > judging by previous discussions, I'm not alone in this. This patch limits it > to level 1 (any comment before the case label disables the warning) for > cases

Re: [PATCH,gcc/MIPS] Make loongson3a use fused madd.d

2016-11-03 Thread Paul Hua
Hi Matthew, Thanks for your comments, update the patch. *** gcc/ChangeLog *** 2016-11-03 Chenghua Xu * config/mips/mips.h (ISA_HAS_FUSED_MADD4): Enable for TARGET_LOONGSON_3A. (ISA_HAS_UNFUSED_MADD4): Exclude TARGET_LOONGSON_3A. Thanks, Paul On

Re: Ping: Re: [PATCH 1/2] gcc: Remove unneeded global flag.

2016-11-03 Thread Bernd Schmidt
On 09/14/2016 03:00 PM, Andrew Burgess wrote: In an attempt to get this patch merged (as I still think that its correct) I've investigated, and documented a little more about how I think things currently work. I'm sure most people reading this will already know this, but hopefully, if my

Re: Change default level for -Wimplicit-fallthrough

2016-11-03 Thread Marek Polacek
On Thu, Nov 03, 2016 at 12:58:55PM +0100, Jakub Jelinek wrote: > On Thu, Nov 03, 2016 at 12:51:15PM +0100, Bernd Schmidt wrote: > > I'm concerned about the number of false positives for this warning, and > > judging by previous discussions, I'm not alone in this. This patch limits it > > to level

Re: [PATCH][rtlanal.c] Convert conditional compilation on WORD_REGISTER_OPERATIONS

2016-11-03 Thread Kyrill Tkachov
On 02/11/16 11:36, Eric Botcazou wrote: I think you're right. I suppose the new condition should be: #ifdef LOAD_EXTEND_OP /* If this is a typical RISC machine, we only have to worry about the way loads are extended. */ if (!WORD_REGISTER_OPERATIONS

Re: [PATCH][rtlanal.c] Convert conditional compilation on WORD_REGISTER_OPERATIONS

2016-11-03 Thread Kyrill Tkachov
On 03/11/16 12:05, Kyrill Tkachov wrote: On 02/11/16 11:36, Eric Botcazou wrote: I think you're right. I suppose the new condition should be: #ifdef LOAD_EXTEND_OP /* If this is a typical RISC machine, we only have to worry about the way loads are extended. */ if

Re: [Patch, rtl] PR middle-end/78016, keep REG_NOTE order during insn copy

2016-11-03 Thread Eric Botcazou
>What's your decision on this? I think that we ought to standardize on a single order for note copying in the RTL middle-end and the best way to enforce it is to have a single primitive in rtlanal.c, with an optional filtering. Bernd's patch is a step in the right direction, but doesn't

[PATCH] Convert character arrays to string csts

2016-11-03 Thread Martin Liška
Hello. This is small follow-up of the patches I sent to string folding. The patch transforms character array defined in an initializer to string constant: +const char global[] = {'a', 'b', 'c', 'd', '\0'}; Apart from that, it also enables string folding of local symbols like: + const char

Re: [PATCH][AArch64] Improve SHA1 scheduling

2016-11-03 Thread Wilco Dijkstra
Andrew Pinski wrote: > On Tue, Oct 25, 2016 at 10:08 AM, Wilco Dijkstra > wrote: > > SHA1H instructions may be scheduled after a SHA1C instruction > > that uses the same input register.  However SHA1C updates its input, > > so if SHA1H is scheduled after it, it requires

Re: [PATCH] Create x.gcov file for binary w/o x.gcda file (PR, gcov-profile/65831)

2016-11-03 Thread Martin Liška
On 08/04/2016 02:52 PM, Nathan Sidwell wrote: > On 08/04/16 08:27, Martin Liška wrote: >> Hi. >> >> Following patch is grabbed from the PR, where I just applied the patch >> and wrote a test-case which removes x.gcda file before running gcov tool. >> >> Ready to be installed? > > 2016-08-04

Re: [PATCH, LIBGCC] Avoid count_leading_zeros with undefined result (PR 78067)

2016-11-03 Thread Bernd Schmidt
On 10/29/2016 07:47 AM, Bernd Edlinger wrote: Find attached a new patch with test case. Boot-strapped on x86_64-pc-linux-gnu. Is it OK for trunk? Ok. Bernd

Re: [PATCH][rtlanal.c] Convert conditional compilation on WORD_REGISTER_OPERATIONS

2016-11-03 Thread Eric Botcazou
> Thanks, here is the patch doing this. > Committing to trunk after bootstrap and testing on x86_64. Thanks for the quick turn around! -- Eric Botcazou

Re: [PATCH 2/2, i386]: Implement TARGET_EXPAND_DIVMOD_LIBFUNC

2016-11-03 Thread Eric Botcazou
> libfunc is already implemented for all targets to use, there is also: > > OPTAB_NC(sdivmod_optab, "divmod$a4", UNKNOWN) > OPTAB_NC(udivmod_optab, "udivmod$a4", UNKNOWN) > > in optabs.def that can probably be changed for generic expansion. So what's the purpose of ix86_init_libfuncs if the

[PATCH][ARM] Fix ldrd offsets

2016-11-03 Thread Wilco Dijkstra
Fix ldrd offsets of Thumb-2 - for TARGET_LDRD the range is +-1020, without -255..4091. This reduces the number of addressing instructions when using DI mode operations (such as in PR77308). Bootstrap & regress OK. ChangeLog: 2015-11-03 Wilco Dijkstra gcc/ *

Re: [Patch, rtl] PR middle-end/78016, keep REG_NOTE order during insn copy

2016-11-03 Thread Jiong Wang
On 03/11/16 12:06, Eric Botcazou wrote: What's your decision on this? I think that we ought to standardize on a single order for note copying in the RTL middle-end and the best way to enforce it is to have a single primitive in rtlanal.c, with an optional filtering. Bernd's patch is a step

Re: Change default level for -Wimplicit-fallthrough

2016-11-03 Thread Bernd Schmidt
On 11/03/2016 12:58 PM, Jakub Jelinek wrote: On Thu, Nov 03, 2016 at 12:51:15PM +0100, Bernd Schmidt wrote: I'm concerned about the number of false positives for this warning, and judging by previous discussions, I'm not alone in this. This patch limits it to level 1 (any comment before the

[PATCH] AIX xcoff declare object name

2016-11-03 Thread David Edelsohn
During Richi's debugging of the section type conflict, he found a problem with rs6000_xcoff_declare_object_name trying to access a decl that did not exist. Fixed thusly. * config/rs6000/rs6000.c (rs6000_xcoff_declare_object_name): Use symtab_node::get_create. Index: rs6000.c

Re: Change default level for -Wimplicit-fallthrough

2016-11-03 Thread Jakub Jelinek
On Thu, Nov 03, 2016 at 01:22:11PM +0100, Bernd Schmidt wrote: > On 11/03/2016 12:58 PM, Jakub Jelinek wrote: > >On Thu, Nov 03, 2016 at 12:51:15PM +0100, Bernd Schmidt wrote: > >>I'm concerned about the number of false positives for this warning, and > >>judging by previous discussions, I'm not

Re: [Patch, rtl] PR middle-end/78016, keep REG_NOTE order during insn copy

2016-11-03 Thread Eric Botcazou
> Thanks for the feedback, I'll try to work through this. Thanks, but since there doesn't seem to be a consensus on the goal, feel free to disregard it and just implement what you need for your initial work. -- Eric Botcazou

Re: [PATCH, vec-tails] Support loop epilogue vectorization

2016-11-03 Thread Yuri Rumyantsev
Hi Richard, I did not understand your last remark: > That is, here (and avoid the FOR_EACH_LOOP change): > > @@ -580,12 +586,21 @@ vectorize_loops (void) > && dump_enabled_p ()) > dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location, >"loop

Re: [PATCH] Convert character arrays to string csts

2016-11-03 Thread Richard Biener
On Thu, Nov 3, 2016 at 1:12 PM, Martin Liška wrote: > Hello. > > This is small follow-up of the patches I sent to string folding. > The patch transforms character array defined in an initializer to string > constant: > > +const char global[] = {'a', 'b', 'c', 'd', '\0'}; > > Apart

Re: [PATCH 2/2, i386]: Implement TARGET_EXPAND_DIVMOD_LIBFUNC

2016-11-03 Thread Uros Bizjak
On Thu, Nov 3, 2016 at 1:18 PM, Eric Botcazou wrote: >> libfunc is already implemented for all targets to use, there is also: >> >> OPTAB_NC(sdivmod_optab, "divmod$a4", UNKNOWN) >> OPTAB_NC(udivmod_optab, "udivmod$a4", UNKNOWN) >> >> in optabs.def that can probably be

Re: [PATCH] Convert character arrays to string csts

2016-11-03 Thread Bernd Schmidt
On 11/03/2016 01:12 PM, Martin Liška wrote: + tree init = DECL_INITIAL (decl); + if (init + && TREE_READONLY (decl) + && can_convert_ctor_to_string_cst (init)) +DECL_INITIAL (decl) = build_string_cst_from_ctor (init); I'd merge these two new functions since they're only ever

Re: [patch, avr] Make pmem-wrap-around option as default

2016-11-03 Thread Georg-Johann Lay
On 03.11.2016 08:58, Pitchumani Sivanupandi wrote: Most of the AVR's 8k memorydevices have only rjmp instruction, not jmp. So, it is important to wrap around jump destination to check if it can reach backwards. Currently link specs passes --pmem-wrap-around=xxK when mrelax and mpmem-wrap-around

RE: [PATCH,testsuite] MIPS: Downgrade R6 to R5 if tests need branch-likely instructions.

2016-11-03 Thread Moore, Catherine
> -Original Message- > From: Toma Tabacu [mailto:toma.tab...@imgtec.com] > Sent: Thursday, November 3, 2016 6:58 AM > Subject: [PATCH,testsuite] MIPS: Downgrade R6 to R5 if tests need > branch-likely instructions. > > > gcc/testsuite/ > * gcc.target/mips/mips.exp: Add check for

Re: Change default level for -Wimplicit-fallthrough

2016-11-03 Thread Markus Trippelsdorf
On 2016.11.03 at 13:32 +0100, Jakub Jelinek wrote: > On Thu, Nov 03, 2016 at 01:22:11PM +0100, Bernd Schmidt wrote: > > On 11/03/2016 12:58 PM, Jakub Jelinek wrote: > > >On Thu, Nov 03, 2016 at 12:51:15PM +0100, Bernd Schmidt wrote: > > >>I'm concerned about the number of false positives for this

Re: [PATCH 2/2, i386]: Implement TARGET_EXPAND_DIVMOD_LIBFUNC

2016-11-03 Thread Eric Botcazou
> libfunc, as in "__{,u}divmod{di,ti}4 library function" is already > implemented in libgcc. But the enablement of this function inside the > compiler has to be performed by each target. So can we do it generically instead of duplicating it ~50 times? -- Eric Botcazou

Re: [PATCH] Convert character arrays to string csts

2016-11-03 Thread Jan Hubicka
> On 11/03/2016 01:12 PM, Martin Liška wrote: > >+ tree init = DECL_INITIAL (decl); > >+ if (init > >+ && TREE_READONLY (decl) > >+ && can_convert_ctor_to_string_cst (init)) > >+DECL_INITIAL (decl) = build_string_cst_from_ctor (init); > > I'd merge these two new functions since

Re: [Patch, rtl] PR middle-end/78016, keep REG_NOTE order during insn copy

2016-11-03 Thread Bernd Schmidt
On 11/03/2016 01:33 PM, Eric Botcazou wrote: Thanks for the feedback, I'll try to work through this. Thanks, but since there doesn't seem to be a consensus on the goal, feel free to disregard it and just implement what you need for your initial work. FWIW here's a more complete version of

RE: [PATCH,testsuite] MIPS: Downgrade R6 to R5 if tests need branch-likely instructions.

2016-11-03 Thread Matthew Fortune
Toma Tabacu writes: > The gcc.target/mips/wrap-delay.c test was failing on mips-img-* > toolchains > because it was using -mbranch-likely with an R6 target, and branch- > likely > instructions were removed in R6. > > This patch makes the testsuite downgrade to R5 if the

Re: [PATCH 2/2, i386]: Implement TARGET_EXPAND_DIVMOD_LIBFUNC

2016-11-03 Thread Uros Bizjak
On Thu, Nov 3, 2016 at 1:58 PM, Eric Botcazou wrote: >> libfunc, as in "__{,u}divmod{di,ti}4 library function" is already >> implemented in libgcc. But the enablement of this function inside the >> compiler has to be performed by each target. > > So can we do it generically

[PATCH, Fortran, v1] Restructure initialization of allocatable components

2016-11-03 Thread Andre Vehreschild
Hi all, the attached patch restructures gfortran's way of initializing components of derived types in ALLOCATE. The old way was to generate a new gfc_code-node and add it after the ALLOCATE node to initialize the the derived type on certain conditions (like initializer or allocatable components

Re: [PATCH] Create x.gcov file for binary w/o x.gcda file (PR, gcov-profile/65831)

2016-11-03 Thread Jan Hubicka
> On 08/04/2016 02:52 PM, Nathan Sidwell wrote: > > On 08/04/16 08:27, Martin Liška wrote: > >> Hi. > >> > >> Following patch is grabbed from the PR, where I just applied the patch > >> and wrote a test-case which removes x.gcda file before running gcov tool. > >> > >> Ready to be installed? > >

RE: [PATCH] MIPS: If a test in the MIPS testsuite requires standard library support check the sysroot supports the required test options.

2016-11-03 Thread Toma Tabacu
> -Original Message- > From: gcc-patches-ow...@gcc.gnu.org [mailto:gcc-patches- > ow...@gcc.gnu.org] On Behalf Of Andrew Bennett > Sent: 03 November 2016 11:33 > To: Matthew Fortune; 'Moore, Catherine'; 'gcc-patches@gcc.gnu.org' > Subject: RE: [PATCH] MIPS: If a test in the MIPS testsuite

Re: Change default level for -Wimplicit-fallthrough

2016-11-03 Thread Jakub Jelinek
On Thu, Nov 03, 2016 at 01:55:33PM +0100, Markus Trippelsdorf wrote: > On 2016.11.03 at 13:32 +0100, Jakub Jelinek wrote: > > On Thu, Nov 03, 2016 at 01:22:11PM +0100, Bernd Schmidt wrote: > > > On 11/03/2016 12:58 PM, Jakub Jelinek wrote: > > > >On Thu, Nov 03, 2016 at 12:51:15PM +0100, Bernd

Re: [C++ Patch/RFC] PR 67980 ("left shift count is negative [-Wshift-count-negative] generated for unreachable code")

2016-11-03 Thread Jason Merrill
On Tue, Oct 18, 2016 at 4:26 PM, Paolo Carlini wrote: > Thus, I'm back to one of my first tries earlier today: a much more > conservative change which uses fold_non_dependent_expr only for the purpose > of suppressing the unwanted warnings, see the below. This looks

Re: Implement -Wduplicated-branches (PR c/64279) (v3)

2016-11-03 Thread Jason Merrill
On Thu, Nov 3, 2016 at 7:24 AM, Marek Polacek wrote: > On Tue, Nov 01, 2016 at 02:53:58PM +0100, Jakub Jelinek wrote: >> On Tue, Nov 01, 2016 at 09:41:20AM -0400, Jason Merrill wrote: >> > On Tue, Oct 25, 2016 at 9:59 AM, Marek Polacek wrote: >> > > On

Re: [PATCH, RFC] Introduce -fsanitize=use-after-scope (v2)

2016-11-03 Thread Martin Liška
On 11/02/2016 03:51 PM, Jakub Jelinek wrote: > On Wed, Nov 02, 2016 at 03:38:25PM +0100, Martin Liška wrote: >> it converts: >> foo () >> { >> char a; >> char * p; >> char _1; >> int _2; >> int _8; >> int _9; >> >> : >> ASAN_MARK (2, , 1); >> a = 0; >> p_6 = >> ASAN_MARK (1,

[PATCH, RFC] Improve ivopts group costs

2016-11-03 Thread Evgeny Kudryashov
Hello, I'm facing the following problem related to ivopts. The problem is that GCC generates a lot of induction variables and as a result there is an unnecessary increase of stack usage and register pressure. For instance, for the attached testcase (tc_ivopts.c) GCC generates 26 induction

Re: Implement -Wduplicated-branches (PR c/64279) (v3)

2016-11-03 Thread Jakub Jelinek
On Thu, Nov 03, 2016 at 09:27:55AM -0400, Jason Merrill wrote: > On Thu, Nov 3, 2016 at 7:24 AM, Marek Polacek wrote: > > On Tue, Nov 01, 2016 at 02:53:58PM +0100, Jakub Jelinek wrote: > >> On Tue, Nov 01, 2016 at 09:41:20AM -0400, Jason Merrill wrote: > >> > On Tue, Oct 25,

Re: Change default level for -Wimplicit-fallthrough

2016-11-03 Thread Markus Trippelsdorf
On 2016.11.03 at 14:24 +0100, Jakub Jelinek wrote: > On Thu, Nov 03, 2016 at 01:55:33PM +0100, Markus Trippelsdorf wrote: > > On 2016.11.03 at 13:32 +0100, Jakub Jelinek wrote: > > > On Thu, Nov 03, 2016 at 01:22:11PM +0100, Bernd Schmidt wrote: > > > > On 11/03/2016 12:58 PM, Jakub Jelinek wrote:

Re: [PATCH, RFC] Introduce -fsanitize=use-after-scope (v2)

2016-11-03 Thread Jakub Jelinek
Hi! FYI, I think it is much more important to get the initial patch in, so resolve the switch + declarations inside of its body stuff, add testcases for that and post for re-review and check in. These optimizations can be done even in stage3. On Thu, Nov 03, 2016 at 02:34:47PM +0100, Martin

Re: [PATCH, GCC/ARM] Fix PR77933: stack corruption on ARM when using high registers and lr

2016-11-03 Thread Wilco Dijkstra
Hi, The patch looks correct, however I would suggest to rewrite this bit of the code urgently in separate patch as it is way too complex to assert it is now bug free - there are too many possible failure scenarios to list... Also it generates quite inefficient code - pushable_regs should include

Re: Change default level for -Wimplicit-fallthrough

2016-11-03 Thread Jakub Jelinek
On Thu, Nov 03, 2016 at 02:35:57PM +0100, Markus Trippelsdorf wrote: > I don't have gathered detailed statistics. But for example a simple > /* drop through */ in a package header file will of course cause many > bogus warnings during the build on level 2. > For the Linux kernel false positives

Re: Change default level for -Wimplicit-fallthrough

2016-11-03 Thread Bernd Schmidt
On 11/03/2016 02:47 PM, Jakub Jelinek wrote: On Thu, Nov 03, 2016 at 02:35:57PM +0100, Markus Trippelsdorf wrote: I don't have gathered detailed statistics. But for example a simple /* drop through */ in a package header file will of course cause many bogus warnings during the build on level

Re: Change default level for -Wimplicit-fallthrough

2016-11-03 Thread Jakub Jelinek
On Thu, Nov 03, 2016 at 02:48:33PM +0100, Bernd Schmidt wrote: > > On 11/03/2016 02:47 PM, Jakub Jelinek wrote: > >On Thu, Nov 03, 2016 at 02:35:57PM +0100, Markus Trippelsdorf wrote: > >>I don't have gathered detailed statistics. But for example a simple > >>/* drop through */ in a package

Re: Change default level for -Wimplicit-fallthrough

2016-11-03 Thread Markus Trippelsdorf
On 2016.11.03 at 14:47 +0100, Jakub Jelinek wrote: > On Thu, Nov 03, 2016 at 02:35:57PM +0100, Markus Trippelsdorf wrote: > > I don't have gathered detailed statistics. But for example a simple > > /* drop through */ in a package header file will of course cause many > > bogus warnings during the

Re: Change default level for -Wimplicit-fallthrough

2016-11-03 Thread Jakub Jelinek
On Thu, Nov 03, 2016 at 02:55:03PM +0100, Markus Trippelsdorf wrote: > On 2016.11.03 at 14:47 +0100, Jakub Jelinek wrote: > > On Thu, Nov 03, 2016 at 02:35:57PM +0100, Markus Trippelsdorf wrote: > > > I don't have gathered detailed statistics. But for example a simple > > > /* drop through */ in a

Re: [PATCH, RFC] Introduce -fsanitize=use-after-scope (v2)

2016-11-03 Thread Martin Liška
On 11/03/2016 02:44 PM, Jakub Jelinek wrote: > Hi! > > FYI, I think it is much more important to get the initial patch in, so > resolve the switch + declarations inside of its body stuff, add testcases > for that and post for re-review and check in. > These optimizations can be done even in

Re: [PATCH 2/2, i386]: Implement TARGET_EXPAND_DIVMOD_LIBFUNC

2016-11-03 Thread Eric Botcazou
> I guess it can be done. Currently the expander goes: > > --cut here-- > /* Check if optab_handler exists for divmod_optab for given mode. */ > if (optab_handler (tab, mode) != CODE_FOR_nothing) > { > quotient = gen_reg_rtx (mode); > remainder = gen_reg_rtx (mode); >

Re: [PATCH, RFC] Introduce -fsanitize=use-after-scope (v2)

2016-11-03 Thread Jakub Jelinek
On Thu, Nov 03, 2016 at 03:02:21PM +0100, Martin Liška wrote: > > But how would you be able to find out if there isn't any return *ptr; after > > the scope or similar (as MEM_REF)? With is_gimple_reg, they will be turned > > into SSA form and you can easily verify (uses of ASAN_POISON are a

Re: Change default level for -Wimplicit-fallthrough

2016-11-03 Thread Markus Trippelsdorf
On 2016.11.03 at 14:57 +0100, Jakub Jelinek wrote: > On Thu, Nov 03, 2016 at 02:55:03PM +0100, Markus Trippelsdorf wrote: > > On 2016.11.03 at 14:47 +0100, Jakub Jelinek wrote: > > > On Thu, Nov 03, 2016 at 02:35:57PM +0100, Markus Trippelsdorf wrote: > > > > I don't have gathered detailed

Re: [Patch, rtl] PR middle-end/78016, keep REG_NOTE order during insn copy

2016-11-03 Thread Eric Botcazou
> FWIW here's a more complete version of my patch which I'm currently > testing. Let me know if you think it's at least a good enough > intermediate step to be installed. It is, thanks. > I think, the sel-sched example notwithstanding, this is something that > normally should not be needed

Re: [PATCH 2/2, i386]: Implement TARGET_EXPAND_DIVMOD_LIBFUNC

2016-11-03 Thread Prathamesh Kulkarni
On 3 November 2016 at 18:36, Uros Bizjak wrote: > On Thu, Nov 3, 2016 at 1:58 PM, Eric Botcazou wrote: >>> libfunc, as in "__{,u}divmod{di,ti}4 library function" is already >>> implemented in libgcc. But the enablement of this function inside the >>>

[PATCH GCC]Clean pedantic calls and useless lvalue code in fold_cond_expr_with_comparison

2016-11-03 Thread Bin Cheng
Hi, According to analysis given by https://gcc.gnu.org/ml/gcc/2016-10/msg00228.html, calls to pedantic_non_lvalue_loc and code handling lvalue in fold_cond_expr_with_comparison are useless now. Given this is complicated legacy code, it may be better to change code step by step, rather than

[fixincludes, v3] Don't define libstdc++-internal macros in Solaris 10+

2016-11-03 Thread Rainer Orth
As I've noticed some time ago, recent versions of Solaris include this little gem: #if __cplusplus >= 201103L #undef _GLIBCXX_USE_C99_MATH #undef _GLIBCXX_USE_C99_MATH_TR1 #endif This renders a couple of perfectly good libstdc++ tests as UNSUPPORTED and is completely unsustainable. Agreement

Re: [PATCH, RFC] Introduce -fsanitize=use-after-scope (v2)

2016-11-03 Thread Martin Liška
On 11/03/2016 03:03 PM, Jakub Jelinek wrote: > On Thu, Nov 03, 2016 at 03:02:21PM +0100, Martin Liška wrote: >>> But how would you be able to find out if there isn't any return *ptr; after >>> the scope or similar (as MEM_REF)? With is_gimple_reg, they will be turned >>> into SSA form and you can

Re: [patch, libgomp, OpenACC] Additional enter/exit data map handling

2016-11-03 Thread Chung-Lin Tang
Ping this patch again. On 2016/9/21 12:43 AM, Cesar Philippidis wrote: >> +/* Returns the number of mappings associated with the pointer or pset. PSET >> > + have three mappings, whereas pointer have two. */ >> > + >> > static int >> > -find_pset (int pos, size_t mapnum, unsigned short

Re: [match.pd] Fix for PR35691

2016-11-03 Thread Prathamesh Kulkarni
On 3 November 2016 at 16:13, Richard Biener wrote: > On Thu, 3 Nov 2016, Prathamesh Kulkarni wrote: > >> Hi Richard, >> The attached patch tries to fix PR35691, by adding the following two >> transforms to match.pd: >> (x == 0 && y == 0) -> (x | typeof(x)(y)) == 0. >> (x != 0

[PATCH] Make direct emission of time profiler counter

2016-11-03 Thread Martin Liška
Hello. As Honza noticed we spent quite some time in __gcov_time_profiler: perf report for Postgres make check command: 4.10% postgres postgres[.]__gcov_time_profiler Thus I rewrote the profiling code directly to GIMPLE statements: _4 = __gcov7.main[0]; if (_4 == 0) goto ; else

[RFC] Check number of uses in simplify_cond_using_ranges().

2016-11-03 Thread Dominik Vogt
I've been trying to fix some bad tree-ssa related optimisation for s390x and come up with the attached experimental patch. The patch is not really good - it breaks some situations in which the optimisation was useful. With this code: void bar(long); void foo (char a) { long l;

Re: [RFC] Check number of uses in simplify_cond_using_ranges().

2016-11-03 Thread Dominik Vogt
On Thu, Nov 03, 2016 at 04:03:22PM +0100, Dominik Vogt wrote: > I've been trying to fix some bad tree-ssa related optimisation for > s390x and come up with the attached experimental patch. The patch > is not really good - it breaks some situations in which the > optimisation was useful. With

Re: [PATCH] Make direct emission of time profiler counter

2016-11-03 Thread Jan Hubicka
> > 2016-10-31 Martin Liska > > * libgcov-profiler.c (__gcov_time_profiler): Remove. > (__gcov_time_profiler_atomic): Likewise. > > gcc/ChangeLog: > > 2016-10-31 Martin Liska > > * profile.c (instrument_values): Fix coding style. >

Re: [patch,testsuite] Support dg-require-effective-target label_offsets.

2016-11-03 Thread Georg-Johann Lay
On 28.10.2016 17:58, Mike Stump wrote: On Oct 27, 2016, at 3:16 AM, Georg-Johann Lay wrote: Now imagine some arithmetic like & - & This might result in one or two stub addresses, and difference between such addresses is a complete different thing than the difference between

Re: [PATCH] PR77359: Properly align local variables in functions calling alloca.

2016-11-03 Thread David Edelsohn
[Please cc me and Segher on PowerPC / AIX patches.] I bootstrapped successfully with the patch and ran the testsuite. Without patch: https://gcc.gnu.org/ml/gcc-testresults/2016-11/msg00186.html With patch: https://gcc.gnu.org/ml/gcc-testresults/2016-11/msg00233.html Not exactly the same

Re: [RFC] Check number of uses in simplify_cond_using_ranges().

2016-11-03 Thread Eric Botcazou
> Is VRP the right pass to do this optimisation or should a later > pass rather attempt to eliminate the new use of b_5 instead? Uli > has brought up the idea a mini "sign extend elimination" pass that > checks if the result of a sign extend could be replaced by the > original quantity in all

Re: [PATCH] bb-reorder: Improve compgotos pass (PR71785)

2016-11-03 Thread Segher Boessenkool
On Thu, Nov 03, 2016 at 09:29:07AM +0100, Richard Biener wrote: > On Wed, Nov 2, 2016 at 4:27 PM, Segher Boessenkool > wrote: > > On Wed, Nov 02, 2016 at 02:51:41PM +0100, Richard Biener wrote: > >> >> I don't believe it needs a cleanup on every iteration. One cleanup

Re: [RFC] Check number of uses in simplify_cond_using_ranges().

2016-11-03 Thread Dominik Vogt
On Thu, Nov 03, 2016 at 04:29:05PM +0100, Eric Botcazou wrote: > > Is VRP the right pass to do this optimisation or should a later > > pass rather attempt to eliminate the new use of b_5 instead? Uli > > has brought up the idea a mini "sign extend elimination" pass that > > checks if the result

Re: [PATCH, RFC] Improve ivopts group costs

2016-11-03 Thread Bin.Cheng
On Thu, Nov 3, 2016 at 1:35 PM, Evgeny Kudryashov wrote: > Hello, > > I'm facing the following problem related to ivopts. The problem is that GCC > generates a lot of induction variables and as a result there is an > unnecessary increase of stack usage and register pressure.

[PATCH] combine lhs zero_extract fix (PR78186)

2016-11-03 Thread Segher Boessenkool
I managed to forget to mask the thing inserted. Tested on powerpc64-linux {-m32,-m64}, and Bin tested on arm. Applying to trunk. Segher 2016-11-03 Segher Boessenkool PR rtl-optimization/78186 * combine.c (change_zero_ext): Mask the RHS of a

[SPARC] Remove couple of obsolete patterns

2016-11-03 Thread Eric Botcazou
The vec_interleave_{low, high} standard patterns were removed 5 years ago. Tested on SPARC/Solaris, applied on the mainline. 2016-11-03 Eric Botcazou * config/sparc/sparc.md (vec_interleave_lowv8qi): Delete. (vec_interleave_highv8qi): Likewise. --

Re: [PATCH] Add mcpu flag for Qualcomm falkor core

2016-11-03 Thread Andrew Pinski
On Thu, Nov 3, 2016 at 3:03 AM, Siddhesh Poyarekar wrote: > This adds an mcpu option for the upcoming Qualcomm Falkor core. This > is identical to the qdf24xx part that was added earlier and hence > retains the same tuning structure and continues to have the a57 >

[openacc] add warnings for unused parallelism

2016-11-03 Thread Cesar Philippidis
OpenACC permits the user to request more gang, worker and vector level parallelism than what the compiler can utilize. For instance, if the user writes worker routine without including a worker-partitioned loop, the compiler will not generate worker-partitioned code for that function. The intent

Re: [ipa-vrp] ice in set_value_range

2016-11-03 Thread Martin Jambor
Hi, On Fri, Oct 28, 2016 at 01:58:13PM +1100, kugan wrote: > > Do I understand it correctly that extract_range_from_unary_expr deals > > with any potential type conversions better (compared to what you did > > before here)? > > Yes, this can be wrong at times too as reported in >

[PATCH] Print repeated rtl vector elements in a nicer way

2016-11-03 Thread Martin Jambor
Hi, this patch comes from our GCN BE branch. Because vectors of that architectures have many elements, RTL dumps can get quite unwieldy when all elements are printed out all the time. However, pretty much all the time it is the same value repeated over and over again, which lead us to the

[PATCH] DW_TAG_ptr_to_member_type for PMF and DW_AT_{,rvalue_}reference for those (take 2)

2016-11-03 Thread Jakub Jelinek
On Wed, Nov 02, 2016 at 01:19:09PM -0400, Jason Merrill wrote: > On Wed, Nov 2, 2016 at 12:33 PM, Jakub Jelinek wrote: > > On Wed, Nov 02, 2016 at 04:44:05PM +0100, Jakub Jelinek wrote: > >> which means if gen_type_die or gen_type_die_with_usage doesn't > >> use the langhook,

Re: [PATCH] Print repeated rtl vector elements in a nicer way

2016-11-03 Thread Bernd Schmidt
On 11/03/2016 05:35 PM, Martin Jambor wrote: * print-rtl.c (print_rtx_operand_codes_E_and_V): Print how many times an element is repeated istead of printing each repeated element. "instead" --- gcc/print-rtl.c | 15 ++- 1 file changed, 14 insertions(+), 1

[PATCH] Fix dwarf2out related bootstrap failure on Solaris (PR debug/78191)

2016-11-03 Thread Jakub Jelinek
Hi! My recent optimize_abbrev_table optimization apparently broke Solaris bootstrap. The bug is specific I think just to -gdwarf-{2,3} -gno-strict-dwarf, where DW_FORM_exprloc can't be used for location expressions and some location expression contains

[PATCH, GCC/ARM] Fix PR77904: callee-saved register trashed when clobbering sp

2016-11-03 Thread Thomas Preudhomme
Hi, When using a callee-saved register to save the frame pointer the Thumb-1 prologue fails to save the callee-saved register before that. For ARM and Thumb-2 targets the frame pointer is handled as a special case but nothing is done for Thumb-1 targets. This patch adds the same logic for

Re: [Patch, testsuite] Add new effective-target_store_merge

2016-11-03 Thread Mike Stump
On Nov 3, 2016, at 2:29 AM, Senthil Kumar Selvaraj wrote: > > The below patch adds a new effective target keyword (store_merge) for > use in the store_merging_xxx.c tests. > > The tests currently require non_strict_align, but they still fail for the > avr.

Re: [match.pd] Fix for PR35691

2016-11-03 Thread Marc Glisse
On Thu, 3 Nov 2016, Prathamesh Kulkarni wrote: On 3 November 2016 at 16:13, Richard Biener wrote: On Thu, 3 Nov 2016, Prathamesh Kulkarni wrote: Hi Richard, The attached patch tries to fix PR35691, by adding the following two transforms to match.pd: (x == 0 && y == 0) ->

[PING!] Re: [PATCH, Fortran] DEC Compatibility: Default missing exponents to 0 with -fdec

2016-11-03 Thread Fritz Reese
https://gcc.gnu.org/ml/fortran/2016-10/msg00222.html On Wed, Oct 26, 2016 at 10:14 AM, Fritz Reese wrote: > All, > > Attached is a patch to the GNU Fortran front-end and runtime library > (libgfortran) which accepts real numbers with missing exponents as if > '0' was given

  1   2   >