]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
3 years agofortran: Backport associate character length fixes [PR104228]
Mikael Morin [Fri, 28 Jan 2022 21:00:57 +0000 (22:00 +0100)] 
fortran: Backport associate character length fixes [PR104228]

Backport commits:
r12-7217-g57da34939703a6e6d3267a0d25d1fb9369d3ac0e
r12-7726-g907811ddc35da6c1701ed22355ece63a8c3ed7fb

--

fortran: Unshare associate var charlen [PR104228]

PR104228 showed that character lengths were shared between associate
variable and associate targets.  This is problematic when the associate
target is itself a variable and gets a variable to hold the length, as
the length variable is added (and all the variables following it in the chain)
to both the associate variable scope and the target variable scope.
This caused an ICE when compiling with -O0 -fsanitize=address.

This change forces the creation of a separate character length for the
associate variable.  It also forces the initialization of the character
length variable to avoid regressing associate_32 and associate_47 tests.

--

fortran: Separate associate character lengths earlier [PR104570]

This change workarounds an ICE in the evaluation of the character length
of an array expression referencing an associate variable; the code is
not prepared to see a non-scalar expression as it doesn’t initialize the
scalarizer.

Before this change, associate length symbols get a new gfc_charlen at
resolution stage to unshare them from the associate expression, so that
at translation stage it is a decl specific to the associate symbol that
is initialized, not the decl of some other symbol.  This
reinitialization of gfc_charlen happens after expressions referencing
the associate symbol have been parsed, so that those expressions retain
the original gfc_charlen they have copied from the symbol.
At translation stage, the gfc_charlen for the associate symbol is setup
with the decl holding the actual length value, but the expressions have
retained the original gfc_charlen without any decl.  So they need to
evaluate the character length, and this is where the ICE happens.

This change moves the reinitialization of gfc_charlen earlier at parsing
stage, so that at resolution stage the gfc_charlen can be retained as
it’s already not shared with any other symbol, and the expressions which
now share their gfc_charlen with the symbol are automatically updated
when the length decl is setup at translation stage.  There is no need
any more to evaluate the character length as it has all the required
information, and the ICE doesn’t happen.

The first resolve.c hunk is necessary to avoid regressing on the
associate_35.f90 testcase.

--

PR fortran/104228
PR fortran/104570

gcc/fortran/ChangeLog:

* parse.c (parse_associate): Use a new distinct gfc_charlen if
the copied type has one whose length is not known to be
constant.
* resolve.c (resolve_assoc_var): Also create a new character
length for non-dummy associate targets.  Reset charlen if it’s
shared with the associate target regardless of the expression
type.  Don’t reinitialize charlen if it’s deferred.
* trans-stmt.c (trans_associate_var): Initialize character
length even if no temporary is used for the associate variable.

gcc/testsuite/ChangeLog:

* gfortran.dg/asan_associate_58.f90: New test.
* gfortran.dg/asan_associate_59.f90: New test.
* gfortran.dg/associate_58.f90: New test.

3 years agoDaily bump.
GCC Administrator [Sun, 24 Apr 2022 00:17:30 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sat, 23 Apr 2022 00:17:33 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Fri, 22 Apr 2022 00:17:51 +0000 (00:17 +0000)] 
Daily bump.

3 years agofortran: Fix conv of UNION constructors [PR105310]
Fritz Reese [Tue, 19 Apr 2022 20:45:46 +0000 (16:45 -0400)] 
fortran: Fix conv of UNION constructors [PR105310]

This fixes an ICE when a UNION is the (1+8*2^n)-th field in a DEC
STRUCTURE when compiled with -finit-derived -finit-local-zero.
The problem was CONSTRUCTOR_APPEND_ELT from within gfc_conv_union_initializer
modified the vector pointer, but the pointer was passed by-value,
so the old pointer from the caller (gfc_conv_structure) pointed to freed
memory.

PR fortran/105310

gcc/fortran/ChangeLog:

* trans-expr.c (gfc_conv_union_initializer): Pass vec* by reference.

gcc/testsuite/ChangeLog:

* gfortran.dg/dec_union_12.f90: New test.

(cherry picked from commit c049f638da4f7b32b11e4d895184e0960bae5291)

3 years agomiddle-end/100786 - constant folding from incompatible alias
Richard Biener [Thu, 20 Jan 2022 13:25:51 +0000 (14:25 +0100)] 
middle-end/100786 - constant folding from incompatible alias

The following avoids us ICEing doing constant folding from variables
with aliases of different types.  The issue appears both in
folding and CCP and FRE can do more fancy stuff to still constant
fold cases where the load is smaller than the initializer so
defer it to there.

2022-01-20  Richard Biener  <rguenther@suse.de>

PR middle-end/100786
* gimple-fold.c (get_symbol_constant_value): Only return
values of compatible type to the symbol.

* gcc.dg/torture/pr100786.c: New testcase.

