[041/nnn] poly_int: reload.c

2017-10-23 Thread Richard Sandiford
This patch makes a few small poly_int64 changes to reload.c, such as in the "decomposition" structure. In practice, any port with polynomial-sized modes should be using LRA rather than reload, but it's easier to convert reload anyway than to sprinkle to_constants everywhere. 2017-10-23 Richard

[040/nnn] poly_int: get_inner_reference & co.

2017-10-23 Thread Richard Sandiford
This patch makes get_inner_reference and ptr_difference_const return the bit size and bit position as poly_int64s rather than HOST_WIDE_INTS. The non-mechanical changes were handled by previous patches. 2017-10-23 Richard Sandiford Alan Hayward

[039/nnn] poly_int: pass_store_merging::execute

2017-10-23 Thread Richard Sandiford
This patch makes pass_store_merging::execute track polynomial sizes and offsets. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood gcc/ * gimple-ssa-store-merging.c

[038/nnn] poly_int: fold_comparison

2017-10-23 Thread Richard Sandiford
This patch makes fold_comparison track polynomial offsets when folding address comparisons. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood gcc/ * fold-const.c

[037/nnn] poly_int: get_bit_range

2017-10-23 Thread Richard Sandiford
This patch makes get_bit_range return the range and position as poly_ints. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood gcc/ * expr.h (get_bit_range): Return the

[036/nnn] poly_int: get_object_alignment_2

2017-10-23 Thread Richard Sandiford
This patch makes get_object_alignment_2 track polynomial offsets and sizes. The real work is done by get_inner_reference, but we then need to handle the alignment correctly. 2017-10-23 Richard Sandiford Alan Hayward

[035/nnn] poly_int: expand_debug_expr

2017-10-23 Thread Richard Sandiford
This patch makes expand_debug_expr track polynomial memory offsets. It simplifies the handling of the case in which the reference is not to the first byte of the base, which seemed non-trivial enough to make it worth splitting out as a separate patch. 2017-10-23 Richard Sandiford

[034/nnn] poly_int: get_inner_reference_aff

2017-10-23 Thread Richard Sandiford
This patch makes get_inner_reference_aff return the size as a poly_widest_int rather than a widest_int. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood gcc/ *

[032/nnn] poly_int: symbolic_number

2017-10-23 Thread Richard Sandiford
This patch changes symbol_number::bytepos from a HOST_WIDE_INT to a poly_int64. perform_symbolic_merge can cope with symbolic offsets as long as the difference between the two offsets is constant. (This could happen for a constant-sized field that occurs at a variable offset, for example.)

[033/nnn] poly_int: pointer_may_wrap_p

2017-10-23 Thread Richard Sandiford
This patch changes the bitpos argument to pointer_may_wrap_p from HOST_WIDE_INT to poly_int64. A later patch makes the callers track polynomial offsets. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood

[030/nnn] poly_int: get_addr_unit_base_and_extent

2017-10-23 Thread Richard Sandiford
This patch changes the values returned by get_addr_unit_base_and_extent from HOST_WIDE_INT to poly_int64. maxsize in gimple_fold_builtin_memory_op goes from HOST_WIDE_INT to poly_uint64 (rather than poly_int) to match the previous use of tree_fits_uhwi_p. 2017-10-23 Richard Sandiford

[031/nnn] poly_int: aff_tree

2017-10-23 Thread Richard Sandiford
This patch changes the type of aff_tree::offset from widest_int to poly_widest_int and adjusts the function interfaces in the same way. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood

[029/nnn] poly_int: get_ref_base_and_extent

