[PATCH] Validate that Init value is within range defined by IntegerRange.

2017-07-13 Thread Martin Liška
Hello. I'm sending the patch that does validation of values of Init. Patch can bootstrap on ppc64le-redhat-linux and survives regression tests. Ready to be installed? Martin >From 46d8c6b9030d677629a4f7c647efe73f4c2ddf0c Mon Sep 17 00:00:00 2001 From: marxin Date: Mon, 10 Jul 2017 10:33:49 +0200

Split out parts of scompare_loc_descriptor and emit_store_flag

2017-07-13 Thread Richard Sandiford
This patch splits some cases out of scompare_loc_descriptor and emit_store_flag, which helps with the upcoming machmode series. Tested on aarch64-linux-gnu, powerpc64le-linux-gnu and x86_64-linux-gnu. OK to install? Richard 2017-07-13 Richard Sandiford gcc/ * dwarf2out.c (scompare_l

Re: Add support to trace comparison instructions and switch statements

2017-07-13 Thread Dmitry Vyukov via gcc-patches
On Tue, Jul 11, 2017 at 1:59 PM, Wish Wu wrote: > Hi > > I wrote a test for "-fsanitize-coverage=trace-cmp" . > > Is there anybody tells me if these codes could be merged into gcc ? Nice! We are currently working on Linux kernel fuzzing that use the comparison tracing. We use clang at the momen

[PATCH] Cleanup #2 of Pascal references.

2017-07-13 Thread Martin Liška
Thanks Jason, I'm sending patch #2. Ready for trunk? Martin >From 2fa6d00cc6686e8bf081d736de44c22ecf61a795 Mon Sep 17 00:00:00 2001 From: marxin Date: Thu, 13 Jul 2017 10:08:14 +0200 Subject: [PATCH] Cleanup #2 of Pascal references. gcc/ChangeLog: 2017-07-13 Martin Liska * dwarf2out.c (gen

Re: [PATCH] Add self as maintainer of D front-end and libphobos

2017-07-13 Thread Iain Buclaw
On 24 June 2017 at 20:16, Iain Buclaw wrote: > Hi, > > As per message on the D language being accepted, this adds myself as a > maintainer of the D front-end and libphobos runtime library. > > David, should this wait until the rest has been approved? > Hi, I may have to request a ping here. Iai

[00/77] Add wrapper classes for machine_modes

2017-07-13 Thread Richard Sandiford
This series is an update of: https://gcc.gnu.org/ml/gcc-patches/2016-12/msg00766.html It adds a group of wrapper classes around machine_mode for modes that are known to belong to, or need to belong to, a particular mode_class. For example, it adds a scalar_int_mode wrapper for MODE_INT and MO

[01/77] Add an E_ prefix to mode names

2017-07-13 Thread Richard Sandiford
Later patches will add wrapper types for specific classes of mode. E.g. SImode will be a scalar_int_mode, SFmode will be a scalar_float_mode, etc. This patch prepares for that change by adding an E_ prefix to the mode enum values. It also adds #defines that map the unprefixed names to the prefix

[02/77] Add an E_ prefix to mode names and update case statements

2017-07-13 Thread Richard Sandiford
All case statements need to be updated to use the prefixed names, since the unprefixed names will eventually not be integer constant expressions. This patch does a mechanical substitution over the whole codebase. 2017-07-13 Richard Sandiford Alan Hayward David Sherwoo

[03/77] Allow machine modes to be classes

2017-07-13 Thread Richard Sandiford
This patch makes various changes that allow modes like SImode to be classes rather than enums. Firstly, it adds inline functions for all mode size properties, with the macros being simple wrappers around them. This is necessary for the __builtin_constant_p trick to continue working effectively wh

[05/77] Small tweak to array_value_type

2017-07-13 Thread Richard Sandiford
Store the type mode in a variable so that a later, more mechanical patch can change its type. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * tree-switch-conversion.c (array_value_type): Only read TYPE_MODE once. Use get_narrowest_mo

[04/77] Add FOR_EACH iterators for modes

2017-07-13 Thread Richard Sandiford
The new iterators are: - FOR_EACH_MODE_IN_CLASS: iterate over all the modes in a mode class. - FOR_EACH_MODE_FROM: iterate over all the modes in a class, starting at a given mode. - FOR_EACH_WIDER_MODE: iterate over all the modes in a class, starting at the next widest mode after a given mod

[06/77] Make GET_MODE_WIDER return an opt_mode

2017-07-13 Thread Richard Sandiford
GET_MODE_WIDER previously returned VOIDmode if no wider mode existed. That would cause problems with stricter mode classes, since VOIDmode isn't for example a valid scalar integer or floating-point mode. This patch instead makes it return a new opt_mode class, which holds either a T or nothing. 20

[08/77] Simplify gen_trunc/extend_conv_libfunc

2017-07-13 Thread Richard Sandiford
Replace checks of: GET_MODE_CLASS (fmode) != MODE_FLOAT && !DECIMAL_FLOAT_MODE_P (fmode) with !is_a and use MODE_CLASS equality/inequality instead of: (GET_MODE_CLASS (tmode) == MODE_FLOAT && DECIMAL_FLOAT_MODE_P (fmode)) || (GET_MODE_CLASS (fmode) == MODE_FLOAT && DECIMAL_FLOAT_MODE_P (t

[07/77] Add scalar_float_mode

2017-07-13 Thread Richard Sandiford
This patch adds a scalar_float_mode class, which wraps a mode enum that is known to satisfy SCALAR_FLOAT_MODE_P. Things like "SFmode" now give a scalar_float_mode object instead of a machine_mode. This in turn needs a change to the real.h format_helper, so that it can accept both machine_modes and

[09/77] Add SCALAR_FLOAT_TYPE_MODE

2017-07-13 Thread Richard Sandiford
This patch adds a macro that extracts the TYPE_MODE and forcibly converts it to a scalar_float_mode. The forcible conversion includes a gcc_checking_assert that the mode is a SCALAR_FLOAT_MODE_P. This becomes important as more static type checking is added by later patches. It has the additional

[10/77] Make assemble_real take a scalar_float_mode

2017-07-13 Thread Richard Sandiford
As per subject. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * output.h (assemble_real): Take a scalar_float_mode. * config/arm/arm.c (arm_assemble_integer): Update accordingly. * config/arm/arm.md (consttable_4): Likewise.

[11/77] Add a float_mode_for_size helper function

2017-07-13 Thread Richard Sandiford
This provides a type-safe way to ask for a float mode and get it as a scalar_float_mode. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * coretypes.h (opt_scalar_float_mode): New typedef. * machmode.h (float_mode_for_size): New functio

[12/77] Use opt_scalar_float_mode when iterating over float modes

2017-07-13 Thread Richard Sandiford
This means that we know when accessing the modes that the size is a compile-time constant, even for SVE. It also enables stricter type safety in later patches. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * machmode.h (mode_iterator::start)

[13/77] Make floatn_mode return an opt_scalar_float_mode

2017-07-13 Thread Richard Sandiford
As per subject. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * target.def (default_floatn_mode): Return an opt_scalar_float_mode. * doc/tm.texi: Regenerate. * config/arm/arm.c (arm_floatn_mode): Return an opt_scalar_float_mod

[14/77] Make libgcc_floating_mode_supported_p take a scalar_float_mode

2017-07-13 Thread Richard Sandiford
As per subject. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * target.def (libgcc_floating_mode_supported_p): Take a scalar_float_mode. * doc/tm.texi: Regenerate. * targhooks.h (default_libgcc_floating_mode_supported_

[15/77] Add scalar_int_mode

2017-07-13 Thread Richard Sandiford
Similar to the previous scalar_float_mode patch, but for modes that satisfy SCALAR_INT_MODE_P. There are very many uses of scalar integers, so this patch only makes a token change to the types of byte_mode, word_mode, ptr_mode and rs6000_pmode. The next patches in the series gradually replace mor

[16/77] Add scalar_int_mode_pod

2017-07-13 Thread Richard Sandiford
This patch adds a POD class for scalar integers, as an instance of a new pod_mode template. Later patches will use pod_mode in situations that really do need to be POD; this patch is simply using PODs to remove load-time initialisation. 2017-07-13 Richard Sandiford Alan Hayward

[17/77] Add an int_mode_for_size helper function

2017-07-13 Thread Richard Sandiford
This patch adds a wrapper around mode_for_size for cases in which the mode class is MODE_INT (the commonest case). The return type can then be an opt_scalar_int_mode instead of a machine_mode. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ *

[18/77] Make int_mode_for_mode return an opt_scalar_int_mode

2017-07-13 Thread Richard Sandiford
Also use int_mode_for_mode instead of (int_)mode_for_size in cases where the requested size was the bitsize of an existing mode. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * machmode.h (opt_mode::else_blk): New function. (int_mode_

[19/77] Add a smallest_int_mode_for_size helper function

2017-07-13 Thread Richard Sandiford
This patch adds a wrapper around smallest_mode_for_size for cases in which the mode class is MODE_INT. Unlike (int_)mode_for_size, smallest_mode_for_size always returns a mode of the specified class, asserting if no such mode exists. smallest_int_mode_for_size therefore returns a scalar_int_mode r

Re: [PATCH 0/13] D: Submission of D Front End

2017-07-13 Thread Iain Buclaw
On 24 June 2017 at 19:23, Iain Buclaw wrote: > Hi, > > Just doing an update of the patch series, rebased against trunk, and > applied changes as requested by every comment so far. > > Notes on changes have been made on each patch where applicable. > Hi, So what would be the best way forward with

[20/77] Replace MODE_INT checks with is_int_mode

2017-07-13 Thread Richard Sandiford
Replace checks of "GET_MODE_CLASS (...) == MODE_INT" with "is_int_mode (..., &var)", in cases where it becomes useful to refer to the mode as a scalar_int_mode. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * machmode.h (is_int_mode): New fuc

[21/77] Replace SCALAR_INT_MODE_P checks with is_a

2017-07-13 Thread Richard Sandiford
This patch replaces checks of "SCALAR_INT_MODE_P (...)" with "is_a (..., &var)" in cases where it becomes useful to refer to the mode as a scalar_int_mode. It also replaces some checks for the two constituent classes (MODE_INT and MODE_PARTIAL_INT). The patch also introduces is_a checks for som

[22/77] Replace !VECTOR_MODE_P with is_a

2017-07-13 Thread Richard Sandiford
This patch replaces some checks of !VECTOR_MODE_P with checks of is_a , in cases where the scalar integer modes were the only useful alternatives left. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * simplify-rtx.c (simplify_binary_operation_

[23/77] Replace != VOIDmode checks with is_a

2017-07-13 Thread Richard Sandiford
This patch replaces some checks against VOIDmode with checks of is_a , in cases where scalar integer modes were the only useful alternatives left. gcc/ 2017-07-13 Richard Sandiford Alan Hayward David Sherwood * cfgexpand.c (expand_debug_expr): Use is_a

[24/77] Replace a != BLKmode check with is_a

2017-07-13 Thread Richard Sandiford
This patch replaces a check against BLKmode with a check of is_a , in a case where scalar integer modes were the only useful alternatives left. gcc/ 2017-07-13 Richard Sandiford Alan Hayward David Sherwood * gimple-fold.c (gimple_fold_builtin_memory_op): Use

[25/77] Use is_a for bitmask optimisations

2017-07-13 Thread Richard Sandiford
Explicitly check for scalar_int_mode in code that maps arithmetic to full-mode bit operations. These operations wouldn't work correctly for vector modes, for example. In many cases this is enforced also by checking whether an operand is CONST_INT_P, but there were other cases where the condition

[26/77] Use is_a in subreg/extract simplifications

2017-07-13 Thread Richard Sandiford
This patch adds is_a checks to various places that were optimising subregs or extractions in ways that only made sense for scalar integers. Often the subreg transformations were looking for extends, truncates or shifts and trying to remove the subreg, which wouldn't be correct if the SUBREG_REG w

[27/77] Use is_a before LOAD_EXTEND_OP

2017-07-13 Thread Richard Sandiford
This patch adds is_a checks before load_extend_op/ LOAD_EXTEND_OP calls, if that becomes useful for later patches. (load_extend_op will return UNKNOWN for any other type of mode.) 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * cse.c (cse_in

[29/77] Make some *_loc_descriptor helpers take scalar_int_mode

2017-07-13 Thread Richard Sandiford
The *_loc_descriptor routines for clz, popcount, bswap and rotate all required SCALAR_INT_MODE_P. This patch moves the checks into the caller (mem_loc_descriptor) so that the types of the mode parameters can be scalar_int_mode instead of machine_mode. The MOD handling in mem_loc_descriptor is als

[28/77] Use is_a for miscellaneous types of test

2017-07-13 Thread Richard Sandiford
This patch adds is_a checks to various places that were explicitly or implicitly restricted to integers already, in cases where adding an explicit is_a is useful for later patches. In simplify_if_then_else, the: GET_MODE (XEXP (XEXP (t, 0), N)) expressions were equivalent to: GET_MODE (XE

[30/77] Use scalar_int_mode for doubleword splits

2017-07-13 Thread Richard Sandiford
This patch uses is_a in a couple of places that were splitting doubleword integer operations into word_mode operations. It also uses scalar_int_mode in the expand_expr_real_2 handling of doubleword shifts. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood g

[31/77] Use scalar_int_mode for move2add

2017-07-13 Thread Richard Sandiford
The postreload move2add optimisations are specific to scalar integers. This patch adds an explicit check to the main guarding "if" and propagates the information through subroutines. gcc/ 2017-07-13 Richard Sandiford Alan Hayward David Sherwood * postreload

[32/77] Check is_a before calling valid_pointer_mode

2017-07-13 Thread Richard Sandiford
A future patch will make valid_pointer_mode take a scalar_int_mode instead of a machine_mode. is_a <...> rather than as_a <...> is needed here because we're checking a mode supplied by the user. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/c-family/

[33/77] Add a NARROWEST_INT_MODE macro

2017-07-13 Thread Richard Sandiford
This patch replaces uses of GET_CLASS_NARROWEST_MODE (MODE_INT) with a new NARROWEST_INT_MODE macro, which has type scalar_int_mode. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * machmode.h (NARROWEST_INT_MODE): New macro. * expr.c

[35/77] Add uses of as_a

2017-07-13 Thread Richard Sandiford
This patch adds asserting as_a conversions to contexts in which the input is known to be a scalar integer mode. In expand_divmod, op1 is always a scalar_int_mode if op1_is_constant (but might not be otherwise). In expand_binop, the patch reverses a < comparison in order to avoid splitting a long

[34/77] Add a SCALAR_INT_TYPE_MODE macro

2017-07-13 Thread Richard Sandiford
This patch adds a SCALAR_INT_TYPE_MODE macro that asserts that the type has a scalar integer mode and returns it as a scalar_int_mode. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * tree.h (SCALAR_INT_TYPE_MODE): New macro. * builtin

[36/77] Use scalar_int_mode in the RTL iv routines

2017-07-13 Thread Richard Sandiford
This patch changes the iv modes in rtx_iv from machine_mode to scalar_int_mode. It also passes the mode of the iv down to subroutines; this avoids the previous situation in which the mode information was sometimes lost and had to be added by the caller on return. Some routines already took a mode

[37/77] Use scalar_int_mode when emitting cstores

2017-07-13 Thread Richard Sandiford
cstore patterns always have a scalar integer result, which has the value 0 for "false" and STORE_FLAG_VALUE for "true". This patch makes that explicit using scalar_int_mode. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * target.def (cstore_

[38/77] Move SCALAR_INT_MODE_P out of strict_volatile_bitfield_p

2017-07-13 Thread Richard Sandiford
strict_volatile_bitfield_p returns false for any mode that isn't a scalar integer. This patch moves the check to the caller and makes strict_volatile_bitfield_p take the mode as a scalar_int_mode. The handling of a true return can then also use the mode as a scalar_int_mode. 2017-07-13 Richard S

[39/77] Two changes to the get_best_mode interface

2017-07-13 Thread Richard Sandiford
get_best_mode always returns a scalar_int_mode on success, so this patch makes that explicit in the type system. Also, the "largest_mode" argument is used simply to provide a maximum size, and in practice that size is always a compile-time constant, even when the concept of variable-sized modes is

[40/77] Use scalar_int_mode for extraction_insn fields

2017-07-13 Thread Richard Sandiford
insv, extv and eztzv modify or read a field in a register or memory. The field always has a scalar integer mode, while the register or memory either has a scalar integer mode or BLKmode. The mode of the bit position is also a scalar integer. This patch uses the type system to make that explicit.

[41/77] Split scalar integer handling out of force_to_mode

2017-07-13 Thread Richard Sandiford
force_to_mode exits partway through for modes that aren't scalar integers. This patch splits the remainder of the function out into a subroutine, force_int_to_mode, so that the modes from that point on can have type scalar_int_mode. The patch also makes sure that xmode is kept up-to-date with x a

[42/77] Use scalar_int_mode in simplify_shift_const_1

2017-07-13 Thread Richard Sandiford
This patch makes simplify_shift_const_1 use scalar_int_modes for all code that is specific to scalars rather than vectors. This includes situations in which the new shift mode is different from the original one, since the function never changes the mode of vector shifts. That in turn makes it more

[44/77] Make simplify_and_const_int take a scalar_int_mode

2017-07-13 Thread Richard Sandiford
After previous patches, top-level calls to simplify_and_const_int always pass a scalar_int_mode. The only call site that needs to be updated is the recursive one in simplify_and_const_int_1, at which point we know "varop" has a scalar integer mode. 2017-07-13 Richard Sandiford Alan

[43/77] Use scalar_int_mode in simplify_comparison

2017-07-13 Thread Richard Sandiford
The main loop of simplify_comparison starts with: if (GET_MODE_CLASS (mode) != MODE_INT && ! (mode == VOIDmode && (GET_CODE (op0) == COMPARE || COMPARISON_P (op0 break; So VOIDmode is only acceptable when comparing a COMPARE, EQ, NE, etc. operand agains

[45/77] Make extract_left_shift take a scalar_int_mode

2017-07-13 Thread Richard Sandiford
This patch passes the mode of the shifted value to extract_left_shift and updates the only caller so that the mode is a scalar_int_mode. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * combine.c (extract_left_shift): Add a mode argument and u

[46/77] Make widest_int_mode_for_size return a scalar_int_mode

2017-07-13 Thread Richard Sandiford
The comment for widest_int_mode said that it returns "the widest integer mode no wider than SIZE", but it actually returns the widest integer mode that is narrower than SIZE. In practice SIZE is always greater than 1, so it can always pick QImode in the worst case. The VOIDmode paths seem to be d

[47/77] Make subroutines of nonzero_bits operate on scalar_int_mode

2017-07-13 Thread Richard Sandiford
nonzero_bits1 assumed that all bits of a floating-point or vector mode were needed. It seems likely that fixed-point modes should have been handled in the same way. After excluding those, the only remaining modes that are likely to be useful are scalar integer ones. This patch moves the mode cla

[48/77] Make subroutines of num_sign_bit_copies operate on scalar_int_mode

2017-07-13 Thread Richard Sandiford
Similarly to the nonzero_bits patch, this one moves the mode class check and VOIDmode handling from num_sign_bit_copies1 to num_sign_bit_copies itself, then changes the subroutines to operate on scalar_int_modes. gcc/ 2017-07-13 Richard Sandiford Alan Hayward David She

[49/77] Simplify nonzero/num_sign_bits hooks

2017-07-13 Thread Richard Sandiford
The two implementations of the reg_nonzero_bits and reg_num_sign_bits hooks ignored the "known_x", "known_mode" and "known_ret" arguments, so this patch removes them. It adds a new scalar_int_mode parameter that specifies the mode of "x". (This mode might be different from "mode", which is the mo

[50/77] Add helper routines for SUBREG_PROMOTED_VAR_P subregs

2017-07-13 Thread Richard Sandiford
When subregs contain promoted values, as indicated by SUBREG_PROMOTED_VAR_P, both the unpromoted (outer) and promoted (inner) values are known to be scalar integers. This patch adds helper routines that get the modes as scalar_int_modes. 2017-07-13 Richard Sandiford Alan Hayward

[51/77] Use opt_scalar_int_mode when iterating over integer modes

2017-07-13 Thread Richard Sandiford
This patch uses opt_scalar_int_mode rather than machine_mode when iterating over scalar_int_modes, in cases where that helps with future patches. (Using machine_mode is still OK in places that don't really care about the mode being a scalar integer.) 2017-07-13 Richard Sandiford Al

[52/77] Use scalar_int_mode in extract/store_bit_field

2017-07-13 Thread Richard Sandiford
After a certain point, extract_bit_field and store_bit_field ensure that they're dealing with integer modes or BLKmode MEMs. This patch uses scalar_int_mode and opt_scalar_int_mode for those parts. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/

[53/77] Pass a mode to const_scalar_mask_from_tree

2017-07-13 Thread Richard Sandiford
The caller of const_scalar_mask_from_tree has proven that the mode is a MODE_INT, so this patch passes it down as a scalar_int_mode. It also expands the comment a little. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * expr.c (const_scalar_m

[54/77] Add explicit int checks for alternative optab implementations

2017-07-13 Thread Richard Sandiford
expand_unop can expand narrow clz, clrsb, ctz, bswap, parity and ffs operations using optabs for wider modes. These expansions apply only to scalar integer modes (and not for example to vectors), so the patch adds explicit checks for that. 2017-07-13 Richard Sandiford Alan Hayward

[55/77] Use scalar_int_mode in simplify_const_unary_operation

2017-07-13 Thread Richard Sandiford
The main scalar integer block in simplify_const_unary_operation had the condition: if (CONST_SCALAR_INT_P (op) && width > 0) where "width > 0" was a roundabout way of testing != VOIDmode. This patch replaces it with a check for a scalar_int_mode instead. It also uses the number of bits in the i

[57/77] Use scalar_int_mode in expand_expr_addr_expr

2017-07-13 Thread Richard Sandiford
This patch rewrites the condition: if (tmode != address_mode && tmode != pointer_mode) tmode = address_mode; to the equivalent: tmode == pointer_mode ? pointer_mode : address_mode The latter has the advantage that the result is naturally a scalar_int_mode; a later mechanical patch makes

[56/77] Use the more specific type when two modes are known to be equal

2017-07-13 Thread Richard Sandiford
This patch adjusts a couple of cases in which we had established that two modes were equal and happened to be using the one with the more general type instead of the one with the more specific type. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/

[58/77] Use scalar_int_mode in a try_combine optimisation

2017-07-13 Thread Richard Sandiford
This patch uses scalar_int_modes for: /* If I2 is setting a pseudo to a constant and I3 is setting some sub-part of it to another constant, merge them by making a new constant. */ This was already implicit, but the danger with checking only CONST_SCALAR_INT_P is that it can include C

[60/77] Pass scalar_int_modes to do_jump_by_parts_*

2017-07-13 Thread Richard Sandiford
The callers of do_jump_by_parts_* had already established that the modes were MODE_INTs, so this patch passes the modes down as scalar_int_modes. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * dojump.c (do_jump_by_parts_greater_rtx): Change

[59/77] Add a rtx_jump_table_data::get_data_mode helper

2017-07-13 Thread Richard Sandiford
This patch adds a helper function to get the mode of the addresses or offsets in a jump table. It also changes the final.c code to use rtx_jump_table_data over rtx or rtx_insn in cases where it needed to use the new helper. This in turn meant adding a safe_dyn_cast equivalent of safe_as_a, to cop

[61/77] Use scalar_int_mode in the AArch64 port

2017-07-13 Thread Richard Sandiford
This patch makes the AArch64 port use scalar_int_mode in various places. Other ports won't need this kind of change; we only need it for AArch64 because of the variable-sized SVE modes. The only change in functionality is in the rtx_costs handling of CONST_INT. If the caller doesn't supply a mode

[62/77] Big machine_mode to scalar_int_mode replacement

2017-07-13 Thread Richard Sandiford
This patch changes the types of various things from machine_mode to scalar_int_mode, in cases where (after previous patches) simply changing the type is enough on its own. The patch does nothing other than that. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood

[63/77] Simplifications after type switch

2017-07-13 Thread Richard Sandiford
This patch makes a few simplifications after the previous mechanical machine_mode->scalar_int_mode change. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * expmed.c (extract_high_half): Use scalar_int_mode and remove assertion.

[64/77] Add a scalar_mode class

2017-07-13 Thread Richard Sandiford
This patch adds a scalar_mode class that can hold any scalar mode, specifically: - scalar integers - scalar floating-point values - scalar fractional modes - scalar accumulator modes - pointer bounds modes To start with this patch uses this type for GET_MODE_INNER. Later patches add mor

[65/77] Add a SCALAR_TYPE_MODE macro

2017-07-13 Thread Richard Sandiford
This patch adds a SCALAR_TYPE_MODE macro, along the same lines as SCALAR_INT_TYPE_MODE and SCALAR_FLOAT_TYPE_MODE. It also adds two instances of as_a to c_common_type, when converting an unsigned fixed-point SCALAR_TYPE_MODE to the equivalent signed mode. 2017-07-13 Richard Sandiford

[67/77] Use scalar_mode in fixed-value.*

2017-07-13 Thread Richard Sandiford
This patch makes the fixed-value.* routines use scalar_mode. It would be possible to define special classes for these modes, as for scalar_int_mode and scalar_float_mode, but at the moment nothing would benefit from them. In particular, there's no use case that would help select between one class

[66/77] Use scalar_mode for constant integers

2017-07-13 Thread Richard Sandiford
This patch treats the mode associated with an integer constant as a scalar_mode. We can't use the more natural-sounding scalar_int_mode because we also use (const_int 0) for bounds-checking modes. (It might be worth adding a bounds-specific code instead, but that's for another day.) This exposes

[68/77] Use scalar_mode for is_int_mode/is_float_mode pairs

2017-07-13 Thread Richard Sandiford
This patch uses scalar_mode for code that operates only on MODE_INT and MODE_FLOAT. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * omp-expand.c (expand_omp_atomic): Use is_int_mode, is_float_mode and scalar_mode. * tree-vect-

[71/77] Use opt_scalar_mode for mode iterators

2017-07-13 Thread Richard Sandiford
This patch uses opt_scalar_mode when iterating over scalar modes. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * coretypes.h (opt_scalar_mode): New typedef. * gdbhooks.py (build_pretty_printers): Handle it. * machmode.h (mode

[70/77] Make expand_fix/float check for scalar modes

2017-07-13 Thread Richard Sandiford
The expand_float code: /* Unsigned integer, and no way to convert directly. Convert as signed, then unconditionally adjust the result. */ and the expand_fix code: /* For an unsigned conversion, there is one more way to do it. If we have a signed conversion, we generate code that

[69/77] Split scalar-only part out of convert_mode

2017-07-13 Thread Richard Sandiford
This patch splits the final scalar-only part of convert_mode out into its own subroutine and treats the modes as scalar_modes there. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * expr.c (convert_mode): Split scalar handling out into...

[72/77] Pass scalar_mode to scalar_mode_supported_p

2017-07-13 Thread Richard Sandiford
This patch makes the scalar_mode_supported_p target hook take a scalar_mode rather than a machine_mode. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * target.def (scalar_mode_supported_p): Take a scalar_mode instead of a machine_mode

[74/77] Various small scalar_mode changes

2017-07-13 Thread Richard Sandiford
This patch uses scalar_mode in a few miscellaneous places: - Previous patches mean mode_to_vector can take a scalar_mode without further changes. - Implicit promotion is limited to scalar types (affects promote_mode and sdbout_parms) 2017-07-13 Richard Sandiford Alan Hayward

[73/77] Pass scalar_mode to scalar_mode_supported_p

2017-07-13 Thread Richard Sandiford
This patch makes the preferred_simd_mode target hook take a scalar_mode rather than a machine_mode. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * target.def (preferred_simd_mode): Take a scalar_mode instead of a machine_mode.

Re: [Patch][Aarch64] Refactor comments in aarch64_print_operand

2017-07-13 Thread James Greenhalgh
On Tue, Jul 11, 2017 at 05:29:11PM +0100, Jackson Woodruff wrote: > Hi all, > > This patch refactors comments in config/aarch64/aarch64.c > aarch64_print_operand > to provide a table of aarch64 specific formating options. > > I've tested the patch with a bootstrap and testsuite run on aarch64. >

[75/77] Use scalar_mode in the AArch64 port

2017-07-13 Thread Richard Sandiford
Similar to the previous scalar_int_mode patch. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * config/aarch64/aarch64-protos.h (aarch64_gen_adjusted_ldpstp): Take a scalar_mode rather than a machine_mode. (aarch64_operands_adj

[76/77] Add a scalar_mode_pod class

2017-07-13 Thread Richard Sandiford
This patch adds a scalar_mode_pod class and uses it to replace the machine_mode in fixed_value. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * coretypes.h (scalar_mode_pod): New typedef. * gdbhooks.py (build_pretty_printer): Handle i

[77/77] Add a complex_mode class

2017-07-13 Thread Richard Sandiford
This patch adds another machine_mode wrapper for modes that are known to be COMPLEX_MODE_P. There aren't yet many places that make use of it, but that might change in future. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * coretypes.h (compl

Re: [PATCH][RFA/RFC] Stack clash mitigation 0/9

2017-07-13 Thread Christophe Lyon
Hi Jeff, On 11 July 2017 at 23:19, Jeff Law wrote: > This patch series is designed to mitigate the problems exposed by the > stack-clash exploits. As I've noted before, the way to address this > class of problems is via a good stack probing strategy. > > This has taken much longer than expected

[ARM, VXworks] Fix build

2017-07-13 Thread Richard Earnshaw (lists)
My patch last week to address selection of be8 linking mode broke the build for vxworks. It turns out that this port is one of the few remaining that is still not based on the EABI/AAPCS. This patch fixes the build, but I've not really tested it beyond building the core compiler binaries. Buildi

Re: Add support to trace comparison instructions and switch statements

2017-07-13 Thread Wish Wu
Hi In my perspective: 1. Do we need to assign unique id for every comparison ? Yes, I suggest to implement it like -fsanitize-coverage=trace-pc-guard . Because some fuzzing targets may invoke dlopen() like functions to load libraries(modules) after fork(), while these libraries are compil

Re: [PATCH][RFA/RFC] Stack clash mitigation 0/9

2017-07-13 Thread Michael Matz
Hello, On Tue, 11 Jul 2017, Jeff Law wrote: > This patch series is designed to mitigate the problems exposed by the > stack-clash exploits. As I've noted before, the way to address this > class of problems is via a good stack probing strategy. > > This has taken much longer than expected to pul

RE: [Arm] Obsoleting Command line option -mstructure-size-boundary in eabi configurations

2017-07-13 Thread Michael Collison
Updated per Richard's comments and suggestions. Okay for trunk? 2017-07-10 Michael Collison * config/arm/arm.c (arm_option_override): Deprecate use of -mstructure-size-boundary. * config/arm/arm.opt: Deprecate -mstructure-size-boundary. * doc/invoke.texi: Depre

Re: Add support to trace comparison instructions and switch statements

2017-07-13 Thread Wish Wu
Hi In fact, under linux with "return address" and file "/proc/self/maps", we can give unique id for every comparison. For fuzzing, we may give 3 bits for every comparison as marker of if "<", "==" or ">" is showed. :D With Regards Wish Wu of Ant-financial Light-Year Security Lab On Thu, Jul 13,

Re: Add support to trace comparison instructions and switch statements

2017-07-13 Thread Dmitry Vyukov via gcc-patches
On Thu, Jul 13, 2017 at 12:41 PM, Wish Wu wrote: > Hi > > In fact, under linux with "return address" and file "/proc/self/maps", > we can give unique id for every comparison. Yes, it's doable. But you expressed worries about performance hit of merging callbacks for different sizes. Mapping pc + i

Re: [ping #4][patch] Fix PR80929: Realistic PARALLEL cost in seq_cost.

2017-07-13 Thread Georg-Johann Lay
On 12.07.2017 21:36, Segher Boessenkool wrote: On Wed, Jul 12, 2017 at 03:30:00PM +0200, Georg-Johann Lay wrote: On 12.07.2017 14:11, Segher Boessenkool wrote: On Tue, Jul 11, 2017 at 10:47:27AM +0200, Georg-Johann Lay wrote: This small addition improves costs of PARALLELs in rtlanal.c:seq_cos

Re: [PATCH][ARC] Add support for naked functions.

2017-07-13 Thread Andrew Burgess
* Claudiu Zissulescu [2017-06-19 11:52:31 +0200]: > From: claziss > > Hi Andrew, > > Apologizes for the disconfort, please find the patch that works on the head. > > Thanks, > Claudiu > > gcc/ > 2016-12-13 Claudiu Zissulescu > Andrew Burgess > > * config/arc/arc-pr

Re: [PATCH 4/7] [ARC] [LRA] Avoid emitting COND_EXEC during expand.

2017-07-13 Thread Andrew Burgess
* Claudiu Zissulescu [2017-06-01 15:34:54 +0200]: > Emmitting COND_EXEC rtxes during expand does not always work. > > gcc/ > 2017-01-10 Claudiu Zissulescu > > * config/arc/arc.md (clzsi2): Expand to an arc_clzsi2 instruction > that also clobbers the CC register. The old expand c

Re: [PATCH 5/7] [ARC] Enable indexed loads for elf targers.

2017-07-13 Thread Andrew Burgess
* Claudiu Zissulescu [2017-06-01 15:34:55 +0200]: > gcc/ > 2017-02-28 Claudiu Zissulescu > > * config/arc/arc.opt (mindexed-loads): Use initial value > TARGET_INDEXED_LOADS_DEFAULT. > (mauto-modify-reg): Use initial value > TARGET_AUTO_MODIFY_REG_DEFAULT. > * co

[PATCH] PR c++/80287 add new testcase

2017-07-13 Thread Yvan Roux
Hi, as discussed in the PR, this patch adds a new reduced testcase which doesn't rely on c++17 features, this is a prereq to the backport of the fix into GCC 6 branch which is impacted by this issue. Validated on x86, ARM and AArch64 targets. Ok for trunk ? and maybe on gcc-7-branch ? Thanks, Y

Re: [PATCH] Add quotes to error messages related to Sanitizers.

2017-07-13 Thread Martin Liška
On 07/11/2017 07:45 PM, David Malcolm wrote: > On Mon, 2017-07-10 at 11:36 +0200, Martin Liška wrote: >> Hi. >> >> This adds missing quotes to various error messages related to >> AddressSanitizer. >> Patch can bootstrap on ppc64le-redhat-linux and survives regression >> tests. >> >> Ready to be in

RE: [PATCH 4/7] [ARC] [LRA] Avoid emitting COND_EXEC during expand.

2017-07-13 Thread Claudiu Zissulescu
> This seems fine, your description "does not always work." is a bit > of a tease :) it would be nice to know _why_ it doesn't work, or at > least a description of what problem you're seeing. > As far as I can see, LRA doesn't handle very well the conditional execution patterns, as it expects

C++ PATCH to C++17 class deduction from init-list

2017-07-13 Thread Jason Merrill
P0512 corrected the specification of C++17 class template argument deduction to work more like constructor overload resolution in initialization; in particular, this means that we should do the same two-phase overload resolution for a class with a list constructor. This patch implements that, so th

  1   2   >