Re: [PATCH] Fix wrong code on aarch64 due to paradoxical subreg

2016-08-02 Thread Bernd Schmidt
On 08/02/2016 06:46 PM, Segher Boessenkool wrote: On Tue, Aug 02, 2016 at 09:21:34AM -0600, Jeff Law wrote: However I think there are more paradoxical subregs generated all over, but the aarch64 insv code pattern did trigger more hidden bugs than any other port. It is certainly unfortunate

Re: [PATCH] nvptx: do not implicitly enable -ftoplevel-reorder

2016-08-01 Thread Bernd Schmidt
On 08/01/2016 10:44 PM, Joseph Myers wrote: On Fri, 22 Jul 2016, Bernd Schmidt wrote: What's the motivation for supporting -fno-toplevel-reorder anyway? That's practically just a legacy mode as far as I know. It's for code that uses toplevel asms in ways for which it matters where

Re: [libiberty] fix unbounded alloca in make_relative_prefix_1

2016-07-29 Thread Bernd Schmidt
On 07/29/2016 05:07 PM, Aldy Hernandez wrote: There is currently only one use, but I was thinking that perhaps if there were other alloca uses added later (I hope not), that they could all use the same macro. But I am more than happy to place this definition it in it's only use file for now, if

Re: [libiberty] fix unbounded alloca in make_relative_prefix_1