(cherry picked from commit 5c12507f5d0bc080e4f346af99824e039236e61c)

3 years agotree-optimization/103361 - fix unroll-and-jam direction vector handling
Richard Biener [Tue, 23 Nov 2021 09:11:41 +0000 (10:11 +0100)] 
tree-optimization/103361 - fix unroll-and-jam direction vector handling

This properly uses lambda_int instead of truncating the direction
vector to int which leads to false unexpected negative values.

2021-11-23  Richard Biener  <rguenther@suse.de>

PR tree-optimization/103361
* gimple-loop-jam.c (adjust_unroll_factor): Use lambda_int
for the dependence distance.
* tree-data-ref.c (print_lambda_vector): Properly print a lambda_int.

* g++.dg/torture/pr103361.C: New testcase.

(cherry picked from commit 6cd440670078af89d82cbb67e01a5ecec8eec238)

3 years agotree-optimization/103596 - fix missed propagation into switches
Richard Biener [Tue, 7 Dec 2021 10:13:39 +0000 (11:13 +0100)] 
tree-optimization/103596 - fix missed propagation into switches

may_propagate_copy unnecessarily restricts propagating non-abnormals
into places that currently contain an abnormal SSA name but are
not the PHI argument for an abnormal edge.  This causes VN to
not elide a CFG path that it assumes is elided, resulting in
released SSA names in the IL.

The fix is to enhance the may_propagate_copy API to specify the
destination is _not_ a PHI argument.  I chose to not update only
the relevant caller in VN and the may_propagate_copy_into_stmt API
at this point because this is a regression and needs backporting.

2021-12-07  Richard Biener  <rguenther@suse.de>

PR tree-optimization/103596
* tree-ssa-sccvn.c (eliminate_dom_walker::eliminate_stmt):
Note we are not propagating into a PHI argument to may_propagate_copy.
* tree-ssa-propagate.h (may_propagate_copy): Add
argument specifying whether we propagate into a PHI arg.
* tree-ssa-propagate.c (may_propagate_copy): Likewise.
When not doing so we can replace an abnormal with
something else.
(may_propagate_into_stmt): Update may_propagate_copy calls.
(replace_exp_1): Move propagation checking code to
propagate_value and rename to ...
(replace_exp): ... this and elide previous wrapper.
(propagate_value): Perform checking with adjusted
may_propagate_copy call and dispatch to replace_exp.

* gcc.dg/torture/pr103596.c: New testcase.

(cherry picked from commit 6e8a31275fda445fb3e8d98e53f5e1541f4727af)

3 years agodebug/104337 - avoid messing with the abstract origin chain in NRV
Richard Biener [Thu, 3 Feb 2022 10:20:59 +0000 (11:20 +0100)] 
debug/104337 - avoid messing with the abstract origin chain in NRV

The following avoids NRV from massaging DECL_ABSTRACT_ORIGIN after
variable creation since NRV runs _after_ the function was inlined and thus
affects the inlined variables copy indirectly.  We may adjust the abstract
origin of a variable only at the point we create it, not further along the
path since otherwise the (new) invariant that the abstract origin is always
the ultimate origin cannot be maintained.

The intent of what NRV does is OK I guess and it may improve the debug
experience.  But I also notice we do

  SET_DECL_VALUE_EXPR (found, result);
  DECL_HAS_VALUE_EXPR_P (found) = 1;

the code is there since the merge from tree-ssa which added tree-nrv.c.

Jakub added the DECL_VALUE_EXPR in g:938650d8fddb878f623e315f0b7fd94b217efa96
and Jason added the abstract origin setting conditional in g:7716876bbd3a

The follwoing takes the radical approach and remove the attempt
to "optimize" the debug info.

The gdb testsuites show no regressions.

2022-02-03  Richard Biener  <rguenther@suse.de>

PR debug/104337
* tree-nrv.c (pass_nrv::execute): Remove tieing result and found
together via DECL_ABSTRACT_ORIGIN.

* gcc.dg/debug/pr104337.c: New testcase.

(cherry picked from commit 1d5c7584fd6e72bfdbede86cef5ff04ae35f9744)

3 years agomiddle-end/104786 - ICE with asm and VLA
Richard Biener [Wed, 9 Mar 2022 09:55:49 +0000 (10:55 +0100)] 
middle-end/104786 - ICE with asm and VLA

The following fixes an ICE observed with a MEM_REF allows_mem asm
operand referencing a VLA.  The following makes sure to not attempt
to go the temporary creation way when we cannot.

2022-03-09  Richard Biener  <rguenther@suse.de>

PR middle-end/104786
* cfgexpand.c (expand_asm_stmt): Do not generate a copy
for VLAs without an upper size bound.

* gcc.dg/pr104786.c: New testcase.

(cherry picked from commit ba3ff5e35144e2afff4ccef4ccbbbbaba9870afb)