2017-10-23 Thread Richard Sandiford
This patch changes the types of the bit offsets and sizes returned by get_ref_base_and_extent to poly_int64. There are some callers that can't sensibly operate on polynomial offsets or handle cases where the offset and size aren't known exactly. This includes the IPA devirtualisation code (since

[028/nnn] poly_int: ipa_parm_adjustment

2017-10-23 Thread Richard Sandiford
This patch changes the type of ipa_parm_adjustment::offset from HOST_WIDE_INT to poly_int64 and updates uses accordingly. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood gcc/

[027/nnn] poly_int: DWARF CFA offsets

2017-10-23 Thread Richard Sandiford
This patch makes the DWARF code use poly_int64 rather than HOST_WIDE_INT for CFA offsets. The main changes are: - to make reg_save use a DW_CFA_expression representation when the offset isn't constant and - to record the CFA information alongside a def_cfa_expression if either offset is

[026/nnn] poly_int: operand_subword

2017-10-23 Thread Richard Sandiford
This patch makes operand_subword and operand_subword_force take polynomial offsets. This is a fairly old-school interface and these days should only be used when splitting multiword operations into word operations. It still doesn't hurt to support polynomial offsets and it helps make callers

[025/nnn] poly_int: SUBREG_BYTE

2017-10-23 Thread Richard Sandiford
This patch changes SUBREG_BYTE from an int to a poly_int. Since valid SUBREG_BYTEs must be contained within the mode of the SUBREG_REG, the required range is the same as for GET_MODE_SIZE, i.e. unsigned short. The patch therefore uses poly_uint16(_pod) for the SUBREG_BYTE. Using poly_uint16_pod

[024/nnn] poly_int: ira subreg liveness tracking

2017-10-23 Thread Richard Sandiford
Normmaly the IRA-reload interface tries to track the liveness of individual bytes of an allocno if the allocno is sometimes written to as a SUBREG. This isn't possible for variable-sized allocnos, but it doesn't matter because targets with variable-sized registers should use LRA instead. This

[023/nnn] poly_int: store_field & co

2017-10-23 Thread Richard Sandiford
This patch makes store_field and related routines use poly_ints for bit positions and sizes. It keeps the existing choices between signed and unsigned types (there are a mixture of both). 2017-10-23 Richard Sandiford Alan Hayward

[022/nnn] poly_int: C++ bitfield regions

2017-10-23 Thread Richard Sandiford
This patch changes C++ bitregion_start/end values from constants to poly_ints. Although it's unlikely that the size needs to be polynomial in practice, the offset could be with future language extensions. 2017-10-23 Richard Sandiford Alan Hayward

[019/nnn] poly_int: lra frame offsets

2017-10-23 Thread Richard Sandiford
This patch makes LRA use poly_int64s rather than HOST_WIDE_INTs to store a frame offset (including in things like eliminations). 2017-10-23 Richard Sandiford Alan Hayward David Sherwood

[021/nnn] poly_int: extract_bit_field bitrange

2017-10-23 Thread Richard Sandiford
Similar to the previous store_bit_field patch, but for extractions rather than insertions. The patch splits out the extraction-as-subreg handling into a new function (extract_bit_field_as_subreg), both for ease of writing and because a later patch will add another caller. The simplify_gen_subreg

[020/nnn] poly_int: store_bit_field bitrange

2017-10-23 Thread Richard Sandiford
This patch changes the bitnum and bitsize arguments to store_bit_field from unsigned HOST_WIDE_INTs to poly_uint64s. The later part of store_bit_field_1 still needs to operate on constant bit positions and sizes, so the patch splits it out into a subfunction (store_integral_bit_field).

[018/nnn] poly_int: MEM_OFFSET and MEM_SIZE

2017-10-23 Thread Richard Sandiford
This patch changes the MEM_OFFSET and MEM_SIZE memory attributes from HOST_WIDE_INT to poly_int64. Most of it is mechanical, but there is one nonbovious change in widen_memory_access. Previously the main while loop broke with: /* Similarly for the decl. */ else if (DECL_P

[017/nnn] poly_int: rtx_addr_can_trap_p_1

2017-10-23 Thread Richard Sandiford
This patch changes the offset and size arguments of rtx_addr_can_trap_p_1 from HOST_WIDE_INT to poly_int64. It also uses a size of -1 rather than 0 to represent an unknown size and BLKmode rather than VOIDmode to represent an unknown mode. 2017-10-23 Richard Sandiford

[016/nnn] poly_int: dse.c

2017-10-23 Thread Richard Sandiford
This patch makes RTL DSE use poly_int for offsets and sizes. The local phase can optimise them normally but the global phase treats them as wild accesses. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood

[015/nnn] poly_int: ao_ref and vn_reference_op_t

2017-10-23 Thread Richard Sandiford
This patch changes the offset, size and max_size fields of ao_ref from HOST_WIDE_INT to poly_int64 and propagates the change through the code that references it. This includes changing the off field of vn_reference_op_struct in the same way. 2017-10-23 Richard Sandiford

[014/nnn] poly_int: indirect_refs_may_alias_p

2017-10-23 Thread Richard Sandiford
This patch makes indirect_refs_may_alias_p use ranges_may_overlap_p rather than ranges_overlap_p. Unlike the former, the latter can handle negative offsets, so the fix for PR44852 should no longer be necessary. It can also handle offset_int, so avoids unchecked truncations to HOST_WIDE_INT.

[013/nnn] poly_int: same_addr_size_stores_p

2017-10-23 Thread Richard Sandiford
This patch makes tree-ssa-alias.c:same_addr_size_stores_p handle poly_int sizes and offsets. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood gcc/ * tree-ssa-alias.c

[012/nnn] poly_int: fold_ctor_reference

2017-10-23 Thread Richard Sandiford
This patch changes the offset and size arguments to fold_ctor_reference from unsigned HOST_WIDE_INT to poly_uint64. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood gcc/ *

[011/nnn] poly_int: DWARF locations

2017-10-23 Thread Richard Sandiford
This patch adds support for DWARF location expressions that involve polynomial offsets. It adds a target hook that says how the runtime invariants used in the offsets should be represented in DWARF. SVE vectors have to be a multiple of 128 bits in size, so the GCC port uses the number of 128-bit

C PATCH to fix a couple of typos (PR c/82681)

2017-10-23 Thread Marek Polacek
As noted in this PR, chages -> changes. Bootstrapped/regtested on x86_64-linux, applying to trunk. 2017-10-23 Marek Polacek PR c/82681 * c-warn.c (warnings_for_convert_and_check): Fix typos. * gcc.dg/c90-const-expr-11.c: Fix typos in dg-warning.

[010/nnn] poly_int: REG_OFFSET

2017-10-23 Thread Richard Sandiford
This patch changes the type of the reg_attrs offset field from HOST_WIDE_INT to poly_int64 and updates uses accordingly. This includes changing reg_attr_hasher::hash to use inchash. (Doing this has no effect on code generation since the only use of the hasher is to avoid creating duplicate

[009/nnn] poly_int: TRULY_NOOP_TRUNCATION

2017-10-23 Thread Richard Sandiford
This patch makes TRULY_NOOP_TRUNCATION take the mode sizes as poly_uint64s instead of unsigned ints. The function bodies don't need to change. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood

[008/nnn] poly_int: create_integer_operand

2017-10-23 Thread Richard Sandiford
This patch generalises create_integer_operand so that it accepts poly_int64s rather than HOST_WIDE_INTs. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood gcc/ * optabs.h

[007/nnn] poly_int: dump routines

2017-10-23 Thread Richard Sandiford
Add poly_int routines for the dumpfile.h and pretty-print.h frameworks. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood gcc/ * dumpfile.h (dump_dec): Declare. *

[006/nnn] poly_int: tree constants

2017-10-23 Thread Richard Sandiford
This patch adds a tree representation for poly_ints. Unlike the rtx version, the coefficients are INTEGER_CSTs rather than plain integers, so that we can easily access them as poly_widest_ints and poly_offset_ints. The patch also adjusts some places that previously relied on "constant" meaning

[005/nnn] poly_int: rtx constants

2017-10-23 Thread Richard Sandiford
This patch adds an rtl representation of poly_int values. There were three possible ways of doing this: (1) Add a new rtl code for the poly_ints themselves and store the coefficients as trailing wide_ints. This would give constants like: (const_poly_int [c0 c1 ... cn]) The

[004/nnn] poly_int: mode query functions

2017-10-23 Thread Richard Sandiford
This patch changes the bit size and vector count arguments to the machmode.h functions from unsigned int to poly_uint64. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood gcc/

[003/nnn] poly_int: MACRO_MODE

2017-10-23 Thread Richard Sandiford
This patch uses a MACRO_MODE wrapper for the target macro invocations in targhooks.c and address.h, so that macros for non-AArch64 targets can continue to treat modes as fixed-size. It didn't seem worth converting the address macros to hooks since (a) they're heavily used, (b) they should be

[002/nnn] poly_int: IN_TARGET_CODE

2017-10-23 Thread Richard Sandiford
This patch makes each target-specific TU define an IN_TARGET_CODE macro, which is used to decide whether poly_int<1, C> should convert to C. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood

Re: [PING] [C++ Patch] PR 82307

2017-10-23 Thread Nathan Sidwell
On 10/23/2017 09:15 AM, Paolo Carlini wrote: Hi, following up to a short off-line exchange with Nathan, I'm sending a reworked patch which - among other things - avoids regressing on the second testcase (cpp0x/enum36.C). Tested x86_64-linux. ok, thanks! nathan -- Nathan Sidwell

[001/nnn] poly_int: add poly-int.h

2017-10-23 Thread Richard Sandiford
This patch adds a new "poly_int" class to represent polynomial integers of the form: C0 + C1*X1 + C2*X2 ... + Cn*Xn It also adds poly_int-based typedefs for offsets and sizes of various precisions. In these typedefs, the Ci coefficients are compile-time constants and the Xi indeterminates are

[000/nnn] poly_int: representation of runtime offsets and sizes

2017-10-23 Thread Richard Sandiford
This series adds support for offsets and sizes that are a runtime invariant rather than a compile time constant. It's based on the patch posted here: https://gcc.gnu.org/ml/gcc-patches/2017-09/msg00406.html The rest of the covering note is split into: - Summary (from the message linked

Re: [PING][PATCH][Aarch64] Improve int<->FP conversions

2017-10-23 Thread James Greenhalgh
On Tue, Oct 17, 2017 at 01:17:04AM +0100, Michael Collison wrote: > Patch updated with all comments from James. OK with an appropriate ChangeLog and assuming it has been tested as required. Thanks, James Reviewed-by:

Re: [PATCH][AArch64] Wrong type-attribute for stp and str

2017-10-23 Thread Dominik Inführ
I’ve added your suggestions. I would also like to propose to change the type attribute from neon_stp to store_8 and store_16, this seems to be more in line with respect to other patterns. Thanks, Dominik ChangeLog: 2017-10-23 Dominik Infuehr *

Re: [PATCH] Include from system.h (PR bootstrap/82610)

2017-10-23 Thread Pedro Alves
On 10/23/2017 04:50 PM, David Malcolm wrote: > FWIW, this one isn't from #pragma poison, it's from: > #define abort() fancy_abort (__FILE__, __LINE__, __FUNCTION__) > > (I messed up the --in-reply-to when posting the patch, but Gerald noted > the issue was due to: >

Re: [RFC] New pragma exec_charset

2017-10-23 Thread Martin Sebor
On 10/23/2017 04:55 AM, Andreas Krebbel wrote: On 10/19/2017 07:13 PM, Martin Sebor wrote: On 10/19/2017 09:50 AM, Andreas Krebbel wrote: The TPF operating system uses the GCC S/390 backend. They set an EBCDIC exec charset for compilation using -fexec-charset. However, certain libraries

Re: [PATCH] Include from system.h (PR bootstrap/82610)

2017-10-23 Thread Michael Matz
Hi, On Mon, 23 Oct 2017, David Malcolm wrote: > FWIW, this one isn't from #pragma poison, it's from: > #define abort() fancy_abort (__FILE__, __LINE__, __FUNCTION__) > > (I messed up the --in-reply-to when posting the patch, but Gerald noted > the issue was due to: >

Re: [PATCH] Include from system.h (PR bootstrap/82610)

2017-10-23 Thread David Malcolm
On Mon, 2017-10-23 at 16:40 +0100, Pedro Alves wrote: > On 10/23/2017 04:17 PM, Jonathan Wakely wrote: > > On 23/10/17 17:07 +0200, Michael Matz wrote: > > > Hi, > > > > > > On Mon, 23 Oct 2017, Richard Biener wrote: > > > > > > > I guess so. But we have to make gdb happy as well. It really > >

Re: [PATCH] Include from system.h (PR bootstrap/82610)

2017-10-23 Thread Pedro Alves
On 10/23/2017 04:17 PM, Jonathan Wakely wrote: > On 23/10/17 17:07 +0200, Michael Matz wrote: >> Hi, >> >> On Mon, 23 Oct 2017, Richard Biener wrote: >> >>> I guess so. But we have to make gdb happy as well. It really depends how >>> much each TU grows with the extra (unneeded) include grows in

Re: [PATCH, rs6000 V3] Add Power 8 support to vec_revb

2017-10-23 Thread Carl Love
GCC maintainers: I have fixed the change log lines as mentioned by Segher. I removed the changes to swap_selector_for_mode() and instead created swap_endianess_selector_for_mode(). The mode attribute wd will not work for the define expand as the V16QI maps to "b" not "q". So I do need to have

Re: [PATCH] i386: Skip DF_REF_INSN if DF_REF_INSN_INFO is false

2017-10-23 Thread Uros Bizjak
On Mon, Oct 23, 2017 at 1:45 PM, H.J. Lu wrote: > We should check DF_REF_INSN_INFO before accessing DF_REF_INSN. > > OK for trunk? > > H.J. > --- > gcc/ > > PR target/82673 > * config/i386/i386.c (ix86_finalize_stack_frame_flags): Skip > DF_REF_INSN if

Re: [PATCH] Include from system.h (PR bootstrap/82610)

2017-10-23 Thread Jonathan Wakely
On 23/10/17 17:07 +0200, Michael Matz wrote: Hi, On Mon, 23 Oct 2017, Richard Biener wrote: I guess so. But we have to make gdb happy as well. It really depends how much each TU grows with the extra (unneeded) include grows in C++11 and C++04 mode. The c++ headers unconditionally included

Re: [PATCH] Include from system.h (PR bootstrap/82610)

2017-10-23 Thread Michael Matz
Hi, On Mon, 23 Oct 2017, Richard Biener wrote: > I guess so. But we have to make gdb happy as well. It really depends how > much each TU grows with the extra (unneeded) include grows in C++11 and > C++04 mode. The c++ headers unconditionally included from system.h, with: % echo '#include

Re: [PATCH] Include from system.h (PR bootstrap/82610)

2017-10-23 Thread Richard Biener
On October 23, 2017 4:15:17 PM GMT+02:00, David Malcolm wrote: >On Mon, 2017-10-23 at 15:51 +0200, Richard Biener wrote: >> On Mon, Oct 23, 2017 at 2:58 PM, David Malcolm >> wrote: >> > On Sun, 2017-10-22 at 09:28 +0200, Gerald Pfeifer wrote: >> > > On

Re: [PATCH] Include from system.h (PR bootstrap/82610)

2017-10-23 Thread David Malcolm
On Mon, 2017-10-23 at 15:51 +0200, Richard Biener wrote: > On Mon, Oct 23, 2017 at 2:58 PM, David Malcolm > wrote: > > On Sun, 2017-10-22 at 09:28 +0200, Gerald Pfeifer wrote: > > > On Thu, 19 Oct 2017, David Malcolm wrote: > > > > > In file included from

Re: [PATCH] Include from system.h (PR bootstrap/82610)

2017-10-23 Thread Pedro Alves
On 10/23/2017 02:51 PM, Richard Biener wrote: > On Mon, Oct 23, 2017 at 2:58 PM, David Malcolm wrote: >> OK for trunk? > > Not entirely happy as unique-ptr.h doesn't use but well. > Actually it does. It's needed in C++11 mode, because that's where std::unique_ptr is

Re: [PATCH] Make -gcolumn-info the default

2017-10-23 Thread Pedro Alves
On 10/23/2017 02:46 PM, Jason Merrill wrote: > On Mon, Oct 23, 2017 at 3:33 AM, Jakub Jelinek wrote: >> Hi! >> >> When -gcolumn-info was added back in February, it was too late in the >> release cycle to make it the default, but I think now is the good time >> to do it for GCC8.

Re: [PATCH] Include from system.h (PR bootstrap/82610)

2017-10-23 Thread Richard Biener
On Mon, Oct 23, 2017 at 2:58 PM, David Malcolm wrote: > On Sun, 2017-10-22 at 09:28 +0200, Gerald Pfeifer wrote: >> On Thu, 19 Oct 2017, David Malcolm wrote: >> > > In file included from /scratch/tmp/gerald/gcc-HEAD/gcc/unique- >> > > ptr-tests.cc:23: >> > > In file included

Re: [PATCH] Make -gcolumn-info the default

2017-10-23 Thread Jason Merrill
On Mon, Oct 23, 2017 at 3:33 AM, Jakub Jelinek wrote: > Hi! > > When -gcolumn-info was added back in February, it was too late in the > release cycle to make it the default, but I think now is the good time > to do it for GCC8. > > Bootstrapped/regtested on x86_64-linux and

[PATCH] FIx PR82672

2017-10-23 Thread Richard Biener
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied. Richard. 2017-10-23 Richard Biener PR tree-optimization/82672 * graphite-isl-ast-to-gimple.c (graphite_copy_stmts_from_block): Fold the stmt if we propagated into it. *

Re: [PING] [C++ Patch] PR 82307

2017-10-23 Thread Paolo Carlini
Hi, following up to a short off-line exchange with Nathan, I'm sending a reworked patch which - among other things - avoids regressing on the second testcase (cpp0x/enum36.C). Tested x86_64-linux. Thanks, Paolo. /cp 2017-10-23 Mukesh Kapoor

[PATCH] Include from system.h (PR bootstrap/82610)

2017-10-23 Thread David Malcolm
On Sun, 2017-10-22 at 09:28 +0200, Gerald Pfeifer wrote: > On Thu, 19 Oct 2017, David Malcolm wrote: > > > In file included from /scratch/tmp/gerald/gcc-HEAD/gcc/unique- > > > ptr-tests.cc:23: > > > In file included from /scratch/tmp/gerald/gcc- > > > HEAD/gcc/../include/unique-ptr.h:77: > > > In

[Patch][ARM] Add -mbranch-cost option, and update a few tests

2017-10-23 Thread Christophe Lyon
Hi, After Jakub's suggestion in PR82120 and PR81184, the attached patch adds the -mbranch-cost option to the ARM target. My understanding is that it's intended to be used internally for testing and does not require user-facing documentation. I have updated a few tests, validation on aarch64 &

[PATCH] Implement C++17 Filesystem library

2017-10-23 Thread Jonathan Wakely
Based on Filesystem TS implementation, with the changes applied by: - P0219R1 Relative Paths for Filesystem - P0317R1 Directory Entry Caching for Filesystem - P0492R2 Resolution of C++17 National Body Comments Where appropriate code is shared between the TS and C++17 implementations. *

[PATCH] i386: Skip DF_REF_INSN if DF_REF_INSN_INFO is false

2017-10-23 Thread H.J. Lu
We should check DF_REF_INSN_INFO before accessing DF_REF_INSN. OK for trunk? H.J. --- gcc/ PR target/82673 * config/i386/i386.c (ix86_finalize_stack_frame_flags): Skip DF_REF_INSN if DF_REF_INSN_INFO is false. gcc/testsuite/ PR target/82673 *

[22/nn] Make dse.c use offset/width instead of start/end

2017-10-23 Thread Richard Sandiford
store_info and read_info_type in dse.c represented the ranges as start/end, but a lot of the internal code used offset/width instead. Using offset/width throughout fits better with the poly_int.h range-checking functions. 2017-10-23 Richard Sandiford

[21/nn] Minor vn_reference_lookup_3 tweak

2017-10-23 Thread Richard Sandiford
The repeated checks for MEM_REF made this code hard to convert to poly_ints as-is. Hopefully the new structure also makes it clearer at a glance what the two cases are. 2017-10-23 Richard Sandiford Alan Hayward

[20/nn] Make tree-ssa-dse.c:normalize_ref return a bool

2017-10-23 Thread Richard Sandiford
This patch moves the check for an overlapping byte to normalize_ref from its callers, so that it's easier to convert to poly_ints later. It's not really worth it on its own. 2017-10-23 Richard Sandiford gcc/ * tree-ssa-dse.c (normalize_ref): Check

[19/nn] Don't treat zero-sized ranges as overlapping

2017-10-23 Thread Richard Sandiford
Most GCC ranges seem to be represented as an offset and a size (rather than a start and inclusive end or start and exclusive end). The usual test for whether X is in a range is of course: x >= start && x < start + size or: x >= start && x - start < size which means that an empty range of

[18/nn] Use (CONST_VECTOR|GET_MODE)_NUNITS in simplify-rtx.c

2017-10-23 Thread Richard Sandiford
This patch avoids some calculations of the form: GET_MODE_SIZE (vector_mode) / GET_MODE_SIZE (element_mode) in simplify-rtx.c. If we're dealing with CONST_VECTORs, it's better to use CONST_VECTOR_NUNITS, since that remains constant even after the SVE patches. In other cases we can get the

[17/nn] Turn var-tracking.c:INT_MEM_OFFSET into a function

2017-10-23 Thread Richard Sandiford
This avoids the double evaluation mentioned in the comments and simplifies the change to make MEM_OFFSET variable. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood gcc/ *

Re: [PATCH, i386]: Fix PR 82628, wrong code at -Os on x86_64-linux-gnu in the 32-bit mode

2017-10-23 Thread Uros Bizjak
On Mon, Oct 23, 2017 at 1:07 PM, Jakub Jelinek wrote: > On Mon, Oct 23, 2017 at 12:27:15PM +0200, Uros Bizjak wrote: >> On Mon, Oct 23, 2017 at 12:09 PM, Jakub Jelinek wrote: >> > On Sun, Oct 22, 2017 at 08:04:28PM +0200, Uros Bizjak wrote: >> >> Hello! >> >>

[16/nn] Factor out the mode handling in lower-subreg.c

2017-10-23 Thread Richard Sandiford
This patch adds a helper routine (interesting_mode_p) to lower-subreg.c, to make the decision about whether a mode can be split and, if so, calculate the number of bytes and words in the mode. At present this function always returns true; a later patch will add cases in which it can return false.

[15/nn] Use more specific hash functions in rtlhash.c

2017-10-23 Thread Richard Sandiford
Avoid using add_object when we have more specific routines available. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood gcc/ * rtlhash.c (add_rtx): Use add_hwi for 'w' and

[14/nn] Add helpers for shift count modes

2017-10-23 Thread Richard Sandiford
This patch adds a stub helper routine to provide the mode of a scalar shift amount, given the mode of the values being shifted. One long-standing problem has been to decide what this mode should be for arbitrary rtxes (as opposed to those directly tied to a target pattern). Is it the mode of the

[13/nn] More is_a

2017-10-23 Thread Richard Sandiford
alias.c:find_base_term and find_base_value checked: if (GET_MODE_SIZE (GET_MODE (src)) < GET_MODE_SIZE (Pmode)) but (a) comparing the precision seems more correct, since it's possible for modes to have the same memory size as Pmode but fewer bits and (b) the functions are called on

[12/nn] Add an is_narrower_int_mode helper function

2017-10-23 Thread Richard Sandiford
This patch adds a function for testing whether an arbitrary mode X is an integer mode that is narrower than integer mode Y. This is useful for code like expand_float and expand_fix that could in principle handle vectors as well as scalars. 2017-10-23 Richard Sandiford

[11/nn] Add narrower_subreg_mode helper function

2017-10-23 Thread Richard Sandiford
This patch adds a narrowing equivalent of wider_subreg_mode. At present there is only one user. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood gcc/ * rtl.h

[10/nn] Widening optab cleanup

2017-10-23 Thread Richard Sandiford
widening_optab_handler had the comment: /* ??? Why does find_widening_optab_handler_and_mode attempt to widen things that can't be widened? E.g. add_optab... */ if (op > LAST_CONV_OPTAB) return CODE_FOR_nothing; I think it comes from expand_binop using

[09/nn] Add a fixed_size_mode_pod class

2017-10-23 Thread Richard Sandiford
This patch adds a POD version of fixed_size_mode. The only current use is for storing the __builtin_apply and __builtin_result register modes, which were made fixed_size_modes by the previous patch. 2017-10-23 Richard Sandiford Alan Hayward

Some PRE TLC

2017-10-23 Thread Richard Biener
Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. Richard. 2017-10-23 Richard Biener * tree-ssa-pre.c (bitmap_remove_from_set): Rename to... (bitmap_remove_expr_from_set): ... this. All callers call this for non-constant values.

[07/nn] Add unique CONSTs

2017-10-23 Thread Richard Sandiford
This patch adds a way of treating certain kinds of CONST as unique, so that pointer equality is equivalent to value equality. For now it is restricted to VEC_DUPLICATE and VEC_SERIES, although the code to generate them remains in the else arm of an "if (1)" until a later patch. This is needed so

[08/nn] Add a fixed_size_mode class

2017-10-23 Thread Richard Sandiford
This patch adds a fixed_size_mode machine_mode wrapper for modes that are known to have a fixed size. That applies to all current modes, but future patches will add support for variable-sized modes. The use of this class should be pretty restricted. One important use case is to hold the mode of

[06/nn] Add VEC_SERIES_{CST,EXPR} and associated optab

2017-10-23 Thread Richard Sandiford
Similarly to the VEC_DUPLICATE_{CST,EXPR}, this patch adds two tree code equivalents of the VEC_SERIES rtx code. VEC_SERIES_EXPR is for non-constant inputs and is a normal tcc_binary. VEC_SERIES_CST is a tcc_constant. Like VEC_DUPLICATE_CST, VEC_SERIES_CST is only used for variable-length

[05/nn] Add VEC_DUPLICATE_{CST,EXPR} and associated optab

2017-10-23 Thread Richard Sandiford
SVE needs a way of broadcasting a scalar to a variable-length vector. This patch adds VEC_DUPLICATE_CST for when VECTOR_CST would be used for fixed-length vectors and VEC_DUPLICATE_EXPR for when CONSTRUCTOR would be used for fixed-length vectors. VEC_DUPLICATE_EXPR is the tree equivalent of the

[04/nn] Add a VEC_SERIES rtl code

2017-10-23 Thread Richard Sandiford
This patch adds an rtl representation of a vector linear series of the form: a[I] = BASE + I * STEP Like vec_duplicate; - the new rtx can be used for both constant and non-constant vectors - when used for constant vectors it is wrapped in a (const ...) - the constant form is only used for

[03/nn] Allow vector CONSTs

2017-10-23 Thread Richard Sandiford
This patch allows (const ...) wrappers to be used for rtx vector constants, as an alternative to const_vector. This is useful for SVE, where the number of elements isn't known until runtime. It could also be useful in future for fixed-length vectors, to reduce the amount of memory needed to

[02/nn] Add more vec_duplicate simplifications

2017-10-23 Thread Richard Sandiford
This patch adds a vec_duplicate_p helper that tests for constant or non-constant vector duplicates. Together with the existing const_vec_duplicate_p, this complements the gen_vec_duplicate and gen_const_vec_duplicate added by a previous patch. The patch uses the new routines to add more rtx

[01/nn] Add gen_(const_)vec_duplicate helpers

2017-10-23 Thread Richard Sandiford
This patch adds helper functions for generating constant and non-constant vector duplicates. These routines help with SVE because it is then easier to use: (const:M (vec_duplicate:M X)) for a broadcast of X, even if the number of elements in M isn't known at compile time. It also makes it

[PATCH] Revert fix for PR81181

2017-10-23 Thread Richard Biener
The fix was subsumed by that for PR82129. Bootstrapped and tested on x86_64-unknown-linux-gnu, applied. Richard. 2017-10-23 Richard Biener PR tree-optimization/82129 Revert 2017-08-01 Richard Biener PR

[00/nn] Patches preparing for runtime offsets and sizes

2017-10-23 Thread Richard Sandiford
This series of patches adds or does things are needed for SVE runtime offsets and sizes, but aren't directly related to offsets and sizes themselves. It's a prerequisite to the main series that I'll post later today. Tested by compiling the testsuite before and after the series on:

[PATCH] PR libstdc++/82644 document IS 29124 support

2017-10-23 Thread Jonathan Wakely
Also fix declarations of special functions in C++17, to import them into the global namespace in , and to prevent defining the non-standard hypergeometric functions in strict mode. PR libstdc++/82644 * doc/xml/manual/intro.xml: Include new section. *

Re: [PATCH, i386]: Fix PR 82628, wrong code at -Os on x86_64-linux-gnu in the 32-bit mode

2017-10-23 Thread Jakub Jelinek
On Mon, Oct 23, 2017 at 12:27:15PM +0200, Uros Bizjak wrote: > On Mon, Oct 23, 2017 at 12:09 PM, Jakub Jelinek wrote: > > On Sun, Oct 22, 2017 at 08:04:28PM +0200, Uros Bizjak wrote: > >> Hello! > >> > >> In PR 82628 Jakub figured out that insn patterns that consume carry > >>

Re: [patch] Fix PR middle-end/82569

2017-10-23 Thread Richard Biener
On Mon, Oct 23, 2017 at 12:57 PM, Eric Botcazou wrote: > Hi, > > this is the regression present on the mainline for Power6 and introduced by my > patch fiddling with SUBREG_PROMOTED_VAR_P in expand_expr_real_1. It turns out > that the ouf-of-ssa pass implicitly assumes

Re: [PATCH, RFC] Add a pass counter for "are we there yet" purposes

2017-10-23 Thread Richard Biener
On Mon, Oct 23, 2017 at 12:18 PM, Martin Jambor wrote: > Hi, > > On Mon, Oct 16, 2017 at 06:15:06PM +0200, Richard Biener wrote: >> I guess that might help. I have the feeling that querying for 'did >> pass X run' is wrong conceptually. > > The reason why I liked the idea is that

[patch] Fix PR middle-end/82569

2017-10-23 Thread Eric Botcazou
Hi, this is the regression present on the mainline for Power6 and introduced by my patch fiddling with SUBREG_PROMOTED_VAR_P in expand_expr_real_1. It turns out that the ouf-of-ssa pass implicitly assumes that promoted RTXes for partitions are fully initialized (because it can generate direct

Re: [patch 2/5] add hook to track when splitting is complete

2017-10-23 Thread Richard Biener
On Sat, Oct 21, 2017 at 11:17 PM, Sandra Loosemore wrote: > On 10/20/2017 02:24 AM, Richard Biener wrote: >> >> On Fri, Oct 20, 2017 at 4:09 AM, Sandra Loosemore >> wrote: >>> >>> This patch adds a function to indicate whether the split1 pass has

Re: [RFC] New pragma exec_charset

2017-10-23 Thread Andreas Krebbel
On 10/19/2017 07:13 PM, Martin Sebor wrote: > On 10/19/2017 09:50 AM, Andreas Krebbel wrote: >> The TPF operating system uses the GCC S/390 backend. They set an >> EBCDIC exec charset for compilation using -fexec-charset. However, >> certain libraries require ASCII strings instead. In order to

<    1   2   3   >