2016-07-29 Thread Bernd Schmidt
On 07/29/2016 02:30 PM, Aldy Hernandez wrote: +/* Max number of alloca bytes per call before we must switch to malloc. + + ?? Swiped from gnulib's regex_internal.h header. Is this actually + the case? This number seems arbitrary, though sane. + + The OS usually guarantees only one guard

Re: [Patch, tentative, reload] Make push_reload work with more types of subregs?

2016-07-29 Thread Bernd Schmidt
On 07/28/2016 09:33 AM, Senthil Kumar Selvaraj wrote: Is there a reason why only REG and SYMBOL_REFs get valid subreg_in_class? I tried extending it handle constants and PLUS expressions, and it fixes PR 71873. It also fixes a another bug that was a work around for the reload failure

Re: C PATCH for c/71583 (ICE with bogus compound literal)

2016-07-29 Thread Bernd Schmidt
On 07/28/2016 03:19 PM, Marek Polacek wrote: Since r157233, build_compound_literal will return error_mark_node for erroneous initializers of compound literals. This caused an ICE in c_parser_postfix_expression_after_paren_type because the code dealing with evaluating variably modified types

Re: C PATCH for c/71574 (ICE with alloc_align attribute)

2016-07-29 Thread Bernd Schmidt
On 07/28/2016 03:26 PM, Marek Polacek wrote: Many attributes that accept integer constant as a parameter call default_conversion for such constants to perform the usual arithmetic conversions. The call to default_conversion is always guarded so as to prevent a NULL_TREE, an IDENTIFIER_NODE, or

Re: [PATCH] nvptx: do not implicitly enable -ftoplevel-reorder

2016-07-22 Thread Bernd Schmidt
On 07/22/2016 05:19 PM, Alexander Monakov wrote: I hope I've satisfactorily explained the failures you've pointed out (thanks for the data). I think I should leave the choice of what to do next (revert the patch or leave it in and install fixups where appropriate) up to you? What's the

Re: Implement -Wimplicit-fallthrough: the rest

2016-07-22 Thread Bernd Schmidt
On 07/22/2016 01:15 PM, Jakub Jelinek wrote: @@ -32335,6 +32341,7 @@ rs6000_handle_altivec_attribute (tree *node, case V4SImode: case V8HImode: case V16QImode: case V4SFmode: case V2DImode: case V2DFmode: result = type; + gcc_fallthrough (); default:

Re: [Re: RFC: Patch 1/2 v3] New target hook: max_noce_ifcvt_seq_cost

2016-07-21 Thread Bernd Schmidt
On 07/20/2016 06:39 PM, James Greenhalgh wrote: On Wed, Jul 20, 2016 at 01:41:39PM +0200, Bernd Schmidt wrote: How about wrapping the param value into COSTS_N_INSNS, to make the value of the param less dependent on compiler internals? I did consider this, but found it hard to word

Re: [PATCH] Fix unsafe function attributes for special functions (PR 71876)

2016-07-21 Thread Bernd Schmidt
On 07/21/2016 01:16 PM, Jakub Jelinek wrote: On Thu, Jul 21, 2016 at 11:04:48AM +, Bernd Edlinger wrote: bool +gimple_alloca_call_p (const gimple *stmt) +{ + tree fndecl; + + if (!is_gimple_call (stmt)) +return false; + + fndecl = gimple_call_fndecl (stmt); + if (fndecl &&

Re: [PATCH]: Introduce HOST_WIDE_INT_0{,U}

2016-07-20 Thread Bernd Schmidt
On 07/20/2016 11:16 PM, Uros Bizjak wrote: As suggested by Jakub. 2016-07-20 Uros Bizjak * hwint.h (HOST_WIDE_INT_0): New define. (HOST_WIDE_INT_0U): Ditto. * double-int.c: Use HOST_WIDE_INT_0 instead of (HOST_WIDE_INT) 0. * dse.c: Use HOST_WIDE_INT_0U

Re: Merge switch statements in tree-cfgcleanup

2016-07-20 Thread Bernd Schmidt
On 07/20/2016 06:09 PM, Jeff Law wrote: So I'm going to let Richi run with the review on this one since the two of you are already iterating. But I did have one comment on the placement of the pass. I believe one of the key things to consider for whether or not something like this belongs in

Re: [PATCH]: Use HOST_WIDE_INT_{,M}1{,U} some more

2016-07-20 Thread Bernd Schmidt
On 07/20/2016 02:25 PM, Uros Bizjak wrote: 2016-07-19 14:46 GMT+02:00 Uros Bizjak : The result of exercises with sed in gcc/ directory. Some more conversions: 2016-07-20 Uros Bizjak * cse.c: Use HOST_WIDE_INT_M1 instead of ~(HOST_WIDE_INT) 0.

Re: [Re: RFC: Patch 1/2 v3] New target hook: max_noce_ifcvt_seq_cost

2016-07-20 Thread Bernd Schmidt
On 07/20/2016 11:51 AM, James Greenhalgh wrote: 2016-07-20 James Greenhalgh * target.def (max_noce_ifcvt_seq_cost): New. * doc/tm.texi.in (TARGET_MAX_NOCE_IFCVT_SEQ_COST): Document it. * doc/tm.texi: Regenerate. * targhooks.h

Re: [PATCH] Avoid invoking ranlib on libbackend.a

2016-07-20 Thread Bernd Schmidt
On 07/19/2016 10:20 AM, Richard Biener wrote: I like it. Improving re-build time in my dev tree is very much welcome, and yes, libbackend build time is a big part of it usually (plus of course cc1 link time). Since that wasn't an entirely explicit ack, I'll add mine. Thank you for doing

Re: [PATCH 8/9] shrink-wrap: shrink-wrapping for separate concerns

2016-07-20 Thread Bernd Schmidt
On 07/19/2016 05:35 PM, Segher Boessenkool wrote: On Tue, Jul 19, 2016 at 04:49:26PM +0200, Bernd Schmidt wrote: But you need the profile to make even reasonably good decisions. I'm not worried about making cost decisions: as far as I'm concerned it's perfectly fine for that. I'm worried

Re: Merge switch statements in tree-cfgcleanup

2016-07-20 Thread Bernd Schmidt
On 07/19/2016 01:18 PM, Richard Biener wrote: On Tue, Jul 19, 2016 at 1:07 PM, Bernd Schmidt <bschm...@redhat.com> wrote: On 07/19/2016 12:35 PM, Richard Biener wrote: I think that start/end_recording_case_labels also merged adjacent labels via group_case_labels_stmt. Not sure why yo

Re: [patch] Add new hook to diagnose address space usage (take #2)

2016-07-20 Thread Bernd Schmidt
On 07/19/2016 10:16 AM, Georg-Johann Lay wrote: Done. Attached is the updated version of the change, log entry is the same as before. Johann LGTM. Bernd

Re: [PATCH 8/9] shrink-wrap: shrink-wrapping for separate concerns

2016-07-19 Thread Bernd Schmidt
On 07/19/2016 04:46 PM, Segher Boessenkool wrote: But you need the profile to make even reasonably good decisions. I'm not worried about making cost decisions: as far as I'm concerned it's perfectly fine for that. I'm worried about correctness - you can't validly save registers inside a

Re: Merge switch statements in tree-cfgcleanup

2016-07-19 Thread Bernd Schmidt
On 07/19/2016 12:35 PM, Richard Biener wrote: I think that start/end_recording_case_labels also merged adjacent labels via group_case_labels_stmt. Not sure why you need to stop recording case labels during the transform. Is this because you are building a new switch stmt? It's because the

Re: Merge switch statements in tree-cfgcleanup

2016-07-19 Thread Bernd Schmidt
On 07/19/2016 12:22 PM, Marc Glisse wrote: On Tue, 19 Jul 2016, Bernd Schmidt wrote: On 07/19/2016 12:09 PM, Richard Biener wrote: I saw walks over stmts of a BB. IMHO that's a no-go. Only to find the first or last nondebug one. Is that unacceptable? Does

Re: Merge switch statements in tree-cfgcleanup

2016-07-19 Thread Bernd Schmidt
On 07/19/2016 12:09 PM, Richard Biener wrote: I saw walks over stmts of a BB. IMHO that's a no-go. Only to find the first or last nondebug one. Is that unacceptable? I'm thinking of switch (a) { ... case n: do-stuff; default: switch (a) { case n:

Re: Merge switch statements in tree-cfgcleanup

2016-07-19 Thread Bernd Schmidt
On 07/19/2016 10:07 AM, Richard Biener wrote: This is not appropriate for CFG cleanup due to its complexity not being O(# bbs + # edges). I tried hard in the past to make it so (at least when no transform is done). Why wouldn't it be, if no transform is done? Assuming we visit each bb once,

Re: [PATCH 8/9] shrink-wrap: shrink-wrapping for separate concerns

2016-07-18 Thread Bernd Schmidt
On 07/18/2016 06:34 PM, Segher Boessenkool wrote: + /* The frequency of executing the prologue for this BB and all BBs + dominated by it. */ + gcov_type cost; Is this frequency consideration the only thing that attempts to prevent placing prologue insns into loops? Yes. The

