Age | Commit message (Collapse) | Author | Files | Lines |
|
Assumed-size dummy arguments accept arrays and array elements as actual
arguments. There are also a few exceptions when real scalars are permitted.
Since F2018, this includes scalar arguments to assumed-type dummies; while
type(*) was added in TS29113, this change is only in F2018 itself.
PR fortran/104143
gcc/fortran/ChangeLog:
* interface.cc (compare_parameter): Permit scalar args to
'type(*), dimension(*)'.
gcc/testsuite/ChangeLog:
* gfortran.dg/c-interop/c407b-2.f90: Remove dg-error.
* gfortran.dg/assumed_type_16.f90: New test.
* gfortran.dg/assumed_type_17.f90: New test.
|
|
gcc/fortran/ChangeLog:
PR fortran/106986
* simplify.cc (gfc_simplify_findloc): Do not try to simplify
intrinsic FINDLOC when the ARRAY argument has a NULL shape.
gcc/testsuite/ChangeLog:
PR fortran/106986
* gfortran.dg/pr106986.f90: New test.
|
|
gcc/fortran/ChangeLog:
PR fortran/106985
* expr.cc (gfc_simplify_expr): Avoid NULL pointer dereference.
gcc/testsuite/ChangeLog:
PR fortran/106985
* gfortran.dg/pr106985.f90: New test.
|
|
This adds some recently implemented C++20/23 library headers to the
xtreme-header tests as appropriate. Also, it looks like we can safely
re-add <execution> and remove the NO_ASSOCIATED_LAMBDA workaround.
gcc/testsuite/ChangeLog:
* g++.dg/modules/xtreme-header-2.h: Include <execution>.
* g++.dg/modules/xtreme-header-6.h: Include implemented
C++20 library headers.
* g++.dg/modules/xtreme-header.h: Likewise. Remove
NO_ASSOCIATED_LAMBDA workaround. Include implemented C++23
library headers.
|
|
The modules streaming code seems to rely on the invariant that a
TEMPLATE_DECL and its DECL_TEMPLATE_RESULT have the same TREE_TYPE.
But for a non-dependent VAR_DECL with deduced type, the two TREE_TYPEs
end up diverging: cp_finish_decl deduces the type of the initializer
ahead of time and updates the TREE_TYPE of the VAR_DECL, but neglects to
update the corresponding TEMPLATE_DECL as well, which leads to a
"conflicting global module declaration" error for each of the
__phase_alignment decls in the below testcase (and for the xtreme-header
tests if we try including <barrier>).
This patch makes cp_finish_decl update the TREE_TYPE of the corresponding
TEMPLATE_DECL so that the invariant is maintained.
gcc/cp/ChangeLog:
* decl.cc (cp_finish_decl): After updating the deduced type of a
VAR_DECL, also update the corresponding TEMPLATE_DECL if there
is one.
gcc/testsuite/ChangeLog:
* g++.dg/modules/auto-3.h: New test.
* g++.dg/modules/auto-3_a.H: New test.
* g++.dg/modules/auto-3_b.C: New test.
|
|
gcc/fortran/ChangeLog:
PR fortran/100132
* trans-types.cc (create_fn_spec): Fix function attributes when
passing polymorphic pointers.
gcc/testsuite/ChangeLog:
PR fortran/100132
* gfortran.dg/PR100132.f90: New test.
|
|
Undefined ranges have undefined NAN bits. We can't depend on them,
as they may contain garbage. This patch returns false from
maybe_isnan() for undefined ranges (the empty set).
gcc/ChangeLog:
* value-range.h (frange::maybe_isnan): Return false for
undefined ranges.
|
|
A specifically nonnegative range should not contain -NAN, otherwise
signbit_p() would return false, because we'd be unsure of the sign.
PR 68097/tree-optimization
gcc/ChangeLog:
* value-range.cc (frange::set_nonnegative): Set +NAN.
(range_tests_signed_zeros): New test.
* value-range.h (frange::update_nan): New overload to set NAN sign.
|
|
|
|
PR fortran/106636
gcc/fortran/ChangeLog:
* gfortran.texi: Add back link to ISO_VARYING_STRING.
|
|
It turns out that GTY(()) markers in definitions like:
GTY(()) tree scalar_types[NUM_VECTOR_TYPES];
are not effective and are silently ignored. The GTY(()) has
to come after an extern or static.
The externs associated with the SVE ACLE GTY variables are in
aarch64-sve-builtins.h. This file is not in tm_include_list because
we don't want every target-facing file to include it. It therefore
isn't in the list of GC header files either.
In this case that's a blessing in disguise, since the variables
belong to a namespace and gengtype doesn't understand namespaces.
I think the fix is instead to add an extra extern before each
variable declaration, similarly to varasm.cc and vtable-verify.cc.
(This works due to a "using namespace" at the end of the file.)
gcc/
PR target/106491
* config/aarch64/aarch64-sve-builtins.cc (scalar_types)
(acle_vector_types, acle_svpattern, acle_svprfop): Add GTY
markup to (new) extern declarations instead of to the main
definition.
|
|
PR106794 shows that I'd forgotten about masked loads when
doing the SLP layout changes. These loads can't currently
be permuted independently of their mask input, so during
construction they never get a load permutation.
(If we did support permuting masked loads in future, the mask
would need to be in the right order for the load, rather than in
the order implied by the result of the permutation. Since masked
loads can't be partly or fully scalarised in the way that normal
permuted loads can be, there's probably no benefit to fusing the
permutation and the load. Permutation after the fact is probably
good enough.)
gcc/
PR tree-optimization/106794
PR tree-optimization/106914
* tree-vect-slp.cc (vect_optimize_slp_pass::internal_node_cost):
Only consider loads that already have a permutation.
(vect_optimize_slp_pass::start_choosing_layouts): Assert that
loads with permutations are leaf nodes. Prevent any kind of grouped
access from changing layout if it doesn't have a load permutation.
gcc/testsuite/
* gcc.dg/vect/pr106914.c: New test.
* g++.dg/vect/pr106794.cc: Likewise.
|
|
While writing a testcase for PR106794, I noticed that we failed
to vectorise the testcase in the patch for SVE. The code that
recognises gather loads tries to optimise the point at which
the offset is calculated, to avoid unnecessary extensions or
truncations:
/* Don't include the conversion if the target is happy with
the current offset type. */
But breaking only makes sense if we're at an SSA_NAME (which could
then be vectorised). We shouldn't break on a conversion embedded
in a generic expression.
gcc/
* tree-vect-data-refs.cc (vect_check_gather_scatter): Restrict
early-out optimisation to SSA_NAMEs.
gcc/testsuite/
* gcc.dg/vect/vect-gather-5.c: New test.
|
|
PR tree-optimization/106970
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/pr106970.c: New test.
|
|
It looks like after the libstdc++ commit r13-2158-g02f6b405f0e9dc
some xtreme-header-* tests are failing with "conflicting global module
declaration" errors ultimately because we're neglecting to stream
PACK_EXPANSION_EXTRA_ARGS, which leads to wrong equivalences of
different partial instantiations of _TupleConstraints::__constructible.
PR c++/106761
gcc/cp/ChangeLog:
* module.cc (trees_out::type_node) <case TYPE_PACK_EXPANSION>:
Stream PACK_EXPANSION_EXTRA_ARGS.
(trees_in::tree_node) <case TYPE_PACK_EXPANSION>: Likewise.
gcc/testsuite/ChangeLog:
* g++.dg/modules/pr106761.h: New test.
* g++.dg/modules/pr106761_a.H: New test.
* g++.dg/modules/pr106761_b.C: New test.
|
|
gcc/ada/ChangeLog:
* exp_ch6.adb: Replace "the the" with "the".
* sem_ch6.adb: Likewise.
* sem_disp.ads: Likewise.
gcc/ChangeLog:
* ctfc.cc (ctf_add_string): Replace "the the" with "the".
* doc/md.texi: Likewise.
* gimple-range-infer.cc (non_null_loadstore): Likewise.
gcc/fortran/ChangeLog:
* gfortran.texi: Replace "the the" with "the".
gcc/testsuite/ChangeLog:
* g++.dg/warn/Wclass-memaccess.C: Replace "the the" with "the".
* g++.dg/warn/Wconversion-real-integer2.C: Likewise.
* gcc.target/powerpc/p9-extract-1.c: Likewise.
* gcc.target/s390/s390.exp: Likewise.
* gcc.target/s390/zvector/vec-cmp-2.c: Likewise.
* gdc.dg/torture/simd_store.d: Likewise.
* gfortran.dg/actual_array_offset_1.f90: Likewise.
* gfortran.dg/pdt_15.f03: Likewise.
* gfortran.dg/pointer_array_8.f90: Likewise.
|
|
|
|
PR fortran/106636
gcc/fortran/ChangeLog:
* gfortran.texi: Remove 2 dead links.
|
|
|
|
Here's list the patch supported.
rint/nearbyint/ceil/floor/trunc/lrint/lceil/lfloor/round/lround.
gcc/ChangeLog:
PR target/106910
* config/i386/mmx.md (nearbyintv2sf2): New expander.
(rintv2sf2): Ditto.
(ceilv2sf2): Ditto.
(lceilv2sfv2si2): Ditto.
(floorv2sf2): Ditto.
(lfloorv2sfv2si2): Ditto.
(btruncv2sf2): Ditto.
(lrintv2sfv2si2): Ditto.
(roundv2sf2): Ditto.
(lroundv2sfv2si2): Ditto.
(*mmx_roundv2sf2): New define_insn.
gcc/testsuite/ChangeLog:
* gcc.target/i386/pr106910-1.c: New test.
|
|
Enhance final_value_replacement_loop to handle bitop
with an invariant induction.
This patch will enable below optimization:
{
- long unsigned int bit;
-
- <bb 2> [local count: 32534376]:
-
- <bb 3> [local count: 1041207449]:
- # tmp_10 = PHI <tmp_7(5), tmp_4(D)(2)>
- # bit_12 = PHI <bit_8(5), 0(2)>
- tmp_7 = bit2_6(D) & tmp_10;
- bit_8 = bit_12 + 1;
- if (bit_8 != 32)
- goto <bb 5>; [96.97%]
- else
- goto <bb 4>; [3.03%]
-
- <bb 5> [local count: 1009658865]:
- goto <bb 3>; [100.00%]
-
- <bb 4> [local count: 32534376]:
- # tmp_11 = PHI <tmp_7(3)>
- return tmp_11;
+ tmp_11 = tmp_4 (D) & bit2_6 (D);
+ return tmp_11;
}
gcc/ChangeLog:
PR middle-end/105735
* tree-scalar-evolution.cc
(analyze_and_compute_bitop_with_inv_effect): New function.
(final_value_replacement_loop): Enhanced to handle bitop
with inv induction.
gcc/testsuite/ChangeLog:
* gcc.target/i386/pr105735-1.c: New test.
* gcc.target/i386/pr105735-2.c: New test.
|
|
Static PIE allows us to extend the ASLR to cover static executables and
it's not too difficult to support it. On GCC side, we just pass a group
of options to the linker, like other ports with static PIE support.
The real implementation of static PIE (rcrt1.o) will be added into Glibc
later.
gcc/ChangeLog:
* config/loongarch/gnu-user.h (GNU_USER_TARGET_LINK_SPEC): For
-static-pie, pass -static -pie --no-dynamic-linker -z text to
the linker, and do not pass --dynamic-linker.
|
|
For some architectures (or for -funsafe-math-optimizations) we may
flush denormals to zero, in which case we need to be careful to
extend the ranges to the appropriate zero. This patch does exactly that.
For a range of [x, -DENORMAL] we flush to [x, -0.0] and for [+DENORMAL, x]
we flush to [+0.0, x].
gcc/ChangeLog:
* value-range.cc (frange::flush_denormals_to_zero): New.
(frange::set): Call flush_denormals_to_zero.
* value-range.h (class frange): Add flush_denormals_to_zero.
|
|
For Skylake based processor, decoder is 4-way.
For Sunny Cove and Willow Cove, decoder is 5-way.
For Golden cove, decoder is 6-way.
gcc/ChangeLog:
* config/i386/x86-tune-sched.cc (ix86_issue_rate): Adjust for
latest Intel processors.
|
|
gcc/ChangeLog:
PR target/106887
* config/i386/i386-expand.cc (ix86_expand_vector_init_duplicate):
Fixed V16BF mode case.
gcc/testsuite/ChangeLog:
PR target/106887
* gcc.target/i386/vect-bfloat16-2c.c: New test.
|
|
|
|
A trivial fix for maybe_warn_for_null_address where we print an
inform note without first checking the return value of a warning
call.
PR c/106947
gcc/c/ChangeLog:
* c-typeck.cc (maybe_warn_for_null_address): Don't emit stray
notes.
gcc/testsuite/ChangeLog:
* c-c++-common/Waddress-7.c: New test.
|
|
The IEEE_MODES_TYPE type and the two functions that get and set it
were added in Fortran 2018. They can be implemented using the already
existing target-specific functions. A future optimization could, on
some targets, set/get all modes through one or two instructions only,
but that would need a new set of functions in all config/fpu-* files.
2022-09-04 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
libgfortran/
* ieee/ieee_exceptions.F90: Add IEEE_MODES_TYPE, IEEE_GET_MODES
and IEEE_SET_MODES.
* ieee/ieee_arithmetic.F90: Make them public in IEEE_ARITHMETIC
as well.
gcc/testsuite/
* gfortran.dg/ieee/modes_1.f90: New test.
|
|
When the -fzero-call-used-regs command line option is used with an
unsupported value, indicate that it's a value problem instead of an
option problem.
Without the patch, the error is:
In file included from gcc/testsuite/c-c++-common/zero-scratch-regs-8.c:5:
gcc/testsuite/c-c++-common/zero-scratch-regs-1.c: In function 'foo':
gcc/testsuite/c-c++-common/zero-scratch-regs-1.c:10:1: sorry, unimplemented: '-fzero-call-used-regs' not supported on this target
10 | }
| ^
With the patch, the error would be like this:
In file included from gcc/testsuite/c-c++-common/zero-scratch-regs-8.c:5:
gcc/testsuite/c-c++-common/zero-scratch-regs-1.c: In function 'foo':
gcc/testsuite/c-c++-common/zero-scratch-regs-1.c:10:1: sorry, unimplemented: argument 'all-arg' is not supported for '-fzero-call-used-regs' on this target
10 | }
| ^
2022-09-19 Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
gcc/ChangeLog:
* targhooks.cc (default_zero_call_used_regs): Improve sorry
message.
Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
|
|
Add the new IEEE_AWAY rounding mode. It is unsupported on all known
targets, but could be supported by glibc and AIX as part of the C2x
proposal. Testing for now is minimal.
Add the optional RADIX argument to IEEE_SET_ROUNDING_MODE and
IEEE_GET_ROUNDING_MODE. It is unused for now, because we do not
support radices other than 2.
2022-08-31 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
gcc/fortran/
* libgfortran.h: Declare GFC_FPE_AWAY.
gcc/testsuite/
* gfortran.dg/ieee/rounding_2.f90: New test.
libgfortran/
* ieee/ieee_arithmetic.F90: Add RADIX argument to
IEEE_SET_ROUNDING_MODE and IEEE_GET_ROUNDING_MODE.
* config/fpu-387.h: Add IEEE_AWAY mode.
* config/fpu-aarch64.h: Add IEEE_AWAY mode.
* config/fpu-aix.h: Add IEEE_AWAY mode.
* config/fpu-generic.h: Add IEEE_AWAY mode.
* config/fpu-glibc.h: Add IEEE_AWAY mode.
* config/fpu-sysv.h: Add IEEE_AWAY mode.
|
|
|
|
This patch moves GOMP_MAP_ATTACH{_ZERO_LENGTH_ARRAY_SECTION} nodes to
the end of the clause list, for offload regions. This ensures that when
we do the attach operation, both the "attachment point" and the target
region have both already been mapped on the target. This avoids a
pathological case that can otherwise happen with struct sibling-list
handling.
This version of the patch moves the attach-node motion to
gimplify_adjust_omp_clauses.
2022-09-15 Julian Brown <julian@codesourcery.com>
gcc/
* gimplify.cc (omp_segregate_mapping_groups): Update comment.
(gimplify_adjust_omp_clauses): Move ATTACH and
ATTACH_ZERO_LENGTH_ARRAY_SECTION nodes to the end of the clause list
for offloaded OpenMP regions.
gcc/testsuite/
* g++.dg/gomp/target-lambda-1.C: Adjust expected scan output.
|
|
We don't yet support vectorization on RISC-V.
gcc/testsuite/ChangeLog
* gcc.dg/tree-ssa/gen-vect-34.c: Skip RISC-V targets.
|
|
representations.
Long doubles are tricky when it comes to considering singletons
because small numbers and +-INF can have multiple representations for
the same number. So we need to be very careful not to treat those as
singletons, lest they be incorrectly propagated by VRP. This is
similar to the -0.0 and +0.0 duality.
In long doubles +INF can be represented with +INF in the MSB and
either -0.0 or +0.0 in the LSB. Similarly for numbers that are exactly
representable in DF. For example, 1.0 can be represented as either
(1.0, +0.0) or (1.0, -0.0).
This patch avoids treating these numbers as singletons.
Note that NANs in long double format have a LSB of don't care, but
this is irrelevant for singleton_p, because NANs are never considered
singletons. Also, internally in the frange we store NANs as a pair of
boolean flags indicating whether they are +NAN or -NAN, so we don't need
any special treatment here for comparing range equality etc. We never
see anything but the boolean flags.
PR middle-end/106831
gcc/ChangeLog:
* value-range.cc (frange::singleton_p): Avoid propagating long
doubles that may have multiple representations.
|
|
The attatched patch rewrites the NAN and sign handling, dropping both
tristates in favor of a pair of boolean flags for NANs, and nothing at
all for signs. The signs are tracked in the range itself, so now it's
possible to describe things like [-0.0, +0.0] +NAN, [+0, +0], [-5, +0],
[+0, 3] -NAN, etc.
Here is an example of the various ranges and how they are displayed:
[frange] float VARYING NAN ;; Varying includes NAN
[frange] UNDEFINED ;; Empty set as always
[frange] float [] +-NAN ;; Unknown sign NAN
[frange] float [] -NAN ;; -NAN
[frange] float [] +NAN ;; +NAN
[frange] float [-0.0, 0.0] ;; All zeros.
[frange] float [-0.0, -0.0] +-NAN ;; -0 or NAN.
[frange] float [-5.0e+0, -1.0e+0] +NAN ;; [-5, -1] or +NAN
[frange] float [-5.0e+0, -0.0] +-NAN ;; [-5, -0] or NAN
[frange] float [-5.0e+0, -0.0] ;; [-5, -0]
[frange] float [5.0e+0, 1.0e+1] ;; [5, 10]
Notice the NAN signs are decoupled from the range, so we can represent
a negative range with a positive NAN. For this range,
frange::signbit_p() would return false, as only when the signs of the
NANs and range agree can we be certain.
There is no longer any pessimization of ranges for intersects
involving NANs. Also, union and intersect work with signed zeros:
// [-0, x] U [+0, x] => [-0, x]
// [ x, -0] U [ x, +0] => [ x, +0]
// [-0, x] ^ [+0, x] => [+0, x]
// [ x, -0] ^ [ x, +0] => [ x, -0]
The special casing for signed zeros in the singleton code is gone in
favor of just making sure the signs in the range agree, that is
[-0, -0] for example.
I have removed the idea that a known NAN is a "range", so a NAN is no
longer in the endpoints itself. Requesting the bound of a known NAN
is a hard fail. For that matter, we don't store the actual NAN in the
range. The only information we have are the set of boolean flags.
This way we make sure nothing seeps into the frange. This also means
it's explicit that we don't track anything but the sign in NANs. We
can revisit this if we desire to track signalling or whatever
concoction y'all can imagine.
Regstrapped with mpfr tests on x86-64 and ppc64le Linux. Selftests
were also run with -ffinite-math-only on x86-64.
At Jakub's suggestion, I built lapack with associated tests. They
pass on x86-64 and ppc64le Linux with no regressions from mainline.
As a sanity check, I also ran them for -ffinite-math-only on x86 which
(as expected) returned:
NaN arithmetic did not perform per the ieee spec
Otherwise, all tests pass for -ffinite-math-only.
gcc/ChangeLog:
* range-op-float.cc (frange_add_zeros): Replace set_signbit with
union of zero.
* value-query.cc (range_query::get_tree_range): Remove set_signbit
use.
* value-range-pretty-print.cc (vrange_printer::print_frange_prop):
Remove.
(vrange_printer::print_frange_nan): New.
* value-range-pretty-print.h (print_frange_prop): Remove.
(print_frange_nan): New.
* value-range-storage.cc (frange_storage_slot::set_frange): Set
kind and NAN fields.
(frange_storage_slot::get_frange): Restore kind and NAN fields.
* value-range-storage.h (class frange_storage_slot): Add kind and
NAN fields.
* value-range.cc (frange::update_nan): Remove.
(frange::set_signbit): Remove.
(frange::set): Adjust for NAN fields.
(frange::normalize_kind): Remove m_props.
(frange::combine_zeros): New.
(frange::union_nans): New.
(frange::union_): Handle new NAN fields.
(frange::intersect_nans): New.
(frange::intersect): Handle new NAN fields.
(frange::operator=): Same.
(frange::operator==): Same.
(frange::contains_p): Same.
(frange::singleton_p): Remove special case for signed zeros.
(frange::verify_range): Adjust for new NAN fields.
(frange::set_zero): Handle signed zeros.
(frange::set_nonnegative): Same.
(range_tests_nan): Adjust tests.
(range_tests_signed_zeros): Same.
(range_tests_signbit): Same.
(range_tests_floats): Same.
* value-range.h (class fp_prop): Remove.
(FP_PROP_ACCESSOR): Remove.
(class frange_props): Remove
(frange::lower_bound): NANs don't have endpoints.
(frange::upper_bound): Same.
(frange_props::operator==): Remove.
(frange_props::union_): Remove.
(frange_props::intersect): Remove.
(frange::update_nan): New.
(frange::clear_nan): New.
(frange::undefined_p): New.
(frange::set_nan): New.
(frange::known_finite): Adjust for new NAN representation.
(frange::maybe_isnan): Same.
(frange::known_isnan): Same.
(frange::signbit_p): Same.
* gimple-range-fold.cc (range_of_builtin_int_call): Rename
known_signbit_p into signbit_p.
|
|
|
|
When -mfloat-abi=hard support was added, a cast went missing that
used to silence a warning in common code:
/usr/lib/gcc-snapshot/bin/g++ -fno-PIE -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -I../../gcc/gcc/../libcody -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/gcc/../libbacktrace -o builtins.o -MT builtins.o -MMD -MP -MF ./.deps/builtins.TPo ../../gcc/gcc/builtins.cc
In file included from ./tm.h:21,
from ../../gcc/gcc/backend.h:28,
from ../../gcc/gcc/builtins.cc:27:
../../gcc/gcc/builtins.cc: In function 'int apply_args_size()':
../../gcc/gcc/config/csky/csky.h:421:13: error: comparison of unsigned expression in '>= 0' is always true [-Werror=type-limits]
421 | (((REGNO) >= CSKY_FIRST_PARM_REGNUM \
../../gcc/gcc/builtins.cc:1444:13: note: in expansion of macro 'FUNCTION_ARG_REGNO_P'
1444 | if (FUNCTION_ARG_REGNO_P (regno))
| ^~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[1]: *** [Makefile:1146: builtins.o] Error 1
The needed (int) cast is even mentioned in the comment above, so reinstate
it here.
gcc/ChangeLog:
* config/csky/csky.h (FUNCTION_ARG_REGNO_P): Cast REGNO to (int)
to prevent warning.
|
|
A couple of xtreme-header-* modules tests began ICEing in C++23 mode
ever since r13-2650-g5d84a4418aa962 which introduced into <ranges> a
dependently scoped friend declaration:
friend /* typename */ _OuterIter::value_type;
This happens because the streaming code assumes a TYPE_P friend must
be a class type, but here it's a TYPENAME_TYPE, which doesn't have
a TEMPLATE_INFO or CLASSTYPE_BEFRIENDING_CLASSES. This patch tries
to correct this in a minimal way.
gcc/cp/ChangeLog:
* module.cc (friend_from_decl_list): Don't consider
CLASSTYPE_TEMPLATE_INFO for a TYPENAME_TYPE friend.
(trees_in::read_class_def): Don't add to
CLASSTYPE_BEFRIENDING_CLASSES for a TYPENAME_TYPE friend.
gcc/testsuite/ChangeLog:
* g++.dg/modules/typename-friend_a.C: New test.
* g++.dg/modules/typename-friend_b.C: New test.
|
|
As the following testcase reduced from glibc fmtmsg.c shows
(it doesn't ICE on x86_64/i686 unfortunately, but does on various other
arches), my last optimize_range_tests_cmp_bitwise change wasn't fully
correct. The intent was to let all pointer operands be cast to
pointer_sized_int_node first in addition to the other casts (to type1)
which are done for id >= l cases.
But one spot I've touched used always cast to type1 (note, the (b % 4) == 3
case is impossible for pointer operands because that is for !TYPE_UNSIGNED
operands and pointers are TYPE_UNSIGNED) and in the other spot the cast
would be done only for id >= l if not useless, but for pointers we need
to cast it always.
2022-09-17 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/106958
* tree-ssa-reassoc.cc (optimize_range_tests_cmp_bitwise): If
id >= l, cast op to type1, otherwise to pointer_sized_int_node.
If type has pointer type, cast exp to pointer_sized_int_node
even when id < l.
* gcc.c-torture/compile/pr106958.c: New test.
|
|
|
|
After https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=c17975d81aaed49ff759c20c68b31304a6953d58
the expected inlining in indir-call--prof-2.c test happens during afdo phase instead of einline.
This patch adjusts the test accordingly.
gcc/testsuite/ChangeLog:
* gcc.dg/tree-prof/indir-call-prof-2.c: Fix dg-final-use-autofdo.
|
|
This patch permits accessing 'mutable' members of local objects during
constexpr evaluation, while continuing to reject it for global objects
(as in the last line of cpp0x/constexpr-mutable1.C). To distinguish
between the two cases, it looks like it suffices to just check
CONSTRUCTOR_MUTABLE_POSION in cxx_eval_component_reference before
deciding to reject a DECL_MUTABLE_P member access.
PR c++/92505
gcc/cp/ChangeLog:
* constexpr.cc (cxx_eval_component_reference): Check non_constant_p
sooner. In C++14 or later, reject a DECL_MUTABLE_P member access
only if CONSTRUCTOR_MUTABLE_POISION is also set.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/constexpr-mutable3.C: New test.
* g++.dg/cpp1y/constexpr-mutable1.C: New test.
|
|
this-f names a member function, which isn't an addressable lvalue. Give a
helpful error instead of crashing. The first hunk makes the error range
cover the whole expression.
PR c++/106858
gcc/cp/ChangeLog:
* parser.cc (cp_parser_omp_var_list_no_open): Pass the
initial token location down.
* semantics.cc (finish_omp_clauses): Check
invalid_nonstatic_memfn_p.
* typeck.cc (invalid_nonstatic_memfn_p): Handle null TREE_TYPE.
gcc/testsuite/ChangeLog:
* g++.dg/gomp/map-3.C: New test.
|
|
For ifloor/lfloor/iceil/lceil/irint/lrint/iround/lround when size of
in_mode is not equal out_mode, vectorizer doesn't go to internal fn
way,still left that part in the ix86_builtin_vectorized_function.
Remove others builtins and add corresponding expanders.
gcc/ChangeLog:
PR target/106910
* config/i386/i386-builtins.cc
(ix86_builtin_vectorized_function): Modernized with
corresponding expanders.
* config/i386/sse.md (lrint<mode><sseintvecmodelower>2): New
expander.
(floor<mode>2): Ditto.
(lfloor<mode><sseintvecmodelower>2): Ditto.
(ceil<mode>2): Ditto.
(lceil<mode><sseintvecmodelower>2): Ditto.
(btrunc<mode>2): Ditto.
(lround<mode><sseintvecmodelower>2): Ditto.
(exp2<mode>2): Ditto.
|
|
|
|
gcc/fortran/ChangeLog:
PR fortran/106857
* simplify.cc (gfc_simplify_pack): Check for NULL pointer dereferences
while walking through constructors (error recovery).
gcc/testsuite/ChangeLog:
PR fortran/106857
* gfortran.dg/pr106857.f90: New test.
|
|
gcc/fortran/ChangeLog:
PR fortran/104314
* resolve.cc (deferred_op_assign): Do not try to generate temporary
for deferred character length assignment if types do not agree.
gcc/testsuite/ChangeLog:
PR fortran/104314
* gfortran.dg/pr104314.f90: New test.
Co-authored-by: Steven G. Kargl <kargl@gcc.gnu.org>
|
|
C2x has changed the rules for defining INFINITY in <float.h> so it is
no longer defined when float does not support infinities, instead of
being defined to an expression that overflows at translation time.
Thus, make the definition conditional on __FLT_HAS_INFINITY__ (this is
already inside a C2x-conditional part of <float.h>, because previous C
standard versions only had this macro in <math.h>).
Bootstrapped with no regressions for x86_64-pc-linux-gnu. Also did a
spot test of the case of no infinities supported by building cc1 for
vax-netbsdelf and testing compiling the new c2x-float-11.c test with
it.
gcc/
* ginclude/float.h (INFINITY): Define only if
[__FLT_HAS_INFINITY__].
gcc/testsuite/
* gcc.dg/c2x-float-2.c: Require inff effective-target.
* gcc.dg/c2x-float-11.c: New test.
|
|
PRE implicitely keeps virtual operands at the blocks incoming version
but the explicit updating point during PHI translation fails to trigger
when there are no PHIs at all in a block. Later lazy updating then
fails because of a too lose block check. A similar issues plagues
reference invalidation when checking the ANTIC_OUT to ANTIC_IN
translation. The following fixes both and makes the lazy updating
work.
The diagnostic testcase unfortunately requires boost so the
testcase is the one I reduced for a missed optimization in PRE.
The testcase fails with -m32 on x86_64 because we optimize too
much before PRE which causes PRE to not trigger so we fail to
eliminate a full redundancy. I'm going to open a separate bug
for this. Hopefully the !lp64 selector is good enough.
PR tree-optimization/106922
* tree-ssa-pre.cc (translate_vuse_through_block): Only
keep the VUSE if its def dominates PHIBLOCK.
(prune_clobbered_mems): Rewrite logic so we check whether
a value dies in a block when the VUSE def doesn't dominate it.
* g++.dg/tree-ssa/pr106922.C: New testcase.
|
|
All frontends replicate this, so move it.
gcc/
* tree.cc (build_common_tree_nodes): Initialize void_list_node
here.
gcc/ada/
* gcc-interface/trans.cc (gigi): Do not initialize void_list_node.
gcc/c-family/
* c-common.h (build_void_list_node): Remove.
* c-common.cc (c_common_nodes_and_builtins): Do not initialize
void_list_node.
gcc/c/
* c-decl.cc (build_void_list_node): Remove.
gcc/cp/
* decl.cc (cxx_init_decl_processing): Inline last
build_void_list_node call.
(build_void_list_node): Remove.
gcc/d/
* d-builtins.cc (d_build_c_type_nodes): Do not initialize
void_list_node.
gcc/fortran/
* f95-lang.cc (gfc_init_decl_processing): Do not initialize
void_list_node.
gcc/go/
* go-lang.cc (go_langhook_init): Do not initialize
void_list_node.
gcc/jit/
* dummy-frontend.cc (jit_langhook_init): Do not initialize
void_list_node.
gcc/lto/
* lto-lang.cc (lto_build_c_type_nodes): Do not initialize
void_list_node.
|