Re: PR78634: ifcvt/i386 cost updates

2016-12-09 Thread Bernd Schmidt
On 12/03/2016 10:49 AM, Uros Bizjak wrote: Based on the above explanation, the patch is OK. I'll be treating the ifcvt part of it as obvious. However, testing showed an issue with the i386 funcspec-11 test: /* PR target/36936 */ /* { dg-do compile } */ /* { dg-require-effective-target ia32

Re: [PATCH 5/9] Introduce selftest::locate_file (v4)

2016-12-08 Thread Bernd Schmidt
On 12/08/2016 10:47 PM, David Malcolm wrote: Is (A) OK, or would you prefer (B)? (I prefer (A) fwiw) Oh well, just keep it as it is. Bernd

Re: [PATCH] Prevent use of MEM_* attr accessor macros as lvalues

2016-12-08 Thread Bernd Schmidt
On 12/09/2016 03:02 AM, David Malcolm wrote: The following patch leads to errors like this for that kind of mistake: error: assignment of member 'mem_attrs::offset' in read-only object MEM_OFFSET (x) = atoi (name.string); ^ Successfully

Re: [PATCH] Fix bug in MEM parsing in patches 8a/8b

2016-12-08 Thread Bernd Schmidt
On 12/08/2016 09:39 PM, David Malcolm wrote: OK as adjustments to patches 8a and 8b? Ok. Is it possible to adjust these macros to return something like a const reference to ensure people can't make this kind of error? Bernd

Re: [PATCH] Avoid double unread_char (c) in patch 8a of RTL frontend

2016-12-08 Thread Bernd Schmidt
On 12/08/2016 04:01 AM, David Malcolm wrote: gcc/ChangeLog: * read-md.c (md_reader::read_name_1): Write out the location of the start of the name, rather than the end, eliminating unread_char and read_char calls. For avoidance of doubt, ok to check in the currently

cprop fix for PR78626

2016-12-08 Thread Bernd Schmidt
This is another case where an optimization turns a trap_if unconditional. We have to defer changing the CFG, since the rest of cprop seems to blow up when we modify things while scanning. Bootstrapped and tested on x86_64-linux, and reportedly fixes the problem on ppc, ok? Bernd PR

Re: [Patch PR78561 PowerPC] Revert to old behaviour for counting constant pools

2016-12-07 Thread Bernd Schmidt
On 12/07/2016 12:56 PM, Segher Boessenkool wrote: On Wed, Dec 07, 2016 at 10:31:14AM +, James Greenhalgh wrote: We always keep the entries in the constant pool after we first see them, and we figure out what gets used in the constant pool by sweeping through looking for referenced entries.

Re: config/ sync with binutils vs. removing gcc targets.

2016-12-07 Thread Bernd Schmidt
On 12/06/2016 11:40 PM, Alan Modra wrote: I understand that config/ in the gcc repository is the master source for binutils-gdb config/. If that's the case then people removing gcc support for particular targets need to be careful about their config/ edits. If a target is still supported in

Re: Fix PR77309, combine eliminates sign bit comparison

2016-12-07 Thread Bernd Schmidt
On 10/28/2016 03:43 PM, Segher Boessenkool wrote: On Fri, Oct 28, 2016 at 01:18:19PM +0200, Bernd Schmidt wrote: In this PR, we manage to simplify the code down to (lt (and (reg) (signbit)) (const 0)) simplify_comparison then calls make_compound_operation on the AND expression, and that turns

IRA combine_and_move_insns fix, PR78669

2016-12-06 Thread Bernd Schmidt
In this PR, we have two registers with "replace" set for them. When processing the first, we delete its setter, which happens to be the only use of the other register. In the second iteration we then assert that the other register has a use, which would be reasonable if we hadn't deleted it.

Re: [PATCH] Even more minimal reimplementation of errors.c within read-md.c

2016-12-06 Thread Bernd Schmidt
On 12/03/2016 12:07 AM, David Malcolm wrote: seen_error is already implemented in the "real" diagnostic subsystem, and would be a clash: we want a way to determine if read-md.c's implementation of error_at was called. Hence it seems simplest to conditionally add a copy of the "have_error"

Re: [PATCH] Add ASSERT_RTX_PTR_EQ

2016-12-06 Thread Bernd Schmidt
On 12/02/2016 09:24 PM, David Malcolm wrote: gcc/ChangeLog: * selftest-rtl.c (selftest::assert_rtx_ptr_eq_at): New function. * selftest-rtl.h (ASSERT_RTX_PTR_EQ): New macro. Ok. Bernd

Re: Fold strstr (s, t) eq/ne s to strcmp (s, t) eq/ne 0 if strlen (t) is known