3 years agoada/104861 - use target_noncanonial for Target_Name
Richard Biener [Thu, 10 Mar 2022 12:35:46 +0000 (13:35 +0100)] 
ada/104861 - use target_noncanonial for Target_Name

The following arranges for s-oscons.ads to record target_noncanonical
for Target_Name, matching the install directory layout and what
gcc -dumpmachine says.  This fixes build issues with gprbuild.

2022-03-10  Richard Biener  <rguenther@suse.de>

PR ada/104861
gcc/ada/
* gcc-interface/Makefile.in (target_noncanonical): Substitute.
(OSCONS_CPP): Pass target_noncanonical as TARGET.

(cherry picked from commit 9467e7331188705ec16c086b77e1809c5b0aab7d)

3 years agotree-optimization/105226 - avoid splitting abnormal edges
Richard Biener [Tue, 12 Apr 2022 07:40:15 +0000 (09:40 +0200)] 
tree-optimization/105226 - avoid splitting abnormal edges

Vectorizer loop versioning tries to version outer loops if possible
but fails to check whether it can actually split the single exit
edge as it will do.

2022-04-12  Richard Biener  <rguenther@suse.de>

PR tree-optimization/105226
* tree-vect-loop-manip.c (vect_loop_versioning): Verify
we can split the exit of an outer loop we choose to version.

* gcc.dg/pr105226.c: New testcase.

(cherry picked from commit 62d5bb0f35fb6ec373eaac942755585a633528a0)

3 years agotree-optimization/105070 - annotate bit cluster tests with locations
Richard Biener [Mon, 28 Mar 2022 08:07:53 +0000 (10:07 +0200)] 
tree-optimization/105070 - annotate bit cluster tests with locations

The following makes sure to annotate the tests generated by
switch lowering bit-clustering with locations which otherwise
can be completely lost even at -O0.

2022-03-28  Richard Biener  <rguenther@suse.de>

PR tree-optimization/105070
* tree-switch-conversion.h
(bit_test_cluster::hoist_edge_and_branch_if_true): Add location
argument.
* tree-switch-conversion.c
(bit_test_cluster::hoist_edge_and_branch_if_true): Annotate
cond with location.
(bit_test_cluster::emit): Annotate all generated expressions
with location.

(cherry picked from commit bc86a86a4f2c057bc0e0be94dcbb8c128ae7f717)

3 years agoDaily bump.
GCC Administrator [Thu, 21 Apr 2022 00:17:36 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Wed, 20 Apr 2022 00:17:20 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Tue, 19 Apr 2022 00:17:24 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Mon, 18 Apr 2022 00:17:39 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sun, 17 Apr 2022 00:17:42 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sat, 16 Apr 2022 00:17:50 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Fri, 15 Apr 2022 00:17:43 +0000 (00:17 +0000)] 
Daily bump.

3 years agolibstdc++: Update incorrect statement about mainline in docs
Jonathan Wakely [Thu, 14 Apr 2022 10:22:40 +0000 (11:22 +0100)] 
libstdc++: Update incorrect statement about mainline in docs

libstdc++-v3/ChangeLog:

* doc/xml/manual/status_cxx1998.xml: Refer to GCC 10 not
mainline.
* doc/xml/manual/status_cxx2011.xml: Likewise.
* doc/xml/manual/status_cxx2014.xml: Likewise.
* doc/xml/manual/status_cxx2017.xml: Likewise.
* doc/xml/manual/status_cxx2020.xml: Likewise.
* doc/xml/manual/status_cxxtr1.xml: Likewise.
* doc/xml/manual/status_cxxtr24733.xml: Likewise.
* doc/html/manual/status.html: Regenerate.

3 years agoDaily bump.
GCC Administrator [Thu, 14 Apr 2022 00:17:47 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Wed, 13 Apr 2022 00:17:30 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Tue, 12 Apr 2022 00:17:42 +0000 (00:17 +0000)] 
Daily bump.

3 years agoppc: testsuite: require target effectively [PR104253]
Alexandre Oliva [Mon, 11 Apr 2022 15:11:10 +0000 (12:11 -0300)] 
ppc: testsuite: require target effectively [PR104253]

The testcase was missing dg- before require-effective-target.

While at that, I'm also pruning the excess-error warning I got when
the test failed to be disabled because of the above.  I suppose it
might be useful for some target variants.

for gcc/testsuite/ChangeLog

PR target/104253
* gcc.target/powerpc/pr104253.c: Add missing dg- before
require-effective-target.  Prune warning about -mfloat128
possibly not being fully supported.

(cherry picked from commit ab0f04e4df1b7b312a4c9fa9b4d675778a0bae86)

3 years agoDaily bump.
GCC Administrator [Mon, 11 Apr 2022 00:17:28 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sun, 10 Apr 2022 00:17:25 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sat, 9 Apr 2022 00:17:54 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Fri, 8 Apr 2022 00:17:31 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Thu, 7 Apr 2022 00:17:49 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Wed, 6 Apr 2022 00:17:39 +0000 (00:17 +0000)] 
Daily bump.