Merge switch statements in tree-cfgcleanup

2016-07-18 Thread Bernd Schmidt
The motivating example for this patch was a change that was submitted for genattrtab last year, which would have made us generate switch (type = get_attr_type (insn)) { ... some cases ... default: switch (type = get_attr_type (insn))) { ... some other cases ...

Re: [patch] Add new hook to diagnose address space usage

2016-07-18 Thread Bernd Schmidt
On 07/14/2016 05:11 PM, Georg-Johann Lay wrote: The hook allows better diagnostics: The address spaces are registered with c_register_addr_space and if the parser comes across an address space it provides the hook with the needed information, in particular the location of the token so that the

Re: [PATCH GCC]Remove support for -funsafe-loop-optimizations

2016-07-15 Thread Bernd Schmidt
On 07/15/2016 07:07 PM, Bin Cheng wrote: Bootstrap and test on x86_64. Is it OK? If you do this you'll also need to remove the use in config/bfin. Bernd

Re: [PATCH v5] Allocate constant size dynamic stack space in the prologue

2016-07-15 Thread Bernd Schmidt
On 07/15/2016 02:22 PM, Dominik Vogt wrote: Final version 6 with the stray comment removed (was a harmless oversight). Ok, let's put it in. Bernd

Re: C, C++: Fix PR 69733 (bad location for ignored qualifiers warning)

2016-07-15 Thread Bernd Schmidt
On 06/22/2016 05:37 AM, Jeff Law wrote: It looks like this stalled... Anyway, it's fine for the trunk. Some of the surrounding code was changed a bit to produce different errors for different C standards, so I had to make an adjustment to the patch. While I was here, I added cdw_atomic to

Re: [PATCH 8/9] shrink-wrap: shrink-wrapping for separate concerns

2016-07-15 Thread Bernd Schmidt
I still have misgivings about all the changes needed to the following passes, but I guess there's no choice but to live with it. So, I'm trying to look at this patch, but I'm finding it fairly impenetrable and underdocumented. + /* The concerns for which we want a prologue placed on this

Re: [PATCH v5] Allocate constant size dynamic stack space in the prologue

2016-07-15 Thread Bernd Schmidt
On 07/14/2016 11:10 AM, Dominik Vogt wrote: - if (flag_stack_usage_info) -stack_usage_size += extra; + /*!!!*/ + if (flag_stack_usage_info && pstack_usage_size) +*pstack_usage_size += extra; What does the comment mean? Whatever it is needs to be addressed and the comment removed.

Re: [C PATCH] For implicit function declaration suggestions only consider fns and fn pointers (PR c/71858)

2016-07-15 Thread Bernd Schmidt
On 07/14/2016 04:53 PM, Jakub Jelinek wrote: 2016-07-14 Jakub Jelinek PR c/71858 * c-common.h (enum lookup_name_fuzzy_kind): Add FUZZY_LOOKUP_FUNCTION_NAME. * c-decl.c (implicit_decl_warning): Use FUZZY_LOOKUP_FUNCTION_NAME instead

Re: Fix PR44281 (bad RA with global regs)

2016-07-13 Thread Bernd Schmidt
On 07/13/2016 05:29 PM, Dominik Vogt wrote: Unfortunately this patch (or whatever got actually committed) has broken the gcc.target/s390/pr679443.c test case, which is a bit fishy (see code snippet below). I assign most registers to global variables and then use some complicated arithmetics

Re: [PATCH], PowerPC support to enable -mlra and/or -mfloat128

2016-07-12 Thread Bernd Schmidt
On 07/12/2016 06:31 PM, Segher Boessenkool wrote: Do you have a testcase? This sounds like fun :-) This is bfin-elf, gcc.c-torture/compile/pr59417.c, -O3 -fomit-frame-pointer. Bernd

Re: [PATCH], PowerPC support to enable -mlra and/or -mfloat128

2016-07-12 Thread Bernd Schmidt
On 07/12/2016 02:48 PM, Bernd Schmidt wrote: No. You can reproduce issues with Blackfin easily by enabling LRA for it, and I described the C6X issues when the LRA patches were posted for review. That was here: https://gcc.gnu.org/ml/gcc-patches/2012-10/msg00235.html The Blackfin thing

Re: Implement -Wswitch-fallthrough: rs6000

2016-07-12 Thread Bernd Schmidt
On 07/12/2016 04:19 PM, Marek Polacek wrote: @@ -30191,6 +30200,7 @@ rs6000_adjust_cost (rtx_insn *insn, rtx link, rtx_insn *dep_insn, int cost) && (INSN_CODE (dep_insn) >= 0) && (get_attr_type (dep_insn) == TYPE_MFFGPR)) return 2; +

Re: Implement -Wswitch-fallthrough

