After r12-4432-g7bfe7d634f60b0a9 Darwin fails to bootstrap with D
enabled since there is no definition of either DWARF2_DEBUG_INFO or
PREFERRED_DEBUGGING_TYPE.
Fixed here by adding the tm-dwarf2.h file to tm_d_file for Darwin.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/ChangeLog:
* config.gcc: Add tm-dwarf2.h to tm_d-file.
* gimple-range-fold.h (gimple_range_ssa_p): Don't process names
that occur in abnormal phis.
* gimple-range.cc (gimple_ranger::range_on_edge): Return false for
abnormal and EH edges.
* gimple-ssa-evrp.c (rvrp_folder::value_of_expr): Ditto.
(rvrp_folder::value_on_edge): Ditto.
(rvrp_folder::value_of_stmt): Ditto.
(hybrid_folder::value_of_expr): Ditto for ranger queries.
(hybrid_folder::value_on_edge): Ditto.
(hybrid_folder::value_of_stmt): Ditto.
* value-query.cc (gimple_range_global): Always return a range if
the type is supported.
I've noticed that while I have added hopefully sufficient test coverage
for the case where one uses simple number or !number as p-interval,
I haven't added any coverage for number:len:stride or number:len.
This patch adds that.
2021-10-15 Jakub Jelinek <jakub@redhat.com>
* testsuite/libgomp.c/affinity-1.c (struct places): Change name field
type from char [50] to const char *.
(places_array): Add a testcase for simplified syntax place followed
by length or length and stride.
2021-10-15 John David Anglin <danglin@gcc.gnu.org>
gcc/ChangeLog:
* config/pa/pa.md: Consistently use "rG" constraint for copy
instruction in move patterns.
In addition to adding ll_caches and numa_domain abstract names
to OMP_PLACES syntax, OpenMP 5.1 also added one syntax simplification:
https://github.com/OpenMP/spec/issues/2080https://github.com/OpenMP/spec/pull/2081
in particular that in the grammar place non-terminal is now
not only { res-list } but also res (i.e. a non-negative integer),
which stands as a shortcut for { res }
So, one can specify OMP_PLACES=0,4,8,12 with the meaning
OMP_PLACES={0},{4},{8},{12} or OMP_PLACES=0:4 instead of OMP_PLACES={0}:4
or OMP_PLACES={0},{1},{2},{3} etc.
This patch implements that.
2021-10-15 Jakub Jelinek <jakub@redhat.com>
* env.c (parse_one_place): Handle non-negative-number the same
as { non-negative-number }. Reject even !number:1 and
!number:1:stride or !place:1 or !place:1:stride instead of just
length other than 1.
* libgomp.texi (OpenMP 5.1): Document OMP_PLACES syntax extensions
and OMP_NUM_TEAMS/OMP_TEAMS_THREAD_LIMIT and
omp_{set_num,get_max}_teams/omp_{s,g}et_teams_thread_limit features
as implemented.
* testsuite/libgomp.c/affinity-1.c: Add a test for the 5.1 place
simplified syntax.
Yesterday when working on numa_domains, I've noticed because of a bug
in my patch a hang on a large NUMA machine. I've fixed the bug, but
also discovered that the hang was a result of making wrong assumptions
about strtoul/strtoull. All the uses were for portability setting
errno = 0 before the calls and treating non-zero errno after the call
as invalid input, but for the case where there are no valid digits at
all strtoul may set errno to EINVAL, but doesn't have to and with
glibc doesn't do that. So, this patch goes through all the strtoul calls
and next to errno != 0 checks adds also endptr == startptr check.
Haven't done it in places where we immediately reject strtoul returning 0
the same as we reject errno != 0, because strtoul must return 0 in the
case where it sets endptr to the start pointer. In some spots the code
was using errno = 0; x = strtoul (p, &p, 10); if (errno) { /*invalid*/ }
and those spots had to be changed to
errno = 0; x = strtoul (p, &end, 10); if (errno || end == p) { /*invalid*/ }
p = end;
2021-10-15 Jakub Jelinek <jakub@redhat.com>
* env.c (parse_schedule): For strtoul or strtoull calls which don't
clearly reject return value 0 as invalid handle the case where end
pointer is the same as first argument as invalid.
(parse_unsigned_long_1): Likewise.
(parse_one_place): Likewise.
(parse_places_var): Likewise.
(parse_stacksize): Likewise.
(parse_spincount): Likewise.
(parse_affinity): Likewise.
(parse_gomp_openacc_dim): Likewise. Avoid strict aliasing violation.
Make code valid C89.
* config/linux/affinity.c (gomp_affinity_find_last_cache_level):
For strtoul calls which don't clearly reject return value 0 as
invalid handle the case where end pointer is the same as first
argument as invalid.
(gomp_affinity_init_level_1): Likewise.
(gomp_affinity_init_numa_domains): Likewise.
* config/rtems/proc.c (parse_thread_pools): Likewise.
When writing the places-*.c tests, I've noticed that we mishandle threads
abstract name with specified num-places if num-places isn't a multiple of
number of hw threads in a core. It then happily ignores the maximum count
and overwrites for the remaining hw threads in a core further places that
haven't been allocated.
2021-10-15 Jakub Jelinek <jakub@redhat.com>
* config/linux/affinity.c (gomp_affinity_init_level_1): For level 1
after creating count places clean up and return immediately.
* testsuite/libgomp.c/places-6.c: New test.
* testsuite/libgomp.c/places-7.c: New test.
* testsuite/libgomp.c/places-8.c: New test.
* testsuite/libgomp.c/places-9.c: New test.
* testsuite/libgomp.c/places-10.c: New test.
Between LLVM 9 and LLVM 13 the attribute works differently in several ways,
and this needs to be allowed for in GCC and mkoffload independently.
This patch fixes up mkoffload when debug info is enabled, which is made more
complicated because the configure tests checks whether the attribute option
is accepted silently, but does not check if the assembler actually sets the
ELF flags for that attribute, and mkoffload needs to mimick that behaviour
exactly. The patch therefore removes some of the conditionals.
gcc/ChangeLog:
* config/gcn/gcn-hsa.h (S_FIJI): Set unconditionally.
(S_900): Likewise.
(S_906): Likewise.
* config/gcn/gcn.c: Hard code SRAM ECC settings for old architectures.
* config/gcn/mkoffload.c (ELFABIVERSION_AMDGPU_HSA): Rename to ...
(ELFABIVERSION_AMDGPU_HSA_V3): ... this.
(ELFABIVERSION_AMDGPU_HSA_V4): New.
(SET_SRAM_ECC_UNSUPPORTED): New.
(copy_early_debug_info): Create elf flags to match the other objects.
(main): Just let the attribute flags pass through.
While determining the precission of reduction_var an SSA_NAME instead of
its TREE_TYPE is used. Streamlined with other TREE_TYPE (reduction_var)
uses.
gcc/ChangeLog:
* tree-loop-distribution.c (reduction_var_overflows_first):
Pass the type of reduction_var as first argument as it is also
done for the load type.
(loop_distribution::transform_reduction_loop): Add missing
TREE_TYPE while determining precission of reduction_var.
This test is failing on ppc64* due to different default signness for
chars.
Tested on x86-64 Linux and ppc64le Linux.
PR testsuite/pr102751
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/pr102736.c: Make sign explicit.
This adds support for numa_domains abstract name in OMP_PLACES, also new
in OpenMP 5.1.
Way to test this is
OMP_PLACES=numa_domains OMP_DISPLAY_ENV=true LD_PRELOAD=.libs/libgomp.so.1 /bin/true
and see what it prints on OMP_PLACES line.
For non-NUMA machines it should print a single place that covers all CPUs,
for NUMA machine one place for each NUMA node with corresponding CPUs.
2021-10-15 Jakub Jelinek <jakub@redhat.com>
* env.c (parse_places_var): Handle numa_domains as level 5.
* config/linux/affinity.c (gomp_affinity_init_numa_domains): New
function.
(gomp_affinity_init_level): Use it instead of
gomp_affinity_init_level_1 for level == 5.
* testsuite/libgomp.c/places-5.c: New test.
This patch implements support for ll_caches abstract name in OMP_PLACES,
which stands for places where logical cpus in each place share the last
level cache.
This seems to work fine for me on x86 and kernel sources show that it is
in common code, but on some machines on CompileFarm the files I'm using,
i.e.
/sys/devices/system/cpu/cpuN/cache/indexN/level
/sys/devices/system/cpu/cpuN/cache/indexN/shared_cpu_list
don't exist, is that because they have too old kernel and newer kernels
are fine or should I implement some fallback methods (which)?
E.g. on gcc112.fsffrance.org I see just shared_cpu_map and not shared_cpu_list
(with shared_cpu_map being harder to parse) and on another box I didn't even
see the cache subdirectories.
Way to test this is
OMP_PLACES=ll_caches OMP_DISPLAY_ENV=true LD_PRELOAD=.libs/libgomp.so.1 /bin/true
and see what it prints on OMP_PLACES line.
2021-10-15 Jakub Jelinek <jakub@redhat.com>
* env.c (parse_places_var): Handle ll_caches as level 4.
* config/linux/affinity.c (gomp_affinity_find_last_cache_level): New
function.
(gomp_affinity_init_level_1): Handle level 4 as logical cpus sharing
last level cache.
(gomp_affinity_init_level): Likewise.
* testsuite/libgomp.c/places-1.c: New test.
* testsuite/libgomp.c/places-2.c: New test.
* testsuite/libgomp.c/places-3.c: New test.
* testsuite/libgomp.c/places-4.c: New test.
This makes defaults.h choose DWARF2_DEBUG if PREFERRED_DEBUGGING_TYPE
is not specified by the target and errors out if DWARF DWARF is not supported.
It also makes us warn when STABS is enabled but not the preferred
debugging type and removes the corresponding diagnostic from the Ada frontend.
The warnings are pruned from the testsuite output via prune_gcc_output.
The following target configurations now explicitely default to STABS:
pdp11-*-* pdp11 is a.out, dwarf support is difficult
hppa[12]*-*-hpux10* does not support DWARF
hppa[12]*-*-hpux11* likewise
note that the hppa configs have been deprecated.
Targets with DWARF support will now see
> ./cc1 -quiet t.c -gstabs
t.c: warning: STABS debugging information is obsolete and not supported anymore
that is, -gstabs will still generate STABS but use will be diagnosed
on targets where DWARF is available.
I have built all targets from contrib/config-list.mk to make sure we
don't run into the #error and the following makes the STABS usage
explicit for pdp11 and hppa with SOM.
This completes the series of deprecating STABS for GCC 12.
2021-09-21 Richard Biener <rguenther@suse.de>
gcc/
* defaults.h (PREFERRED_DEBUGGING_TYPE): Choose DWARF2_DEBUG
when not set.
* toplev.c (process_options): Warn when STABS debugging is
enabled but not the preferred format.
* config/pa/som.h (PREFERRED_DEBUGGING_TYPE): Define to
DBX_DEBUG.
* config/pdp11/pdp11.h (PREFERRED_DEBUGGING_TYPE): Likewise.
gcc/ada/
* gcc-interface/misc.c (gnat_post_options): Do not warn
about DBX_DEBUG use here.
gcc/testsuite/
* lib/prune.exp: Prune STABS obsoletion message.
This fixes an ICE for the failure to verify we're dereferencing a
pointer before throwing that at build_simple_mem_ref.
2021-10-15 Richard Biener <rguenther@suse.de>
PR c/102763
gcc/c/
* gimple-parser.c
(c_parser_gimple_postfix_expression_after_primary): Check
for a pointer do be dereferenced by ->.
gcc/testsuite/
* gcc.dg/gimplefe-error-12.c: New testcase.
We have to be careful to not break the argument space calculation.
If there's not enough arguments just do not append any.
2021-10-15 Richard Biener <rguenther@suse.de>
PR ipa/102762
* tree-inline.c (copy_bb): Avoid underflowing nargs.
* gcc.dg/torture/pr102762.c: New testcase.
The following avoids generating
(insn 6 5 7 2 (set (subreg:OI (concatn/v:TI [
(reg:DI 92 [ buffer ])
(reg:DI 93 [ buffer+8 ])
]) 0)
(subreg:OI (reg/v:V8SI 85 [ __x ]) 0)) "t.ii":76:21 74 {*movoi_internal_avx}
(nil))
via store_bit_field_1 when we try to store excess data into
a register allocated temporary. The case was supposed to
/* Use the subreg machinery either to narrow OP0 to the required
words...
but the check ensured only an register-aligned but not a large
enough piece. The following adds such missed check which ends up
decomposing the set to
(insn 6 5 7 (set (subreg:DI (reg/v:TI 84 [ buffer ]) 0)
(subreg:DI (reg/v:V8SI 85 [ __x ]) 0)) "t.ii":76:21 -1
(nil))
(insn 7 6 0 (set (subreg:DI (reg/v:TI 84 [ buffer ]) 8)
(subreg:DI (reg/v:V8SI 85 [ __x ]) 8)) "t.ii":76:21 -1
(nil))
2021-10-11 Richard Biener <rguenther@suse.de>
PR middle-end/102682
* expmed.c (store_bit_field_1): Ensure a LHS subreg would
not create a paradoxical subreg.
For V4HFmode, doing vector concat like
__builtin_shufflevector (a, b, {0, 1, 2, 3, 4, 5, 6, 7})
could trigger ICE since it is not handled in ix86_vector_init ().
Handle HFmode like HImode to avoid such ICE.
gcc/ChangeLog:
* config/i386/i386-expand.c (ix86_expand_vector_init):
For half_vector concat for HFmode, handle them like HImode.
gcc/testsuite/ChangeLog:
* gcc.target/i386/avx512fp16-v4hf-concat.c: New test.
I've been experimenting with a change to make all inline functions
implicitly constexpr; this revealed that we are instantiating too
aggressively for speculative constant evaluation, leading to ordering
difficulties with e.g. is_a_helper<cgraph_node*>::test. This patch tries to
avoid such instantiation until we actually need the function definition to
determine whether a call is constant, by limiting the initial instantiation
of all used functions to manifestly-constant-evaluated expressions, and
checking whether the function arguments are constant before instantiating
the function.
This change resulted in a change in the diagnostics for a few library tests
due to instantiating the function with the static_assert later (during
constant evaluation) than we did before (during instantiation of the
intermediate function).
gcc/cp/ChangeLog:
* constexpr.c (cxx_bind_parameters_in_call): Replace
new_call parameter with fun.
(cxx_eval_call_expression): Call it before instantiation.
(cxx_eval_outermost_constant_expr): Only instantiate fns
when manifestly_const_eval.
* typeck2.c (check_narrowing): This context is manifestly
constant-evaluated.
libstdc++-v3/ChangeLog:
* testsuite/20_util/integer_comparisons/greater_equal_neg.cc:
* testsuite/20_util/integer_comparisons/greater_neg.cc:
* testsuite/20_util/integer_comparisons/less_equal_neg.cc:
Adjust expected message.
* testsuite/lib/prune.exp: Prune 'in constexpr expansion'.
gcc/testsuite/ChangeLog:
* g++.dg/ext/vla22.C: Don't expect a narrowing error.
* g++.dg/cpp0x/constexpr-inst1.C: New test.
The path solver runs in two modes: a quick mode which assumes any unknown
SSA names are VARYING, and a fully resolving mode using the ranger.
The backward threader currently uses the quick mode, because the fully
resolving mode was not available initially. Since we now have the ability
in the solver (used by the hybrid threader), I thought it'd be useful to
have the knob for when the time comes.
Note that enabling the fully resolving mode will require some experimenting,
as enabling it would likely render other jump threading passes irrelevant
(VRP threading comes to mind).
There should be no functional changes as the resolver is set to false.
Tested on x86-64 Linux.
gcc/ChangeLog:
* tree-ssa-threadbackward.c (class back_threader): Add m_resolve.
(back_threader::back_threader): Same.
(back_threader::resolve_phi): Try to solve without looking back if
possible.
(back_threader::find_paths_to_names): Same.
(try_thread_blocks): Pass resolve argument to back threader.
(pass_early_thread_jumps::execute): Same.
The new backward threader makes some of the --param knobs used to
control it questionable at best or no longer applicable at worst.
The fsm-maximum-phi-arguments param is unused and can be removed.
The max-fsm-thread-length param is block based which is a bit redundant,
since we already restrict paths based on instruction estimates.
The max-fsm-thread-paths restricts the total number of threadable paths
in a function. We probably don't need this. Besides, the forward
threader has no such restriction.
Tested on x86-64 Linux.
gcc/ChangeLog:
* doc/invoke.texi: Remove max-fsm-thread-length,
max-fsm-thread-paths, and fsm-maximum-phi-arguments.
* params.opt: Same.
* tree-ssa-threadbackward.c (back_threader::back_threader): Remove
argument.
(back_threader_registry::back_threader_registry): Same.
(back_threader_profitability::profitable_path_p): Remove
param_max_fsm_thread-length.
(back_threader_registry::register_path): Remove
m_max_allowable_paths.
Tested on x86-64 Linux.
gcc/ChangeLog:
* tree-ssa-threadbackward.c (class back_threader): Make m_imports
an auto_bitmap.
(back_threader::~back_threader): Do not release m_path.
libstdc++-v3/ChangeLog:
* include/std/variant (__variant::__get(in_place_index_t<N>, U&&)):
Rename to __get_n and remove first argument. Replace pair of
overloads with a single function using 'if constexpr'.
(__variant::__get(Variant&&)): Adjust to use __get_n.
Since r12-4065 std::basic_string is always nothrow-move-constructible,
so filesystem::path is too.
That also means that path::_S_convert(T) is noexcept when returning its
argument, because T is either a basci_string or basic_string_view, and
will be moved into the return value.
libstdc++-v3/ChangeLog:
* include/bits/fs_path.h (path(path&&)): Make unconditionally
noexcept.
(path::_S_convert(T)): Add condtional noexcept.
When I enabled various decimal floating-point features for C2X /
stopped them being diagnosed with -pedantic for C2X, I missed the
format checking support. The DFP printf and scanf formats are
included in C2X. Thus, adjust the data for those formats so that they
are no longer diagnosed with -std=c2x -Wformat -pedantic.
Bootstrapped with no regressions for x86_64-pc-linux-gnu.
gcc/c-family/
* c-format.c (printf_length_specs, scanf_length_specs)
(print_char_table, scan_char_table): Support DFP formats for C2X.
* c-format.h (TEX_D32, TEX_D64, TEX_D128): Remove.
(T2X_D32, T2X_D64, T2X_D128): New macros.
gcc/testsuite/
* gcc.dg/format/c11-dfp-printf-1.c,
gcc.dg/format/c11-dfp-scanf-1.c, gcc.dg/format/c2x-dfp-printf-1.c,
gcc.dg/format/c2x-dfp-scanf-1.c: New tests.
Without dwarf2 unwind tables available _Unwind_Backtrace() is not
able to return the full backtrace.
This patch adds a fallback function on powerpc to get the backtrace
by doing a backchain, this code was originally at glibc.
libgcc/ChangeLog:
* config/rs6000/linux-unwind.h (struct rt_sigframe): Move it to
outside of get_regs() in order to use it in another function, this
is done twice: for __powerpc64__ and for !__powerpc64__.
(struct trace_arg): New struct.
(struct layout): New struct.
(ppc_backchain_fallback): New function.
* unwind.inc (_Unwind_Backtrace): Look for _URC_NORMAL_STOP code
state and call MD_BACKCHAIN_FALLBACK.
gcc/testsuite/ChangeLog:
* gcc.target/powerpc/unwind-backchain.c: New test.
gcc/fortran/ChangeLog:
PR fortran/102717
* simplify.c (gfc_simplify_reshape): Replace assert by error
message for negative elements in SHAPE array.
gcc/testsuite/ChangeLog:
PR fortran/102717
* gfortran.dg/reshape_shape_2.f90: New test.
gcc/fortran/ChangeLog:
PR fortran/102716
* check.c (gfc_check_shape): Reorder checks so that invalid KIND
arguments can be detected.
gcc/testsuite/ChangeLog:
PR fortran/102716
* gfortran.dg/shape_10.f90: New test.
When the first operand of a signed right shift is zero or negative one, the
RHS doesn't matter and the shift can be converted to a copy.
PR tree-optimization/102738
gcc/
* vr-values.c (simplify_using_ranges::simplify): Handle RSHIFT_EXPR.
gcc/testsuite
* gcc.dg/pr102738.c: New.
rs6000_density_test has an early exit test between a call
to get_loop_body and the corresponding free. This would
lead to a memory leak if the early exit is taken.
gcc/
* config/rs6000/rs6000.c (rs6000_density_test): Move early
exit test further up the function.
The arm implementation of add_stmt_cost was added alongside
arm_builtin_vectorization_cost. At that time it was necessary
to override the latter when overriding the former, since
default_add_stmt_cost didn't indirect through the
builtin_vectorization_cost target hook:
int stmt_cost = default_builtin_vectorization_cost (kind, vectype,
misalign);
That was fixed by:
| 2014-06-06 Bingfeng Mei <bmei@broadcom.com>
|
| * targhooks.c (default_add_stmt_cost): Call target specific
| hook instead of default one.
so the arm definition of add_stmt_cost is now equivalent
to the default.
gcc/
* config/arm/arm.c (arm_add_stmt_cost): Delete.
(TARGET_VECTORIZE_ADD_STMT_COST): Delete.
Martin Liška has noticed that I forgot to document the recently added
parameter in the invoke.texi documentation. This patch fixes it.
Tested by running make info and make pdf and examining the output.
gcc/ChangeLog:
2021-10-14 Martin Jambor <mjambor@suse.cz>
* doc/invoke.texi (Optimize Options): Add entry for
ipa-cp-recursive-freq-factor.
This function was supposed to check whether the parameter's value type
is the same as path::value_type, and therefore needs no conversion.
Instead it checks whether the parameter is the same as its own value
type, which is never true. This means we incorrectly return a string
view for the case where T is path::string_type, instead of just
returning the string itself. The only place that happens is
path::_S_convert_loc for Windows, where we call _S_convert with a
std::wstring rvalue.
This fixes the condition in _S_convert(T).
libstdc++-v3/ChangeLog:
PR libstdc++/102743
* include/bits/fs_path.h (path::_S_convert(T)): Fix condition
for returning the same string unchanged.
The out-of-class definitions of the static constants are redundant if
the __cpp_inline_variables feature is supported, so use that macro to
decide whether to define them or not.
libstdc++-v3/ChangeLog:
* include/bits/regex.h: Check __cpp_inline_variables instead of
__cplusplus.
The following loop does a conditional reduction using an add:
#include <stdint.h>
int32_t f (int32_t *restrict array, int len, int min)
{
int32_t iSum = 0;
for (int i=0; i<len; i++) {
if (array[i] >= min)
iSum += array[i];
}
return iSum;
}
for this we currently generate:
mov z1.b, #0
mov z2.s, w2
mov z3.d, z1.d
ptrue p2.b, all
ld1w z0.s, p0/z, [x0, x3, lsl 2]
cmpge p1.s, p2/z, z0.s, z2.s
add x3, x3, x4
sel z0.s, p1, z0.s, z3.s
add z1.s, p0/m, z1.s, z0.s
whilelo p0.s, w3, w1
where the SEL is unneeded as it's selecting between 0 or a value. This can be
optimized to just doing the conditional add on p1 instead of p0. After this
patch we generate:
mov z2.s, w2
mov z0.b, #0
ptrue p1.b, all
ld1w z1.s, p0/z, [x0, x3, lsl 2]
cmpge p0.s, p0/z, z1.s, z2.s
add x3, x3, x4
add z0.s, p0/m, z0.s, z1.s
whilelo p0.s, w3, w1
and so we drop the SEL and the 0 move.
gcc/ChangeLog:
* match.pd: New rule.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/sve/pred-cond-reduc.c: New test.
gcc/ChangeLog:
PR ipa/102557
* ipa-modref-tree.h (modref_access_node::update2):
Also check that parm_offset is unchanged.
(modref_ref_node::insert_access): Fix updating of
parameter.
There's a limitation in the path discovery bits in the backward
threader that I ran into recently and I'd like to document it so we
don't lose track of it.
Basically we stop looking if we find a threadable path through a PHI,
without taking into account that there could be multiple
paths through a PHI that resolve the path. For example:
x_5 = PHI <10(4), 20(5), ...>
if (x_5 > 5)
I don't remember how we ended up skipping this, but it could existing
behavior from the old bits. It probably skipped multiple threads
through a PHI since the generic copier couldn't re-using existing
threading paths anyhow.
Documenting for later fixing.
gcc/ChangeLog:
* tree-ssa-threadbackward.c (back_threader::resolve_phi): Add
FIXME note.
This plugs the remaining hole of POINTER_PLUS_EXPR with undefined
overflow. Unfortunately we have to go through some lengths to
not put invariant conversions into the loop body since that confuses
the vectorizers gather/scatter discovery which relies on identifying
an invariant component of plus and minus expressions. We can
emit those in the loop preheader but then we have to accept that
being non-empty when looking for the LOOP_VECTORIZED internal
function call in the vectorizer.
2021-10-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/102659
* tree-if-conv.c (if_convertible_gimple_assign_stmt_p): Also
rewrite pointer typed undefined overflow operations.
(predicate_statements): Likewise. Make sure to emit invariant
conversions in the preheader.
* tree-vectorizer.c (vect_loop_vectorized_call): Look through
non-empty preheaders.
* tree-data-ref.c (dr_analyze_indices): Strip useless
conversions to the MEM_REF base type.
gcc/ChangeLog:
* common.opt: Stop using AUTODETECT_VALUE
and use EnabledBy where possible.
* opts.c: Enable OPT_fvar_tracking with optimize >= 1.
* toplev.c (AUTODETECT_VALUE): Remove macro.
(process_options): Simplify by using EnabledBy and
OPT_fvar_tracking. Use OPTION_SET_P macro instead of
AUTODETECT_VALUE.
The pointer parameter to load a vector of signed values should itself
be a signed type. This patch fixes two instances of this unsigned-
signed implicit conversion in arm_neon.h.
gcc/ChangeLog:
2021-10-14 Jonathan Wright <jonathan.wright@arm.com>
* config/aarch64/arm_neon.h (vld1_s8_x3): Use signed type for
pointer parameter.
(vld1_s32_x3): Likewise.
In the path solver, when requesting the range of an SSA for which we
know nothing, we ask the ranger for the range incoming to the path.
We do this by asking for all the incoming ranges to the path entry
block and unioning them.
The problem here is that we're asking for a range on path entry for an
SSA which *is* defined in the path, but for which we know nothing
about:
some_global.1_2 = some_global;
_3 = (char) some_global.1_2;
This request is causing us to ask for range_on_edge of _3 on the
incoming edges to the path. This is a bit of nonsensical request
because _3 isn't live on entry to the path, so ranger correctly
returns UNDEFINED. The proper thing is to avoid asking this in the
first place.
I have added a relevant assert, since it doesn't make sense to call
range_on_path_entry for SSAs defined within the path.
Tested on x86-64 Linux.
PR tree-optimization/102736
gcc/ChangeLog:
PR tree-optimization/102736
* gimple-range-path.cc (path_range_query::range_on_path_entry):
Assert that the requested range is defined outside the path.
(path_range_query::ssa_range_in_phi): Do not call
range_on_path_entry for SSA names that are defined within the
path.
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/pr102736.c: New test.