3 years agoipa: Careful processing ANCESTOR jump functions and NULL pointers (PR 103083)
Martin Jambor [Tue, 5 Apr 2022 09:19:49 +0000 (11:19 +0200)] 
ipa: Careful processing ANCESTOR jump functions and NULL pointers (PR 103083)

IPA_JF_ANCESTOR jump functions are constructed also when the formal
parameter of the caller is first checked whether it is NULL and left
as it is if it is NULL, to accommodate C++ casts to an ancestor class.

The jump function type was invented for devirtualization and IPA-CP
propagation of tree constants is also careful to apply it only to
existing DECLs(*) but as PR 103083 shows, the part propagating "known
bits" was not careful about this, which can lead to miscompilations.

This patch introduces a flag to the ancestor jump functions which
tells whether a NULL-check was elided when creating it and makes the
bits propagation behave accordingly, masking any bits otherwise would
be known to be one.  This should safely preserve alignment info, which
is the primary ifnormation that we keep in bits for pointers.

(*) There still may remain problems when a DECL resides on address
zero (with -fno-delete-null-pointer-checks ...I hope it cannot happen
otherwise).  I am looking into that now but I think it will be easier
for everyone if I do so in a follow-up patch.

gcc/ChangeLog:

2022-02-11  Martin Jambor  <mjambor@suse.cz>

PR ipa/103083
* ipa-prop.h (ipa_ancestor_jf_data): New flag keep_null;
(ipa_get_jf_ancestor_keep_null): New function.
* ipa-prop.c (ipa_set_ancestor_jf): Initialize keep_null field of the
ancestor function.
(compute_complex_assign_jump_func): Pass false to keep_null
parameter of ipa_set_ancestor_jf.
(compute_complex_ancestor_jump_func): Pass true to keep_null
parameter of ipa_set_ancestor_jf.
(update_jump_functions_after_inlining): Carry over keep_null from the
original ancestor jump-function or merge them.
(ipa_write_jump_function): Stream keep_null flag.
(ipa_read_jump_function): Likewise.
(ipa_print_node_jump_functions_for_edge): Print the new flag.
* ipa-cp.c (class ipcp_bits_lattice): Make various getters const.  New
member function known_nonzero_p.
(ipcp_bits_lattice::known_nonzero_p): New.
(ipcp_bits_lattice::meet_with_1): New parameter drop_all_ones,
observe it.
(ipcp_bits_lattice::meet_with): Likewise.
(propagate_bits_across_jump_function): Simplify.  Pass true in
drop_all_ones when it is necessary.
(propagate_aggs_across_jump_function): Take care of keep_null
flag.
(ipa_get_jf_ancestor_result): Propagate NULL accross keep_null
jump functions.

gcc/testsuite/ChangeLog:

2021-11-25  Martin Jambor  <mjambor@suse.cz>

* gcc.dg/ipa/pr103083-1.c: New test.
* gcc.dg/ipa/pr103083-2.c: Likewise.

(cherry picked from commit 7ea3a73c195a79e6740ae594ee1a14c8bf7a938d)