2016-12-05 Thread Bernd Schmidt
On 12/05/2016 07:02 PM, Prathamesh Kulkarni wrote: This patch folds strstr (s, t) eq/ne s to strcmp (s, t) eq/ne 0 if strlen (t) is known. That's not the same thing, is it? s = "hello world", t = "hello": strstr (s, t) == s, but not strcmp (s, t) == 0. I think you'd want memcmp (s, t,

Re: [PATCH 8a/9] Introduce class function_reader (v7)

2016-12-02 Thread Bernd Schmidt
On 12/02/2016 07:44 PM, David Malcolm wrote: The two flag assignments don't seem to be needed; I think this is due to adding: if (node->native_rtl_p ()) node->force_output = 1; to cgraph_node::finalize_function in patch 9. Should I lose them (and the comment)? Let's keep this patch

PR78634: ifcvt/i386 cost updates

2016-12-02 Thread Bernd Schmidt
With the i386 backend no longer double-counting the cost of a SET, the default implementation default_max_noce_ifcvt_seq_cost now provides too high a bound for if conversion, allowing very costly substitutions. The following patch fixes this by making an i386 variant of the hook, but first -

Re: [PATCH 1/9] print_rtx: implement support for reuse IDs (v2)

2016-12-02 Thread Bernd Schmidt
On 12/02/2016 02:37 AM, David Malcolm wrote: Here's the current status of the kit: "[PATCH 1/9] print_rtx: implement support for reuse IDs (v2)" https://gcc.gnu.org/ml/gcc-patches/2016-11/msg01188.html Still needs review Whoops, I thought this was settled. Ok for the new version. Bernd

Re: [PATCH 8/9] Introduce class function_reader (v4)

2016-12-02 Thread Bernd Schmidt
On 12/01/2016 10:43 PM, David Malcolm wrote: + rtx_insn *jump_insn = get_insn_by_uid (1); + ASSERT_EQ (JUMP_INSN, GET_CODE (jump_insn)); + ASSERT_EQ (ret_rtx, JUMP_LABEL (jump_insn)); + // FIXME: ^^^ use ASSERT_RTX_PTR_EQ here ^^^ Why is this a fixme and not just done that way (several

Re: [PATCH 8b/9] Add target-independent selftests of RTL function reader

2016-12-02 Thread Bernd Schmidt
Conceptually, the concept of "target-independent RTL" seems weird to me. But I guess you expect these to work because the backend never gets involved trying to recognize insns or addressing modes? I think a comment to that effect somewhere near the C code to load these tests would be good. I

Re: [PATCH] Unset used bit in simplify_replace_* on newly copied rtxs (PR target/78614)

2016-12-02 Thread Bernd Schmidt
On 12/02/2016 03:12 PM, Jakub Jelinek wrote: --- gcc/rtl.c.jj2016-10-31 13:28:12.0 +0100 +++ gcc/rtl.c 2016-12-02 11:01:12.557553040 +0100 @@ -318,10 +318,6 @@ copy_rtx (rtx orig) us to explicitly document why we are *not* copying a flag. */ copy = shallow_copy_rtx

Re: [PATCH 8a/9] Introduce class function_reader (v6)

2016-12-02 Thread Bernd Schmidt
On 12/02/2016 03:00 AM, David Malcolm wrote: Changed in v6: - split out dump-reading selftests into followup patches (target-independent, and target-specific) - removes unneeded headers from read-rtl-function.c - numerous other cleanups identified in review Ok, starting to look very close to

Re: [PATCH] fix -fmax-errors & notes, take 2

2016-12-02 Thread Bernd Schmidt
On 12/02/2016 02:25 PM, Nathan Sidwell wrote: +/* Check if we've met the maximum error limit. */ Arguments should be documented. +void +diagnostic_check_max_errors (diagnostic_context *context, bool flush) +{ + if (!context->max_errors) +return; I prefer to spell that as != 0 since

Re: [PATCH] Unset used bit in simplify_replace_* on newly copied rtxs (PR target/78614)

2016-12-01 Thread Bernd Schmidt
On 12/01/2016 11:43 PM, Jakub Jelinek wrote: so we'd need to slow shallow_copy_rtx down by adding switch (code) in there or something similar. Is there reason to assume it's time-critical? IMO eliminating the potential for error by not having callers need to do this outweighs that concern.

Re: [PATCH 8/9] Introduce class function_reader (v4)

2016-12-01 Thread Bernd Schmidt
On 11/11/2016 10:15 PM, David Malcolm wrote: #include "gt-aarch64.h" diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 6c608e0..0dda786 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c I think we should separate out the target specific tests so as to give

Re: [PATCH 5/9] Introduce selftest::locate_file (v4)

2016-12-01 Thread Bernd Schmidt
On 11/11/2016 10:15 PM, David Malcolm wrote: + /* Makefile.in has -fself-test=$(srcdir)/testsuite/selftests, so that + flag_self_test contains the path to the selftest subdirectory of the + source tree (without a trailing slash). Copy it up to + path_to_selftest_files, to avoid

Re: [PATCH] Minimal reimplementation of errors.c within read-md.c

2016-12-01 Thread Bernd Schmidt
On 11/30/2016 09:24 PM, David Malcolm wrote: gcc/ChangeLog: * read-md.c (have_error): New global, copied from errors.c. (fatal): New function, copied from errors.c. I would have expected the function to go into diagnostic.c, but actually there are already various functions of

Re: [PATCH] Do not simplify "(and (reg) (const bit))" to if_then_else.

2016-12-01 Thread Bernd Schmidt
On 11/21/2016 01:36 PM, Dominik Vogt wrote: diff --git a/gcc/combine.c b/gcc/combine.c index b22a274..457fe8a 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -5575,10 +5575,23 @@ combine_simplify_rtx (rtx x, machine_mode op0_mode, int in_dest, { rtx cop1 = const0_rtx;

Re: [PING] (v2) Add a "compact" mode to print_rtx_function

2016-12-01 Thread Bernd Schmidt
On 12/01/2016 11:12 AM, Dominik Vogt wrote: diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c index 77e6b05..5370602 100644 --- a/gcc/print-rtl.c +++ b/gcc/print-rtl.c @@ -371,7 +371,10 @@ rtx_writer::print_rtx_operand_code_i (const_rtx in_rtx, int idx) if (INSN_HAS_LOCATION (in_insn))

Re: [PATCH] Unset used bit in simplify_replace_* on newly copied rtxs (PR target/78614)

2016-12-01 Thread Bernd Schmidt
On 11/30/2016 11:11 PM, Jakub Jelinek wrote: I run into the problem that while simplify_replace_rtx if it actually does copy_rtx (for y) or if it simplifies something through simplify_gen_{unary,binary,relational,ternary}, the used bits on the newly created rtxes are cleared, when we fall

Re: [PATCH 7/9] Add RTL-error-handling to host

2016-11-30 Thread Bernd Schmidt
On 11/29/2016 10:13 PM, Bernd Schmidt wrote: On 11/29/2016 07:53 PM, David Malcolm wrote: Would you prefer that I went with approach (B), or is approach (A) acceptable? Well, I was hoping there'd be an approach (C) where the read-rtl code uses whatever diagnostics framework that is available

Re: [PATCH] Fix ira.c RTL sharing bug

2016-11-30 Thread Bernd Schmidt
On 11/30/2016 01:02 PM, Jakub Jelinek wrote: I've discovered today that RTL sharing verification has been disabled for the last 3.5 years. My --enable-checking=yes,rtl,extra bootstraps on x86_64-linux and i686-linux revealed only two bugs. Ok for both patches. Bernd

Re: [PATCH 7/9] Add RTL-error-handling to host

2016-11-29 Thread Bernd Schmidt
On 11/29/2016 07:53 PM, David Malcolm wrote: Would you prefer that I went with approach (B), or is approach (A) acceptable? Well, I was hoping there'd be an approach (C) where the read-rtl code uses whatever diagnostics framework that is available. Maybe it'll turn out that's too hard.

Re: [PATCH 7/9] Add RTL-error-handling to host

2016-11-29 Thread Bernd Schmidt
On 11/29/2016 06:20 PM, David Malcolm wrote: if that distinction makes sense. Clearly we already have a diagnostics subsystem on the host; what this patch is adding is the separate, rtl-s pecific diagnostic subsystem to cc1 on the host. So that still seems odd to me. Why not use the normal

Re: [0/3] Fix PR78120, in ifcvt/rtlanal/i386.

2016-11-28 Thread Bernd Schmidt
On 11/28/2016 07:50 PM, Jeff Law wrote: So how would you suggest this be fixed right now? I'd really like to get the regression addressed. The regression is still fixed. That wasn't the case at all stages while I was working on it, but the i386 patch seems to suffice now. I would claim

Re: [PATCH 7/9] Add RTL-error-handling to host

2016-11-28 Thread Bernd Schmidt
Been looking at this off and on, and I'm still not sure I entirely get it - sorry. On 11/11/2016 10:15 PM, David Malcolm wrote: Implementing an RTL frontend by using the RTL reader from read -rtl.c means that we now need a diagnostics subsystem on the *host* for handling errors in RTL files,

Re: [0/3] Fix PR78120, in ifcvt/rtlanal/i386.

2016-11-28 Thread Bernd Schmidt
On 11/25/2016 04:55 PM, Segher Boessenkool wrote: So IMNSHO this rtx costing change belongs in early stage 1, and should be reverted. Done. Bernd

Re: [0/3] Fix PR78120, in ifcvt/rtlanal/i386.

2016-11-28 Thread Bernd Schmidt
On 11/25/2016 04:55 PM, Segher Boessenkool wrote: So IMNSHO this rtx costing change belongs in early stage 1, and should be reverted. Done. Bernd

Re: [0/3] Fix PR78120, in ifcvt/rtlanal/i386.

2016-11-24 Thread Bernd Schmidt
On 11/24/2016 03:53 PM, Segher Boessenkool wrote: Your own 2/3 shows my point: you needed fixes to the i386 port for it to behave sanely after this 1/3; what makes you think other ports are not in the same boat? When I realized i386 was broken I had a look at aarch64 and it looked sane, and

Re: [0/3] Fix PR78120, in ifcvt/rtlanal/i386.

2016-11-24 Thread Bernd Schmidt
On 11/24/2016 03:36 PM, Segher Boessenkool wrote: On Thu, Nov 24, 2016 at 03:26:45PM +0100, Bernd Schmidt wrote: On 11/24/2016 03:21 PM, Segher Boessenkool wrote: Combine uses insn_rtx_cost extensively. I have tried to change it to use the full rtx cost, not just the source cost, a few times

Re: [0/3] Fix PR78120, in ifcvt/rtlanal/i386.

2016-11-24 Thread Bernd Schmidt
On 11/24/2016 03:21 PM, Segher Boessenkool wrote: Combine uses insn_rtx_cost extensively. I have tried to change it to use the full rtx cost, not just the source cost, a few times before, and it always only regressed. Part of it is that most ports' cost calculations are, erm, not so great --

Re: [PATCH 8/9] Introduce class function_reader (v4)

2016-11-23 Thread Bernd Schmidt
On 11/11/2016 10:15 PM, David Malcolm wrote: +static void +aarch64_test_loading_full_dump () +{ + rtl_dump_test t (SELFTEST_LOCATION, locate_file ("aarch64/times-two.rtl")); + + ASSERT_STREQ ("times_two", IDENTIFIER_POINTER (DECL_NAME (cfun->decl))); + + rtx_insn *insn_1 = get_insn_by_uid

Re: [0/3] Fix PR78120, in ifcvt/rtlanal/i386.

2016-11-23 Thread Bernd Schmidt
On 11/23/2016 08:30 PM, Jeff Law wrote: On 11/23/2016 12:00 PM, Bernd Schmidt wrote: Note that I misspelled the PR number in the 0/3 message :-/ On 11/23/2016 07:57 PM, Bernd Schmidt wrote: 1. I noticed comparisons between set_src_cost and set_rtx_cost seemed to be invalid. There seems

[3/3] Fix PR78120, in ifcvt/rtlanal/i386.

2016-11-23 Thread Bernd Schmidt
On 11/23/2016 07:57 PM, Bernd Schmidt wrote: 3. ifcvt computes the sum of costs for the involved blocks, but only makes a before/after comparison when optimizing for size. When optimizing for speed, it uses max_seq_cost, which is an estimate computed from BRANCH_COST, which in turn can be zero

Re: [0/3] Fix PR78120, in ifcvt/rtlanal/i386.

2016-11-23 Thread Bernd Schmidt
On 11/23/2016 07:57 PM, Bernd Schmidt wrote: 2. The i386 backend mishandles SET rtxs. If you have a fairly plain single-insn SET, you tend to get COSTS_N_INSNS (2) out of set_rtx_cost, because rtx_costs has a default of COSTS_N_INSNS (1) for a SET, and you get the cost of the src in addition

Re: [0/3] Fix PR78120, in ifcvt/rtlanal/i386.

2016-11-23 Thread Bernd Schmidt
Note that I misspelled the PR number in the 0/3 message :-/ On 11/23/2016 07:57 PM, Bernd Schmidt wrote: 1. I noticed comparisons between set_src_cost and set_rtx_cost seemed to be invalid. There seems to be no good reason that insn_rtx_cost shouldn't use the latter. It also makes the numbers

[0/3] Fix PR71280, in ifcvt/rtlanal/i386.

2016-11-23 Thread Bernd Schmidt
This is a small series of patches to fix various problems in cost calculations that together caused PR71280, a missed optimization opportunity. A summary of the problems: 1. I noticed comparisons between set_src_cost and set_rtx_cost seemed to be invalid. There seems to be no good reason

Re: [PATCH] Fix PR71762

2016-11-23 Thread Bernd Schmidt
On 11/10/2016 02:28 PM, Richard Biener wrote: Any takers for the RTL implementation? Do you have a testcase you think can be optimized? Bernd

Re: [patch] Fix PR rtl-optimization/78437

2016-11-23 Thread Bernd Schmidt
On 11/23/2016 11:18 AM, Paolo Bonzini wrote: On 23/11/2016 10:35, Eric Botcazou wrote: I now wonder whether this also matters for !WORD_REGISTER_OPERATIONS targets, e.g. x86: (set (reg1:DI) ... ... (set (reg1:QI) (expression:QI)) ... (set

Re: [PR target/78213] Do not ICE on non-empty -fself-test

2016-11-22 Thread Bernd Schmidt
On 11/16/2016 11:45 AM, Aldy Hernandez wrote: I would prefer Jakub's suggestion of running in finish_options(). I suspect we'll want both. Selftests should really run in an environment that's as close as possible to what would normally be going on in the compiler. I assume there are

Re: [PATCH] (v2) Add a "compact" mode to print_rtx_function

2016-11-22 Thread Bernd Schmidt
On 11/22/2016 02:37 PM, Jakub Jelinek wrote: Can't it be done only if xloc.file contains any fancy characters? Sure, but why? Strings generally get emitted with quotes around them, I don't see a good reason for filenames to be different, especially if it makes the output easier to parse.

Re: [PATCH] Introduce emit_status::ensure_regno_capacity (v5)

2016-11-22 Thread Bernd Schmidt
On 11/18/2016 10:19 PM, David Malcolm wrote: - regno_reg_rtx = ggc_vec_alloc (crtl->emit.regno_pointer_align_length); + regno_reg_rtx = +ggc_cleared_vec_alloc (crtl->emit.regno_pointer_align_length); When wrapping lines, put the operator first. Otherwise ok. Bernd

Re: [PATCH] (v2) Add a "compact" mode to print_rtx_function

2016-11-22 Thread Bernd Schmidt
On 11/22/2016 02:18 PM, Dominik Vogt wrote: @@ -284,7 +292,7 @@ print_rtx_operand_code_i (const_rtx in_rtx, int idx) if (INSN_HAS_LOCATION (in_insn)) { expanded_location xloc = insn_location (in_insn); - fprintf (outfile, " %s:%i", xloc.file, xloc.line); +

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

2016-11-17 Thread Bernd Schmidt
On 11/16/2016 08:22 PM, Aaron Sawdey wrote: I've also changed the pattern to indicate that operand 3 may be clobbered (if it happens to be in cx already). That part looks like a meaningless change since the pattern in that define_expand is never used (there's a DONE at the end). I don't

Re: [PATCH] Fix NetBSD bootstrap

2016-11-16 Thread Bernd Schmidt
On 11/16/2016 06:12 PM, Krister Walfridsson wrote: I'm the NetBSD maintainer, so I belive I don't need approval to commit this. But I have been absent for a long time, so it makes sense for someone to review at least this first patch. Bootstrapped and tested on i386-unknown-netbsdelf6.1 and

Re: Use rtx_mode_t instead of std::make_pair

2016-11-16 Thread Bernd Schmidt
On 11/16/2016 05:52 PM, Richard Sandiford wrote: Using rtx_mode_t also abstracts away the representation. The fact that it's a std::pair rather than a custom class isn't important to users of the interface. Looks borderline obvious to me. OK. Bernd

Re: [PATCH] Enable Intel AVX512_4FMAPS and AVX512_4VNNIW instructions

2016-11-16 Thread Bernd Schmidt
On 11/15/2016 05:31 PM, Andrew Senkevich wrote: 2016-11-15 17:56 GMT+03:00 Jeff Law : On 11/15/2016 05:55 AM, Andrew Senkevich wrote: 2016-11-11 14:16 GMT+03:00 Uros Bizjak : --- a/gcc/genmodes.c +++ b/gcc/genmodes.c --- a/gcc/init-regs.c +++

Re: [PATCH, IRA] PR78325, R_MIPS_JALR failures

2016-11-16 Thread Bernd Schmidt
On 11/15/2016 11:55 PM, Alan Modra wrote: This is a fix for my PR70890 patch, which incorrectly removed all REG_EQUIV notes rather than just one regarding a reg that dies. Bootstrapped and regression tested powerpc64le-linux, x86_64-linux, and mips-linux. OK to apply? PR

Re: [PATCH 3/9] Introduce emit_status::ensure_regno_capacity

2016-11-14 Thread Bernd Schmidt
On 11/11/2016 10:15 PM, David Malcolm wrote: Link to earlier version of the patch: https://gcc.gnu.org/ml/gcc-patches/2016-10/msg00278.html Isn't this the same one? Bernd

Re: [PATCH 00/11] more rtx_insn * stuff

2016-11-14 Thread Bernd Schmidt
On 11/14/2016 09:09 AM, tbsaunde+...@tbsaunde.org wrote: From: Trevor Saunders Hi, Basically $subject which gets rid of a few more casts over all. I ment to get this out a little while back, but life got busy, and I didn't read the status announcement properly, so

Re: [PR target/78213] Do not ICE on non-empty -fself-test

2016-11-14 Thread Bernd Schmidt
On 11/14/2016 02:20 PM, Jakub Jelinek wrote: On Mon, Nov 14, 2016 at 02:18:02PM +0100, Bernd Schmidt wrote: On 11/11/2016 06:10 PM, Aldy Hernandez wrote: The problem in this PR is that -fself-test is being run on a non empty source file. This causes init_emit() to run, which sets

Re: [PR target/78213] Do not ICE on non-empty -fself-test

2016-11-14 Thread Bernd Schmidt
On 11/11/2016 06:10 PM, Aldy Hernandez wrote: The problem in this PR is that -fself-test is being run on a non empty source file. This causes init_emit() to run, which sets: REG_POINTER (virtual_incoming_args_rtx) = 1; Setting REG_POINTER on the virtual incoming args, causes /f to be

Re: [PATCH 0/8] NVPTX offloading to NVPTX: backend patches

2016-11-11 Thread Bernd Schmidt
On 11/11/2016 04:35 PM, Alexander Monakov wrote: For the avoidance of doubt, is this a statement of intent, or an actual approval for the patchset? After these backend modifications and the rest of libgomp/middle-end changes are applied, trunk will need the following flip-the-switch patch to

Re: [PATCH 0/8] NVPTX offloading to NVPTX: backend patches

2016-11-11 Thread Bernd Schmidt
On 10/19/2016 12:39 PM, Bernd Schmidt wrote: I'll refrain from any further comments on the topic. The ptx patches don't look unreasonable iff someone else decides that this version of OpenMP support should be merged and I'll look into them in more detail if that happens. Patch 2/8 is ok now

Re: [PATCH] simplify-rtx: Transform (xor (and (xor A B) C) B) with C const

2016-11-09 Thread Bernd Schmidt
On 11/09/2016 10:58 PM, Segher Boessenkool wrote: I'll do a PowerPC-specific testcase for all rl[wd]* next week. rl[wd]imi will show this xor-xor thing (half of all possible insns were not optimised before this patch). Is that enough? Sure. Once David's rtl testing work is ready we'll want

Re: [PATCH] simplify-rtx: Transform (xor (and (xor A B) C) B) with C const

2016-11-09 Thread Bernd Schmidt
On 11/09/2016 10:13 PM, Segher Boessenkool wrote: * simplify-rtx.c (simplify_binary_operation_1): Simplify (xor (and (xor A B) C) B) to (ior (and A C) (and B ~C)) and (xor (and (xor A B) C) B) to (ior (and A ~C) (and B C)) if C is a const_int. I think one of the

Re: [PATCH] (v2) print-rtl-function.c: add (param) directive to dump

2016-11-09 Thread Bernd Schmidt
On 11/09/2016 05:46 PM, David Malcolm wrote: OK for trunk if it passes bootstrap and regrtest? gcc/ChangeLog: * print-rtl-function.c (print_any_param_name): New function. (print_param): New function. (print_rtx_function): Call print_param for each argument. *

Re: [PATCH] fix PR68468

2016-11-09 Thread Bernd Schmidt
On 11/05/2016 06:14 PM, Waldemar Brodkorb wrote: Hi, the following patch fixes PR68468. Patch is used for a while in Buildroot without issues. 2016-11-05 Waldemar Brodkorb PR gcc/68468 * libgcc/unwind-dw2-fde-dip.c: fix build on FDPIC targets. This is ok.

Re: [PATCH] DECL_RTL and DECL_RTL_INCOMING in RTL dumps

2016-11-09 Thread Bernd Schmidt
On 11/08/2016 07:03 PM, David Malcolm wrote: int __RTL("rtl-combine") f1 (int n) { (function "f1" (param "n" (DECL_RTL (reg/v:SI %1 [ n ]) ) ;; DECL_RTL The ;; DECL_RTL etc. comments seem somewhat redundant and add clutter. Please remove those. Also, why is the closing paren

Re: [PATCH] Do not simplify "(and (reg) (const bit))" to if_then_else.

2016-11-07 Thread Bernd Schmidt
On 10/31/2016 08:56 PM, Dominik Vogt wrote: combine_simplify_rtx() tries to replace rtx expressions with just two possible values with an experession that uses if_then_else: (if_then_else (condition) (value1) (value2)) If the original expression is e.g. (and (reg) (const_int 2)) I'm

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

2016-11-07 Thread Bernd Schmidt
On 11/03/2016 03:00 PM, Eric Botcazou wrote: 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. Testing showed the same issue as Jiong found, so I've committed it

Re: [PATCH] Fix DSE not to consider calls as reads from function's body (PR target/77834)

2016-11-07 Thread Bernd Schmidt
On 11/04/2016 05:35 PM, Jakub Jelinek wrote: 2016-11-04 Jakub Jelinek PR target/77834 * dse.c (dse_step5): Call scan_reads even if just insn_info->frame_read. Improve and fix dump file messages. Sounds reasonable, and I checked and it seems not

Re: New option -flimit-function-alignment

2016-11-07 Thread Bernd Schmidt
On 10/14/2016 08:28 PM, Bernd Schmidt wrote: On 10/12/2016 09:27 PM, Denys Vlasenko wrote: Yes, something like "if max_skip >= func_size, temporarily lower max_skip to func_size-1" (because otherwise we can create padding bigger-or-equal to the entire function in size, which is

Re: [PATCH] rtx_writer: avoid printing trailing default values

2016-11-04 Thread Bernd Schmidt
On 11/04/2016 08:25 PM, David Malcolm wrote: return m_compact; Ok with this one plus a comment. Bernd

Re: [PATCH] rtx_writer: avoid printing trailing default values

2016-11-04 Thread Bernd Schmidt
On 11/04/2016 08:14 PM, David Malcolm wrote: With this, compact dumps omit the trailing (nil) for both regular insns and for JUMP_INSNs, and omits the surplus newline seen in my earlier patch. It also appears removes the trailing (nil) from expr_list. Bootstrap in progress. OK for trunk if

Re: [PATCH] rtx_writer: avoid printing trailing nils

2016-11-04 Thread Bernd Schmidt
Here's something simpler. Only very lightly tested, but isn't something like this all that's needed? Could decide whether to apply it to expr_list etc. as well. Index: print-rtl.c === --- print-rtl.c (revision 241233) +++

Re: [PATCH] rtx_writer: avoid printing trailing nils

2016-11-04 Thread Bernd Schmidt
On 11/04/2016 06:32 PM, David Malcolm wrote: ASSERT_RTL_DUMP_EQ ("(cjump_insn 1 (set (pc)\n" "(label_ref 0))\n" - " (nil))\n", + " )\n", jump_insn); This looks like the patch doesn't go the

Re: [PATCH] Fix DSE not to consider calls as reads from function's body (PR target/77834)

2016-11-04 Thread Bernd Schmidt
On 11/04/2016 01:26 PM, Jakub Jelinek wrote: In any case, the second hunk fixes an important DSE bug that just got revealed by the former change. Can you elaborate on that (what situation does it occur in, is it covered by the testsuite)? Bernd

Re: [PATCH] Start adding target-specific selftests

2016-11-04 Thread Bernd Schmidt
On 10/21/2016 07:45 PM, David Malcolm wrote: gcc/ChangeLog: * config/i386/i386.c: Include "selftest.h" and "selftest-rtl.h". (selftest::ix86_test_dumping_hard_regs): New function. (selftest::ix86_run_selftests): New function. (TARGET_RUN_TARGET_SELFTESTS): When

Re: [PATCH] Fix wrong declarations of builtin functions

2016-11-04 Thread Bernd Schmidt
On 11/03/2016 10:52 PM, Bernd Edlinger wrote: I thought in preparation of the new C++ warning about wrong declarations of builtin functions it would be good to fix some of the more obvious bugs in the testsuite first. Bootstrapped and reg-tested on x86_64-pc-linux-gnu. Ok. Bernd

Re: [PATCH] Fix DSE not to consider calls as reads from function's body (PR target/77834)

2016-11-04 Thread Bernd Schmidt
On 11/04/2016 01:26 PM, Jakub Jelinek wrote: The following patch avoids that. Of course the question is if we want to support something like: char var[64]; ... var[0] = '0xe8'; var[1] = ...; (void (*fn) (void) = (void (*) (void)) [0]; fn (); without any kind of barrier, or not. I was going

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

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: [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] 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: 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

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: 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

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: [RFA] Fix false positive out of bounds array index warning in LRA

2016-11-02 Thread Bernd Schmidt
On 10/29/2016 06:21 PM, Jeff Law wrote: On a small number of ports, we only have 2 defined register classes. NO_REGS and ALL_REGS. Examples would include nvptx and vax. So let's look at check_and_process_move from lra-constraints.c: sclass = dclass = NO_REGS; if (REG_P (dreg)) dclass

Re: RFD: Buffer handling for ASM_GENERATE_INTERNAL_LABEL

2016-11-02 Thread Bernd Schmidt
On 10/29/2016 04:17 PM, Trevor Saunders wrote: So actually a thing I've wanted to do for a while is add a long string building class to generate asm into that would use a set of buffers adding new ones when the space is needed. So that would look something like I'd do something a little

Re: [PATCH 0/3] use rtx_insn * more

2016-11-02 Thread Bernd Schmidt
On 11/02/2016 03:55 PM, David Malcolm wrote: Did you mean this patch: https://gcc.gnu.org/ml/gcc-patches/2016-10/msg01358.html That one is ok after the test, sorry for not being more clear. Bernd

Re: [RFC PATCH] expand_strn_compare should attempt expansion even if neither string is constant

2016-11-02 Thread Bernd Schmidt
On 10/27/2016 03:14 AM, Aaron Sawdey wrote: I'm currently working on a builtin expansion of strncmp for powerpc similar to the one for memcmp I checked recently. One thing I encountered is that the code in expand_strn_compare will not attempt to expand the cmpstrnsi pattern at all if neither

Re: [PATCH] sched: Do not mix prologue and epilogue insns

2016-10-28 Thread Bernd Schmidt
On 10/28/2016 03:37 PM, Segher Boessenkool wrote: This patch makes scheduling not reorder prologue insns relative to epilogue insns and vice versa. This fixes PR78029. This seems good to me. Bernd

Fix PR77309, combine eliminates sign bit comparison

2016-10-28 Thread Bernd Schmidt
In this PR, we manage to simplify the code down to (lt (and (reg) (signbit)) (const 0)) simplify_comparison then calls make_compound_operation on the AND expression, and that turns it into a ZERO_EXTRACT of a single bit, changing the meaning of the comparison. The problem is a special case

Re: [patch] Use straight-line sequence for signed overflow additive operation

2016-10-28 Thread Bernd Schmidt
On 10/27/2016 05:26 PM, Eric Botcazou wrote: as suggested by Segher, this changes the generic signed-signed-signed case of expand_addsub_overflow to using a straight-line code sequence instead of a branchy one, the new sequence being also shorter. * dojump.c

Re: [PATCH, GCC] Fix conflicting posix_memalign declaration error

2016-10-28 Thread Bernd Schmidt
On 10/27/2016 10:47 PM, Caroline Tice wrote: * config/i386/pmm_malloc.h (posix_memalign): Add ifdefs to only decorate the declaration with 'throw()' if __GLIBC__ is defined. I seem to recall a similar patch being submitted by Szabolcs. My suggestion at the time was to move

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

2016-10-27 Thread Bernd Schmidt
On 10/27/2016 05:57 PM, Bernd Edlinger wrote: In the function below we have if ((UWtype)u == u) that actually ensures hi != 0. Ah, right. So maybe we ought to just add the same case here as well? if ((UWtype)u == u) return (FSTYPE)(UWtype)u; That would also make the comment less

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

2016-10-27 Thread Bernd Schmidt
On 10/27/2016 01:27 PM, Bernd Edlinger wrote: Hi, by code reading I became aware that libgcc can call count_leading_zeros in certain cases which can give undefined results. This happens on signed int128 -> float or double conversions, when the int128 is in the range INT64_MAX+1 to UINT64_MAX.

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

2016-10-27 Thread Bernd Schmidt
On 10/27/2016 12:16 PM, 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 the original labels: The result might differ in absolute value

Re: [PATCH] Show INSN_UIDs in compact mode

2016-10-26 Thread Bernd Schmidt
On 10/26/2016 08:50 PM, David Malcolm wrote: The following patch adds back in the INSN_UID for all insns. Successfully bootstrapped on x86_64-pc-linux-gnu. OK for trunk? Yes. Bernd

Re: [PATCH] sched: Do not reorder RTX_FRAME_RELATED_P insns (PR78029)

2016-10-26 Thread Bernd Schmidt
On 10/26/2016 07:27 PM, Segher Boessenkool wrote: On Wed, Oct 26, 2016 at 03:13:06PM +0200, Bernd Schmidt wrote: On 10/26/2016 03:05 PM, Segher Boessenkool wrote: 2) We do not necessarily have all notes yet, if the port lets dwarf2cfi create notes by itself. Most (or even all?) ports do

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