2016-07-12 Thread Bernd Schmidt
On 07/12/2016 04:14 PM, Jakub Jelinek wrote: On Tue, Jul 12, 2016 at 04:08:02PM +0200, Marek Polacek wrote: On Tue, Jul 12, 2016 at 09:57:01AM -0400, NightStrike wrote: From http://security.coverity.com/blog/2013/Sep/gimme-a-break.html: Thanks, this is useful. We also suppress a case

Re: [PATCH] Fix PR rtl-optimization/71634

2016-07-12 Thread Bernd Schmidt
On 07/08/2016 04:27 PM, Martin Liška wrote: On 07/08/2016 02:54 PM, Martin Liška wrote: On 07/08/2016 01:59 PM, Bernd Schmidt wrote: Gah, that's not right, that'll swap the numbers of kept/removed loops. I think the right answer is simply for (i = 0; i < n - IRA_MAX_LOOPS_NUM

Re: [PATCH], PowerPC support to enable -mlra and/or -mfloat128

2016-07-12 Thread Bernd Schmidt
On 07/12/2016 02:45 PM, Segher Boessenkool wrote: On Tue, Jul 12, 2016 at 02:40:28PM +0200, Bernd Schmidt wrote: On 07/12/2016 02:15 PM, Segher Boessenkool wrote: How can LRA ever be made default for all targets without breaking those that do not want to change? LRA advocates would have

Re: [PATCH], PowerPC support to enable -mlra and/or -mfloat128

2016-07-12 Thread Bernd Schmidt
On 07/12/2016 02:15 PM, Segher Boessenkool wrote: How can LRA ever be made default for all targets without breaking those that do not want to change? LRA advocates would have to fix the issues with it that prevent it from being usable on certain targets. Based on my initial experiments with

Re: [PATCH] - improve sprintf buffer overflow detection (middle-end/49905)

2016-07-12 Thread Bernd Schmidt
On 07/01/2016 08:15 PM, Martin Sebor wrote: The attached patch enhances compile-time checking for buffer overflow and output truncation in non-trivial calls to the sprintf family of functions under a new option -Wformat-length=[12]. This initial patch handles printf directives with string,

Re: Implement -Wswitch-fallthrough

2016-07-12 Thread Bernd Schmidt
On 07/11/2016 09:43 PM, Marek Polacek wrote: This warning is enabled by default for C/C++. I was more inclined to put this into -Wall, but our common.opt machinery doesn't seem to allow that (ugh!). Add me to the list of folks opposed to enabling this unconditionally or as part of any other

Re: [PATCH], PowerPC support to enable -mlra and/or -mfloat128

2016-07-12 Thread Bernd Schmidt
On 07/12/2016 12:29 PM, Richard Biener wrote: Instead of adding more configury can we please enable LRA on trunk by default _now_? Otherwise the amount of testing it recieves won't really increase. I hope you mean for ppc only, otherwise you're breaking a lot of ports... Bernd

Re: [PATCH][expr.c] PR middle-end/71700: zero-extend sub-word value when widening constructor element

2016-07-11 Thread Bernd Schmidt
On 07/11/2016 04:52 PM, Kyrill Tkachov wrote: Based on that, I think that code block is a useful optimisation, we just need to take care with immediates. What do you think? Yeah, I think the patch is ok. Bernd

Re: [PATCH] Fix PR rtl-optimization/71634

2016-07-08 Thread Bernd Schmidt
On 07/08/2016 01:52 PM, Bernd Schmidt wrote: int maxidx = MIN (IRA_MAX_LOOPS_NUM, n); for (i = 0; i < maxidx; i++) { Gah, that's not right, that'll swap the numbers of kept/removed loops. I think the right answer is simply for (i = 0; i < n - IRA_MAX_LOOPS_NUM; i++) Bernd

Re: [PATCH] Fix PR rtl-optimization/71634

2016-07-08 Thread Bernd Schmidt
On 06/23/2016 12:56 PM, Martin Liška wrote: Following patch changes minimum of ira-max-loops-num to 1. Having the minimum equal to zero does not make much sense. Ready after it finishes reg on x86_64-linux? Hmm, why wouldn't a number of zero make sense if you want try to have all loops

Re: [PATCH 0/9] separate shrink-wrapping

2016-07-08 Thread Bernd Schmidt
On 06/14/2016 11:24 PM, Segher Boessenkool wrote: On Wed, Jun 08, 2016 at 06:43:23PM +0200, Bernd Schmidt wrote: On 06/08/2016 05:16 PM, Segher Boessenkool wrote: There is no standard naming for this as far as I know. I'll gladly use a better name anyone comes up with. Maybe just subpart

Re: [PATCH PR c/71699] Handle pointer arithmetic in nonzero tree checks

2016-07-06 Thread Bernd Schmidt
On 07/05/2016 12:41 PM, Richard Biener wrote: On Fri, Jul 1, 2016 at 3:10 PM, Manish Goregaokar wrote: Added a test: Ok if this passed bootstrap/regtest. + return flag_delete_null_pointer_checks +&& (tree_expr_nonzero_warnv_p (op0, strict_overflow_p) +

Re: [PATCH v2] Allocate constant size dynamic stack space in the prologue

2016-07-06 Thread Bernd Schmidt
There's one thing I don't quite understand and which seems to have changed since v1: On 07/04/2016 02:19 PM, Dominik Vogt wrote: @@ -1099,8 +1101,10 @@ expand_stack_vars (bool (*pred) (size_t), struct stack_vars_data *data) /* If there were any, allocate space. */ if

Re: [PATCH][RTL ifcvt] PR rtl-optimization/71594: ICE in noce_emit_cmove due to mismatched source modes

2016-07-05 Thread Bernd Schmidt
On 07/05/2016 03:50 PM, Kyrill Tkachov wrote: Ok, here's the updated patch with the assert replaced by failing the conversion. Bootstrapped and tested on x86_64. Also tested on aarch64. Is this ok? Sure. Thanks! Bernd

Re: [PATCH] - improve sprintf buffer overflow detection (middle-end/49905)

2016-07-04 Thread Bernd Schmidt
On 07/04/2016 06:44 PM, Jakub Jelinek wrote: On Mon, Jul 04, 2016 at 10:23:06AM -0600, Martin Sebor wrote: No, it doesn't. What I meant is that the same code, when added in builtins.c instead, could readily be extended to fold into strings expressions like sprintf (buf, "%i", 123); I've

Re: [PATCH][expr.c] PR middle-end/71700: zero-extend sub-word value when widening constructor element

2016-07-04 Thread Bernd Schmidt
On 07/01/2016 11:18 AM, Kyrill Tkachov wrote: In this arm wrong-code PR the struct assignment goes wrong when expanding constructor elements to a register destination when the constructor elements are signed bitfields less than a word wide. In this testcase we're intialising a struct with a

Re: [lra] Cleanup the use of offmemok and don't count spilling cost for it

2016-07-04 Thread Bernd Schmidt
On 07/04/2016 04:05 PM, Jiong Wang wrote: And the corresponding s390 patten is "mov" for V_128. (define_insn "mov" [(set (match_operand:V_128 0 "" "=v,v,R, v, v, v, v, v,v,d") (match_operand:V_128 1 "" "v,R,v,j00,jm1,jyy,jxx,jKK,d,v"))] As the offset "-16" does not qualify

Re: [lra] Cleanup the use of offmemok and don't count spilling cost for it

2016-07-04 Thread Bernd Schmidt
On 06/30/2016 07:24 PM, Jiong Wang wrote: From my understanding, "offmemok" is used to represent a memory operand who's address we want to reload, and searching of it's reference location seems confirmed my understanding as it's always used together with MEM_P check. So this patch does the

Re: Fix fir PR71696 in Libiberty Demangler (6)

2016-07-04 Thread Bernd Schmidt
On 06/30/2016 08:46 AM, Marcel Böhme wrote: The attached patch fixes the stack overflow in the demangler due to cycles in the references of “remembered” mangled types (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71696). The methods demangle_signature and do_arg in cplus-dem.c allow to

Re: [PATCH][RTL ifcvt] PR rtl-optimization/71594: ICE in noce_emit_cmove due to mismatched source modes

2016-07-04 Thread Bernd Schmidt
On 07/04/2016 01:18 PM, Kyrill Tkachov wrote: That does seem like it could cause trouble but I couldn't think of how that sequence could appear or what its semantics would be. Would assigning to the SImode reg 0 in your example not touch the upper bits of the DImode value? No, multi-word

Re: [PATCH][RTL ifcvt] PR rtl-optimization/71594: ICE in noce_emit_cmove due to mismatched source modes

2016-07-04 Thread Bernd Schmidt
On 07/04/2016 12:28 PM, Kyrill Tkachov wrote: Ping. https://gcc.gnu.org/ml/gcc-patches/2016-06/msg01731.html Thanks, Kyrill On 24/06/16 09:32, Kyrill Tkachov wrote: Hi all, In this PR we get an ICE when trying to emit a conditional move through noce_convert_multiple_sets. The comment in

Re: [PATCH 2/4] PR c++/62314: add fixit hint for "expected ';' after class definition"

2016-07-04 Thread Bernd Schmidt
On 07/01/2016 07:40 PM, David Malcolm wrote: A better argument is that as of r237712 we now have -fdiagnostics -parseable-fixits. This allows for an IDE to offer to automatically apply a fix-it hint. Hence by providing a fix-it here, an IDE can potentially insert the semicolon itself: In

Re: [PATCH] fix interaction of -S and -x {c,c++}-header

2016-07-01 Thread Bernd Schmidt
On 07/01/2016 10:22 AM, Jan Beulich wrote: Irrespective of the use of -o this so far resulted in "error: output filename specified twice", since cc1_options already produces a -o option when -S was specified. gcc/ 2016-07-01 Jan Beulich * varasm.c

Re: [PATCH v2] check initializer to be zero in .bss-like sections

2016-07-01 Thread Bernd Schmidt
On 07/01/2016 03:57 PM, Jan Beulich wrote: Do I need to re-submit, or can I take the above as approved-with- that-change? Ok with that change. Bernd

Re: [PATCH v2] check initializer to be zero in .bss-like sections

2016-07-01 Thread Bernd Schmidt
On 07/01/2016 03:42 PM, Jan Beulich wrote: On 01.07.16 at 15:36, wrote: Looks ok, except why the empty dg-options string in the testcase? Because I've seen in it that way in various other test cases (and yes, yet others don't have it). I had to decide for one of the

Re: [PATCH v2] check initializer to be zero in .bss-like sections

2016-07-01 Thread Bernd Schmidt
On 07/01/2016 10:21 AM, Jan Beulich wrote: Just like gas, which has recently learned to reject such initializers, gcc shouldn't accept such either. --- v2: Use dg-require-named-sections. gcc/ 2016-07-01 Jan Beulich * varasm.c (get_variable_section): Validate

Re: [PATCH 0/6] remove some usage of rtx_{insn,expr}_list

2016-07-01 Thread Bernd Schmidt
On 06/21/2016 04:47 PM, Trevor Saunders wrote: On Mon, Jun 20, 2016 at 06:52:35PM +0200, Bernd Schmidt wrote: So that's a second more in real time - was the machine very busy at the time you ran these tests so that these aren't meaningful, or is there a need to investigate this? Well

Re: Problem in cxx_fundamental_alignment_p?

2016-07-01 Thread Bernd Schmidt
On 07/01/2016 10:34 AM, Dodji Seketeli wrote: The patch below was bootstrapped and tested on x86_64-linux, without issues, The patch looks good to me, thanks. Alright. I think we need a C frontend maintainer or maybe Jason to approve it. Attaching again. but I'm not convinced this code

Re: [PATCH] rtl-optimization/71709, strcpy arg optimised out

2016-07-01 Thread Bernd Schmidt
On 07/01/2016 09:19 AM, Alan Modra wrote: PR rtl-optimization/71709 * ira-lives.c (find_call_crossed_cheap_reg): Exit loop on arg reg being set, not referenced. Looks OK. Bernd

Re: [RFC: Patch 1/6 v2] New target hook: max_noce_ifcvt_seq_cost

2016-06-30 Thread Bernd Schmidt
On 06/21/2016 05:50 PM, James Greenhalgh wrote: For the default implementation, if the parameters are not set, I just multiply BRANCH_COST through by COSTS_N_INSNS (1) for size and COSTS_N_INSNS (3) for speed. I know this is not ideal, but I'm still short of ideas on how best to form the default

Re: [PATCH 0/9] remove some manual memory management

2016-06-30 Thread Bernd Schmidt
On 06/29/2016 02:26 PM, tbsaunde+...@tbsaunde.org wrote: patches individually bootstrapped and regtested on x86_64-linux-gnu, ok? I think these all look sensible. ChangeLogs ought to have slightly more information than "Adjust" in some cases, especially when you're changing function

Re: [PATCH 0/9] separate shrink-wrapping

2016-06-29 Thread Bernd Schmidt
On 06/08/2016 07:26 PM, Segher Boessenkool wrote: One thing I should try is put a USE of the saved registers at such exits, maybe that helps those passes that now delete frame restores to not do that. Have you had a chance to try this? Bernd

Problem in cxx_fundamental_alignment_p?

2016-06-29 Thread Bernd Schmidt
I came across what I think is a bug in cxx_fundamental_alignment_p. User alignments are specified in units of bytes. This is documented, and we can also see the following in handle_aligned_attribute, for the case when we have no args: align_expr = size_int (ATTRIBUTE_ALIGNED_VALUE /

Re: i386/prologues: ROP mitigation for normal function epilogues

2016-06-21 Thread Bernd Schmidt
On 06/20/2016 02:08 PM, Michael Matz wrote: P.S: Though I do feel these ROP counter measures are not much more than security by obscurity; I guess enough obscurity indeed can at least lead to harder to exploit programs. I think security by obscurity is the wrong term for this. But I kind of

Re: [PATCH 0/6] remove some usage of rtx_{insn,expr}_list

2016-06-20 Thread Bernd Schmidt
On 06/20/2016 12:22 PM, tbsaunde+...@tbsaunde.org wrote: In theory I would expect if anything this helps performance since it isn't necessary to malloc every time a node is added, however the data is less clear. Well, we have alloc pools for these lists, so a malloc is not needed for every

Re: [PATCH 2/2][v3] Drop excess size used for run time allocated stack variables.

2016-06-20 Thread Bernd Schmidt
On 06/20/2016 02:19 PM, Dominik Vogt wrote: +/* PR/50938: Check that alloca () reserves the correct amount of stack space. + */ Same here really, even if it's only a test. In this case, the line gets too long with " */" appended. In that case we wrap before the last word. Bernd

Re: i386/prologues: ROP mitigation for normal function epilogues

2016-06-17 Thread Bernd Schmidt
On 06/17/2016 04:29 PM, Michael Matz wrote: On Fri, 17 Jun 2016, Bernd Schmidt wrote: On 06/17/2016 04:03 PM, Michael Matz wrote: But does this really improve something? Essentially you're replacing 0xc9 0xc3 (the end of a function containing "leave;ret") with 0xe9 wher

Re: i386/prologues: ROP mitigation for normal function epilogues

2016-06-17 Thread Bernd Schmidt
On 06/17/2016 04:03 PM, Michael Matz wrote: But does this really improve something? Essentially you're replacing 0xc9 0xc3 (the end of a function containing "leave;ret") with 0xe9 where the four random bytes are different for each rewritten function return (but correlated as they

Re: i386/prologues: ROP mitigation for normal function epilogues

2016-06-17 Thread Bernd Schmidt
On 06/17/2016 12:37 PM, Jakub Jelinek wrote: Do you really need to require frame pointer for this? I mean, couldn't you instead use what you do if a function needs frame pointer and otherwise just replace the original ret with pushq %rbp movq%rsp, %rbp jmp

i386/prologues: ROP mitigation for normal function epilogues

2016-06-17 Thread Bernd Schmidt
This is another step to flesh out -mmitigate-rop for i386 a little more. The basic idea was (I think) Richard Henderson's: if we could arrange to have every return preceded by a leave instruction, it would make it harder to construct an attack since it takes away a certain amount of control

Re: [PATCH] PR71275 ira.c bb_loop_depth

2016-06-15 Thread Bernd Schmidt
On 06/15/2016 04:03 PM, Alan Modra wrote: On Wed, Jun 15, 2016 at 11:49:50AM +0200, Bernd Schmidt wrote: On 06/15/2016 03:30 AM, Alan Modra wrote: Between these two calls to _gfortran_string_verify, if (verify(c4, "A", back = .true.) .ne. 3) call abort if (verify(c4, "AB

Re: [PATCH] PR71275 ira.c bb_loop_depth

2016-06-15 Thread Bernd Schmidt
On 06/15/2016 03:30 AM, Alan Modra wrote: Between these two calls to _gfortran_string_verify, if (verify(c4, "A", back = .true.) .ne. 3) call abort if (verify(c4, "AB") .ne. 0) call abort it seems that gfortran is assuming that parameters passed on the stack are unchanged. How? Is this

Re: [PATCH] Add selftest for pretty-print.c (v2)

2016-06-09 Thread Bernd Schmidt
On 06/09/2016 02:21 PM, David Edelsohn wrote: This is a completely unacceptable way to introduce these self-tests. Please stop adding self-tests that only are tested on x86 Linux and cause bootstrap failures. We have no requirement to test patches on more than one target. I think your

Re: [PATCH] Drop excess size used for run time allocated stack variables.

2016-06-09 Thread Bernd Schmidt
On 05/20/2016 01:11 AM, Jeff Law wrote: Let's start with clean up of dead code: /* We will need to ensure that the address we return is aligned to REQUIRED_ALIGN. If STACK_DYNAMIC_OFFSET is defined, we don't always know its final value at this point in the compilation (it might

Re: [PATCH 0/9] separate shrink-wrapping

2016-06-08 Thread Bernd Schmidt
On 06/08/2016 05:16 PM, Segher Boessenkool wrote: On the plus side I should have caught most of it now. And the failures are rarely silent, they show up during compilation already. That does count as a plus. Aborts in dwarf2cfi, I assume. Most of the problems are code changes the later

Re: [PATCH 0/9] separate shrink-wrapping

2016-06-08 Thread Bernd Schmidt
On 06/08/2016 03:47 AM, Segher Boessenkool wrote: This patch series introduces separate shrink-wrapping. [...] The next six patches are to prevent later passes from mishandling the epilogue instructions that now appear before the epilogue: mostly, you cannot do much to instructions with a

Re: Introduce param for copy loop headers pass

2016-06-08 Thread Bernd Schmidt
On 06/08/2016 11:31 AM, Jan Hubicka wrote: I think 20 insns to copy for loop header is way too much. The constant came from jump.c that was operating with quite different IL and compiler. This patch adds --param for it so we can fine tune it for new millenia. +@item max-loop-headers-insns

Re: [PATCH 2/2][v3] Drop excess size used for run time allocated stack variables.

2016-06-08 Thread Bernd Schmidt
On 05/25/2016 03:32 PM, Dominik Vogt wrote: * explow.c (round_push): Use know adjustment. (allocate_dynamic_stack_space): Pass known adjustment to round_push. gcc/testsuite/ChangeLog I was thinking about whether it would be possible/desirable to eliminate the double add

Re: [PATCH 1/2][v3] Drop excess size used for run time allocated stack variables.

2016-06-08 Thread Bernd Schmidt
On 05/25/2016 03:30 PM, Dominik Vogt wrote: * explow.c (allocate_dynamic_stack_space): Simplify knowing that MUST_ALIGN was always true and extra_align ist always BITS_PER_UNIT. I tried to do some archaeology to find out how the code came to look the way it currently does. A

Re: [PATCH] Add selftest for pretty-print.c (v2)

2016-06-08 Thread Bernd Schmidt
On 06/08/2016 02:56 AM, David Malcolm wrote: Good idea. In the following I did it by adding 0x12345678 as a successor argument to each test. I chose that bit pattern on the grounds that each nybble is unique and non-zero. I printed them with %x to make it easier (I hope) to track down

Re: [PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped

2016-06-08 Thread Bernd Schmidt
On 06/08/2016 03:47 AM, Segher Boessenkool wrote: + /* regrename creates wrong code for exception handling, if used together + with separate shrink-wrapping. Disable for now, until we have +figured out what exactly is going on. */ That needs to be figured out now or

Ignore debug insns in memcmp optimization

2016-06-07 Thread Bernd Schmidt
This fixes a few PRs from the last few days. Fully tested on x86_64-linux. Ok? Bernd PR debug/71432 PR ada/71413 * tree-ssa-strlen.c (handle_builtin_memcmp): Ignore debug insns. PR debug/71432 PR ada/71413 * g++.dg/debug/pr71432.C: New test. Index: gcc/testsuite/g++.dg/debug/pr71432.C

Re: [PATCH] spellcheck.c: add test_find_closest_string

2016-06-07 Thread Bernd Schmidt
On 06/06/2016 11:03 PM, David Malcolm wrote: This adds another test case to -fself-test. Ok. Bernd

Re: [PATCH] Add selftest for pretty-print.c

2016-06-07 Thread Bernd Schmidt
On 06/06/2016 11:28 PM, David Malcolm wrote: + assert_pp_format ("0xcafebabe", "%wx", (HOST_WIDE_INT)0xcafebabe); More interesting tests would be to have multiple arguments to test that we really used the right size for the varargs. Maybe append a single %d arg with a unique bit pattern to

Re: [PATCH][RTL ifcvt] Print name of noce trasform that succeeded in dump file

2016-06-06 Thread Bernd Schmidt
On 06/06/2016 06:28 PM, Kyrill Tkachov wrote: This patch adds the name of the transform that succeeded in if-conversion and prints it to the dump file so that we can pinpoint the extact noce_try* function that triggered. Ok. Bernd

Re: [PATCH] Selftest framework (v7)

2016-06-06 Thread Bernd Schmidt
On 06/06/2016 04:17 PM, David Malcolm wrote: I'm testing a revised patch now, incorporating the above, and renaming s-selftests (plural) to s-selftest (singular) etc within gcc/Makefile.in as requested by Bernhard elsewhere in this thread. I assume that change is OK? Sure. Bernd

Re: [PATCH][3/3][RTL ifcvt] PR middle-end/37780: Conditional expression with __builtin_clz() should be optimized out

2016-06-06 Thread Bernd Schmidt
On 05/26/2016 11:53 AM, Kyrill Tkachov wrote: 2016-05-26 Kyrylo Tkachov PR middle-end/37780 * ifcvt.c (noce_try_ifelse_collapse): New function. Declare prototype. (noce_process_if_block): Call noce_try_ifelse_collapse. * simplify-rtx.c

Re: [middle-end][PATCH] Update alignment_for_piecewise_move

2016-06-06 Thread Bernd Schmidt
On 06/02/2016 03:37 PM, H.J. Lu wrote: Are you planning to submit your patch before July? If not, I will resubmit mine and work out all the issues. It may take a long time to review and I have patches to enable SSE, AVX, AVX512 f memset and memcpy, which depend on it. I'd like to see them

Re: Remove word_mode hack for split bitfields

2016-06-06 Thread Bernd Schmidt
On 05/26/2016 04:36 PM, Richard Sandiford wrote: This patch is effectively reverting a change from 1994. The reason I think it's a hack is that store_bit_field_1 is creating a subreg reference to one word of a field even though it has already proven that the field spills into the following

Re: [PING^2] Re: Updated autofdo bootstrap and testing patches

2016-06-06 Thread Bernd Schmidt
On 05/30/2016 12:17 AM, Andi Kleen wrote: Andi Kleen writes: Ping^2! I think patches #1 and #5 had unaddressed comments from Jan. I think you should ping build system maintainers directly for #4. Bernd

Re: [PING] [PATCH] Make basic asm implicitly clobber memory

2016-06-06 Thread Bernd Schmidt
On 06/05/2016 06:02 PM, Bernd Edlinger wrote: I think we all agreed on the general direction of this patch. The patch is basically unchanged from previous version, except one line in doc/extend.texi has been updated. So I would like to ask if it is OK for trunk. Are there any users of

Re: [PATCH] Selftest framework (v7)

2016-06-05 Thread Bernd Schmidt
On 06/03/2016 09:12 PM, David Malcolm wrote: It's not clear to me if these approvals still hold. I was willing to go with it; I had a look through some of these patches and didn't spot anything untoward. To make it clear, this patch is OK, with one tweak if possible: extend the namespace

Re: [PATCH] Warn about return with a void expression with -Wreturn-type.

2016-06-03 Thread Bernd Schmidt
On 06/02/2016 12:03 PM, Marcin Baczyński wrote: 2016-06-02 4:51 GMT+02:00 Martin Sebor : As a disclaimer, someone else endowed with those special powers will need to approve your final patch. If you don't get a timely approval please ping the patch weekly. *

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