3 years agoDaily bump.
GCC Administrator [Tue, 5 Apr 2022 00:17:29 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Mon, 4 Apr 2022 08:01:35 +0000 (08:01 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Fri, 1 Apr 2022 00:17:42 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Thu, 31 Mar 2022 00:17:26 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Wed, 30 Mar 2022 00:17:50 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Tue, 29 Mar 2022 00:18:09 +0000 (00:18 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Mon, 28 Mar 2022 00:17:25 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sun, 27 Mar 2022 00:17:34 +0000 (00:17 +0000)] 
Daily bump.

3 years agox86: Use x constraint on SSSE3 patterns with MMX operands
H.J. Lu [Fri, 25 Mar 2022 04:41:12 +0000 (21:41 -0700)] 
x86: Use x constraint on SSSE3 patterns with MMX operands

Since PHADDW/PHADDD/PHADDSW/PHSUBW/PHSUBD/PHSUBSW/PSIGNB/PSIGNW/PSIGND
have no AVX512 version, replace the "Yv" register constraint with the
"x" register constraint.

PR target/105052
* config/i386/sse.md (ssse3_ph<plusminus_mnemonic>wv4hi3):
Replace "Yv" with "x".
(ssse3_ph<plusminus_mnemonic>dv2si3): Likewise.
(ssse3_psign<mode>3): Likewise.

(cherry picked from commit 99591cf43fc1da0fb72b3da02ba937ba30bd2bf2)

3 years agoDaily bump.
GCC Administrator [Sat, 26 Mar 2022 10:23:36 +0000 (10:23 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Fri, 25 Mar 2022 00:18:54 +0000 (00:18 +0000)] 
Daily bump.

3 years agoProperly reset the port handle when closing
Pascal Obry [Thu, 24 Mar 2022 10:30:05 +0000 (11:30 +0100)] 
Properly reset the port handle when closing

When the serial port is closed, we need to ensure that the port handle is
properly reset for it to be detected as closed.

gcc/ada/
PR ada/104767
* libgnat/g-sercom__mingw.adb (Close): Reset port handle to -1.
* libgnat/g-sercom__linux.adb (Close): Likewise.

3 years agoDaily bump.
GCC Administrator [Thu, 24 Mar 2022 00:17:45 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Wed, 23 Mar 2022 00:17:56 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Tue, 22 Mar 2022 00:17:36 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Mon, 21 Mar 2022 00:17:27 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sun, 20 Mar 2022 00:17:24 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sat, 19 Mar 2022 00:17:20 +0000 (00:17 +0000)] 
Daily bump.

3 years agors6000: Allow -mlong-double-64 after -mabi={ibm,ieee}longdouble [PR104208, PR87496]
Peter Bergner [Fri, 18 Mar 2022 19:09:26 +0000 (14:09 -0500)] 
rs6000: Allow -mlong-double-64 after -mabi={ibm,ieee}longdouble [PR104208, PR87496]

The glibc build is showing a build error due to extra "error" checking from my
PR87496 fix.  That checking was overeager, disallowing setting the long double
size to 64-bits if the 128-bit long double ABI had already been specified.
Now we only emit an error if we specify a 128-bit long double ABI if our
long double size is not 128 bits.  This also fixes an erroneous error when
-mabi=ieeelongdouble is used and ISA 2.06 is not enabled, but the long double
size has been changed to 64 bits.

2022-03-04  Peter Bergner  <bergner@linux.ibm.com>

gcc/
PR target/87496
PR target/104208
* config/rs6000/rs6000.c (rs6000_option_override_internal): Make the
ISA 2.06 requirement for -mabi=ieeelongdouble conditional on
-mlong-double-128.
Move the -mabi=ieeelongdouble and -mabi=ibmlongdouble error checking
from here...
* common/config/rs6000/rs6000-common.c (rs6000_handle_option):
... to here.

gcc/testsuite/
PR target/87496
PR target/104208
* gcc.target/powerpc/pr104208-1.c: New test.
* gcc.target/powerpc/pr104208-2.c: Likewise.
* gcc.target/powerpc/pr87496-2.c: Swap long double options to trigger
the expected error.
* gcc.target/powerpc/pr87496-3.c: Likewise.

(cherry picked from commit cb16bc3b5f34733ef9bbf8d2e3acacdecb099a62)

3 years agoDaily bump.
GCC Administrator [Fri, 18 Mar 2022 00:17:32 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Thu, 17 Mar 2022 00:17:59 +0000 (00:17 +0000)] 
Daily bump.

3 years agotarget/104453 - guard call folding with NULL LHS
Richard Biener [Wed, 9 Feb 2022 07:48:35 +0000 (08:48 +0100)] 
target/104453 - guard call folding with NULL LHS

This guards shift builtin folding to do nothing when there is
no LHS, similar to what other foldings do.

2022-02-09  Richard Biener  <rguenther@suse.de>

PR target/104453
* config/i386/i386.c (ix86_gimple_fold_builtin): Guard shift
folding for NULL LHS.

* gcc.target/i386/pr104453.c: New testcase.

(cherry picked from commit 1c827873ed283df282f2df11dfe0ff607e07dab3)

3 years agotree-optimization/104511 - avoid FP to DFP conversion for VEC_PACK_TRUNC
Richard Biener [Mon, 14 Feb 2022 09:09:10 +0000 (10:09 +0100)] 
tree-optimization/104511 - avoid FP to DFP conversion for VEC_PACK_TRUNC

This avoids forwprop from matching DFP <-> FP vector conversions
using VEC_[UN]PACK{_TRUNC,_LO,_HI}.  Maybe DFP vectors shouldn't be
a thing, but they appearantly are.  Re-using CONVERT/NOP_EXPR for
DFP <-> FP conversions was probably a mistake.

2022-02-14  Richard Biener  <rguenther@suse.de>

PR tree-optimization/104511
* tree-ssa-forwprop.c (simplify_vector_constructor): Avoid
touching DFP <-> FP conversions.

* gcc.dg/pr104511.c: New testcase.

(cherry picked from commit f320197c8b495324dc6997a99d53e7f45ecf5840)

3 years agotarget/100784 - avoid ICE with folding __builtin_ia32_shufpd
Richard Biener [Thu, 20 Jan 2022 13:34:33 +0000 (14:34 +0100)] 
target/100784 - avoid ICE with folding __builtin_ia32_shufpd

This avoids ICEing when there is no LHS on the call by following
what foldings of other builtins do in , namely not folding.

2022-01-20  Richard Biener  <rguenther@suse.de>

PR target/100784
* config/i386/i386.c (ix86_gimple_fold_builtin): Check for
LHS before folding __builtin_ia32_shufpd and friends.

(cherry picked from commit d63d9c3dd160dce24f0209f193b8e7388b19f712)

3 years agoDaily bump.
GCC Administrator [Wed, 16 Mar 2022 00:17:46 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Tue, 15 Mar 2022 00:18:02 +0000 (00:18 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Mon, 14 Mar 2022 00:17:24 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sun, 13 Mar 2022 00:17:28 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sat, 12 Mar 2022 00:17:34 +0000 (00:17 +0000)] 
Daily bump.

3 years agoRevert __SIZEOF__IBM128__ and __SIZEOF_FLOAT128__ patch.
Michael Meissner [Sat, 12 Mar 2022 00:09:20 +0000 (19:09 -0500)] 
Revert __SIZEOF__IBM128__ and __SIZEOF_FLOAT128__ patch.

2022-03-05  Michael Meissner  <meissner@the-meissners.org>

gcc/
PR target/99708
* config/rs6000/rs6000-c.c: Revert 2022-03-05 patch.

gcc/testsuite/
PR target/99708
* gcc.target/powerpc/pr99708.c: Revert 2022-03-05 patch.

3 years agoDaily bump.
GCC Administrator [Fri, 11 Mar 2022 00:17:34 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Thu, 10 Mar 2022 00:17:36 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Wed, 9 Mar 2022 00:17:35 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Tue, 8 Mar 2022 00:17:20 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Mon, 7 Mar 2022 00:17:23 +0000 (00:17 +0000)] 
Daily bump.

3 years agoUse correct names for __ibm128 if long double is IEEE 128-bit.
Michael Meissner [Sun, 6 Mar 2022 01:14:44 +0000 (20:14 -0500)] 
Use correct names for __ibm128 if long double is IEEE 128-bit.

If you are on a PowerPC system where the default long double is IEEE
128-bit (either through the compiler option -mabi=ieeelongdouble or via
the configure option --with-long-double-format=ieee), GCC used the wrong
names for some of the conversion functions for the __ibm128 type.

Internally, GCC uses IFmode for __ibm128 if long double is IEEE 128-bit,
instead of TFmode when long double is IBM 128-bit.  This patch adds the
missing conversions to prevent the 'if' name from being used.

In particular, before the patch, the conversions used were:

    IFmode to DImode signed: __fixifdi instead of __fixtfdi
    IFmode to DImode unsigned __fixunsifti instead of __fixunstfti
    DImode to IFmode signed: __floatdiif instead of __floatditf
    DImode to IFmode unsigned: __floatundiif instead of __floatunditf

2022-03-05  Michael Meissner  <meissner@the-meissners.org>

gcc/
PR target/104253
* config/rs6000/rs6000.c (init_float128_ibm): Update the
conversion functions used to convert IFmode types.  Backport
change made to the master branch on 2022-02-14.

gcc/testsuite/
PR target/104253
* gcc.target/powerpc/pr104253.c: New test.  Backport change made
to the master branch on 2022-02-14.

3 years agoDefine __SIZEOF_FLOAT128__ and __SIZEOF_IBM128__.
Michael Meissner [Sun, 6 Mar 2022 01:11:38 +0000 (20:11 -0500)] 
Define __SIZEOF_FLOAT128__ and __SIZEOF_IBM128__.

Define the sizes of the PowerPC specific types __float128 and __ibm128 if those
types are enabled.

This patch will define __SIZEOF_IBM128__ and __SIZEOF_FLOAT128__ if their
respective types are created in the compiler.  Currently, this means both of
these will be defined if float128 support is enabled.  But at some point in
the future, __ibm128 could be enabled without enabling float128 support and
__SIZEOF_IBM128__ would be defined.

2022-03-05  Michael Meissner  <meissner@the-meissners.org>

gcc/
PR target/99708
* config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Define
__SIZEOF_IBM128__ if the IBM 128-bit long double type is created.
Define __SIZEOF_FLOAT128__ if the IEEE 128-bit floating point type
is created.  Backport change to master branch on 2022-02-17.

gcc/testsuite/
PR target/99708
* gcc.target/powerpc/pr99708.c: New test.  Backport change to
master branch on 2022-02-17.

3 years agoDaily bump.
GCC Administrator [Sun, 6 Mar 2022 00:17:32 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sat, 5 Mar 2022 00:17:40 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Fri, 4 Mar 2022 00:17:34 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Thu, 3 Mar 2022 00:17:24 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Wed, 2 Mar 2022 00:17:28 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Tue, 1 Mar 2022 00:17:51 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Mon, 28 Feb 2022 00:17:11 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sun, 27 Feb 2022 00:17:26 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sat, 26 Feb 2022 00:17:23 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Fri, 25 Feb 2022 00:17:39 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Thu, 24 Feb 2022 00:17:19 +0000 (00:17 +0000)] 
Daily bump.

3 years agoFortran: skip compile-time shape check if constructor shape is not known
Harald Anlauf [Mon, 21 Feb 2022 21:49:05 +0000 (22:49 +0100)] 
Fortran: skip compile-time shape check if constructor shape is not known

gcc/fortran/ChangeLog:

PR fortran/104619
* resolve.c (resolve_structure_cons): Skip shape check if shape
of constructor cannot be determined at compile time.

gcc/testsuite/ChangeLog:

PR fortran/104619
* gfortran.dg/derived_constructor_comps_7.f90: New test.

(cherry picked from commit bc66b471d16ef2fd8cb66fd1131b41f80ecb9961)

3 years agoDaily bump.
GCC Administrator [Wed, 23 Feb 2022 00:17:35 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Tue, 22 Feb 2022 00:17:26 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Mon, 21 Feb 2022 00:17:38 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sun, 20 Feb 2022 00:17:19 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sat, 19 Feb 2022 00:17:37 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Fri, 18 Feb 2022 00:17:33 +0000 (00:17 +0000)] 
Daily bump.

3 years agoRevert "c++: using overloaded with local decl [PR92918]"
Jason Merrill [Thu, 17 Feb 2022 23:11:23 +0000 (18:11 -0500)] 
Revert "c++: using overloaded with local decl [PR92918]"

       PR c++/104476

This reverts commit decd38f99dd05eb54ddcaee7c52f21a56a844613.

3 years agolibstdc++: missing constexpr for __[nm]iter_base [PR102358]
Patrick Palka [Thu, 21 Oct 2021 16:13:35 +0000 (12:13 -0400)] 
libstdc++: missing constexpr for __[nm]iter_base [PR102358]

PR libstdc++/102358

libstdc++-v3/ChangeLog:

* include/bits/stl_iterator.h (__niter_base): Make constexpr
for C++20.
(__miter_base): Likewise.
* testsuite/25_algorithms/move/constexpr.cc: New test.

(cherry picked from commit 5f7976f65b45c457b57bfc2c55ec845771e0d3c2)

3 years agotree-optimization/103237 - avoid vectorizing unhandled double reductions
Richard Biener [Mon, 15 Nov 2021 10:37:56 +0000 (11:37 +0100)] 
tree-optimization/103237 - avoid vectorizing unhandled double reductions

Double reductions which have multiple LC PHIs in the inner loop
are not handled correctly during transformation since those PHIs
are not properly classified as reduction.  The following disables
vectorizing them.

2021-11-15  Richard Biener  <rguenther@suse.de>

PR tree-optimization/103237
* tree-vect-loop.c (vect_is_simple_reduction): Fail for
double reductions with multiple inner loop LC PHI nodes.

* gcc.dg/torture/pr103237.c: New testcase.

(cherry picked from commit 220bd61874cf114667b44f9ded76ed0639eb278b)

3 years agomiddle-end/103181 - fix operation_could_trap_p for vector division
Richard Biener [Thu, 11 Nov 2021 08:40:36 +0000 (09:40 +0100)] 
middle-end/103181 - fix operation_could_trap_p for vector division

For integer vector division we only checked for all zero vector
constants rather than checking whether any element in the constant
vector is zero.

It also fixes the adjustment to operation_could_trap_helper_p
where I failed to realize that RDIV_EXPR is also used for
fixed-point types.  It also fixes that handling by properly
checking for a fixed_zerop divisor.

2021-11-11  Richard Biener  <rguenther@suse.de>

PR middle-end/103181
PR middle-end/103248
* tree-eh.c (operation_could_trap_helper_p): Properly
check vector constants for a zero element for integer
division.  Separate floating point and integer division code.
Properly handle fixed-point RDIV_EXPR.

* gcc.dg/torture/pr103181.c: New testcase.
* gcc.dg/pr103248.c: Likewise.

(cherry picked from commit 2f0c8f74daef93c0c7b33294213e7db6df58c4d1)

3 years agotree-optimization/102798 - avoid copying PTA info to old SSA names
Richard Biener [Mon, 18 Oct 2021 07:10:43 +0000 (09:10 +0200)] 
tree-optimization/102798 - avoid copying PTA info to old SSA names

The vectorizer duplicates pointer-info to created pointer bases
but it has to avoid changing points-to info on existing SSA names
because there's now flow-sensitive info in there (pt->pt_null as
set from VRP).

2021-10-18  Richard Biener  <rguenther@suse.de>

PR tree-optimization/102798
* tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref):
Only copy points-to info to newly generated SSA names.

* gcc.dg/pr102798.c: New testcase.

(cherry picked from commit 1631d6d2910e03e4517079d6e6ad0ae1aeb24dfa)

3 years agoipa/102762 - fix ICE with invalid __builtin_va_arg_pack () use
Richard Biener [Fri, 15 Oct 2021 06:41:57 +0000 (08:41 +0200)] 
ipa/102762 - fix ICE with invalid __builtin_va_arg_pack () use

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.

(cherry picked from commit 11a4714860d2df6ba496d55379e7dc702d5fc425)

3 years agotree-optimization/100923 - fix alias-ref construction wrt availability
Richard Biener [Tue, 8 Jun 2021 10:52:12 +0000 (12:52 +0200)] 
tree-optimization/100923 - fix alias-ref construction wrt availability

This PR shows that building an ao_ref from value-numbers is prone to
expose bogus contextual alias info to the oracle.  The following makes
sure to construct ao_refs from SSA names available at the program point
only.

On the way it modifies the awkward valueize_refs[_1] API.

2021-06-08  Richard Biener  <rguenther@suse.de>

PR tree-optimization/100923
* tree-ssa-sccvn.c (valueize_refs_1): Take a pointer to
the operand vector to be valueized.
(valueize_refs): Likewise.
(valueize_shared_reference_ops_from_ref): Adjust.
(valueize_shared_reference_ops_from_call): Likewise.
(vn_reference_lookup_3): Likewise.
(vn_reference_lookup_pieces): Likewise.  Re-valueize
with honoring availability when we are about to create
the ao_ref and valueized before.
(vn_reference_lookup): Likewise.
(vn_reference_insert_pieces): Adjust.

* gcc.dg/torture/pr100923.c: New testcase.

(cherry picked from commit 7a56d3d3e99cc77ad8a6a674870c814da6225675)

3 years agotree-optimization/101158 - adjust SLP call matching sequence
Richard Biener [Tue, 22 Jun 2021 07:24:24 +0000 (09:24 +0200)] 
tree-optimization/101158 - adjust SLP call matching sequence

This moves the check for same operands after verifying we're
facing compatible calls.

2021-06-22  Richard Biener  <rguenther@suse.de>

PR tree-optimization/101158
* tree-vect-slp.c (vect_build_slp_tree_1): Move same operand
checking after checking for matching operation.

* gfortran.dg/pr101158.f90: New testcase.

(cherry picked from commit 7a22d8a764418265680a6bb9a9aec31e984eb015)

3 years agoDaily bump.
GCC Administrator [Thu, 17 Feb 2022 00:17:43 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Wed, 16 Feb 2022 00:17:32 +0000 (00:17 +0000)] 
Daily bump.

3 years agors6000: Move the hunk affecting VSX/ALTIVEC ahead [PR103627]
Kewen Lin [Mon, 7 Feb 2022 03:30:02 +0000 (21:30 -0600)] 
rs6000: Move the hunk affecting VSX/ALTIVEC ahead [PR103627]

The modified hunk can update VSX and ALTIVEC flag, we have some codes
to check/warn for some flags related to VSX and ALTIVEC sitting where
the hunk is proprosed to be moved to.  Without this adjustment, the
VSX and ALTIVEC update is too late, it can cause the incompatibility
and result in unexpected behaviors, the associated test case is one
typical case.

Since we already have the code which sets TARGET_FLOAT128_TYPE and lays
after the moved place, and OPTION_MASK_FLOAT128_KEYWORD will rely on
TARGET_FLOAT128_TYPE, so it just simply remove them.

gcc/ChangeLog:

PR target/103627
* config/rs6000/rs6000.c (rs6000_option_override_internal): Move the
hunk affecting VSX and ALTIVEC to appropriate place.

gcc/testsuite/ChangeLog:

PR target/103627
* gcc.target/powerpc/pr103627-3.c: New test.

(cherry picked from commit e66ba0f55c000152df63fc67c11a64f79122ef86)

3 years agors6000: Disable MMA if no VSX support [PR103627]
Kewen Lin [Mon, 7 Feb 2022 03:29:32 +0000 (21:29 -0600)] 
rs6000: Disable MMA if no VSX support [PR103627]

As PR103627 shows, there is an unexpected case where !TARGET_VSX
and TARGET_MMA co-exist.  As ISA3.1 claims, SIMD is a requirement
for MMA.  By looking into the ICE, I noticed that the current
MMA implementation depends on vector pairs load/store which use
VSX register, but we don't have a separated option to control
Power10 vector support and Segher pointed out "-mpower9-vector is
a workaround that should go away" and more explanations in [1].
So this patch makes MMA require VSX instead.

[1] https://gcc.gnu.org/pipermail/gcc-patches/2022-January/589303.html

gcc/ChangeLog:

PR target/103627
* config/rs6000/rs6000.c (rs6000_option_override_internal): Disable
MMA if !TARGET_VSX.

gcc/testsuite/ChangeLog:

PR target/103627
* gcc.target/powerpc/pr103627-1.c: New test.
* gcc.target/powerpc/pr103627-2.c: New test.

(cherry picked from commit 8103623923ac4ea19b97a369979d4bd5731aab57)

3 years agoDaily bump.
GCC Administrator [Tue, 15 Feb 2022 00:17:27 +0000 (00:17 +0000)] 
Daily bump.