aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-05-25ada: Tune handling of attributes Old in contract Exceptional_CasesPiotr Trojanek1-2/+30
Contract Exceptional_Cases allows formal parameters to appear *in* prefixes of attributes Old, but the code only allowed them to appear *as* prefixes of those attributes. For example, we now accetp expressions like "X.all'Old" that were previously rejected. gcc/ada/ * sem_res.adb (Resolve_Entity_Name): Tune handling of formal parameters in contract Exceptional_Cases.
2023-05-25ada: Remove redundant guards from calls to Move_AspectsPiotr Trojanek3-12/+4
Routine Move_Aspects does nothing if its From parameter has no aspects. There is no need to check this at the call sites. Code cleanup related to changes in handling of expressions functions in GNATprove; semantics is unaffected. gcc/ada/ * par-ch7.adb (P_Package): Remove redundant guard from call to Move_Aspects. * par-ch9.adb (P_Task): Likewise. * sem_ch6.adb (Analyze_Expression_Function, Is_Inline_Pragma): Likewise.
2023-05-25ada: Small tweak to implementation of by-copy semantics for storage modelsEric Botcazou1-25/+4
Get_Actual_Subtype can be used to access the Actual_Designated_Subtype of explicit dereferences with a storage model. As a side effect, this also handles the case where the prefix of the dereference is a formal parameter. gcc/ada/ * exp_ch6.adb (Add_Simple_Call_By_Copy_Code): Use Get_Actual_Subtype to retrieve the actual subtype for all actuals and do it in only one place for all unconstrained composite formal types.
2023-05-25ada: Fix copy-paste mistake in analysis of Exceptional_CasesPiotr Trojanek1-3/+3
Trivial mistakes in copied code. gcc/ada/ * sem_prag.adb (Analyze_Pragma): Fix references to Exceptional_Cases in code copied from handling of Subprogram_Variant.
2023-05-25ada: Enrich documentation of subprogramRonan Desplanques1-1/+5
This patch adds documentation to the subprogram Replace_Type in Sem_Ch3. In particular, references to relevant parts of the Ada reference manual are added. gcc/ada/ * sem_ch3.adb (Replace_Type): Add more documentation.
2023-05-25ada: Maximize use of existing constantRonan Desplanques1-2/+2
This patch does not change the behavior of the compiler and is intended as a readability improvement. gcc/ada/ * sem_ch3.adb (Replace_Type): Use existing constant wherever possible.
2023-05-25ada: Reduce span of variableRonan Desplanques1-1/+1
This patch does not change the behavior of the compiler, but is intended to improve readability. It seizes an opportunity to move a variable declaration to a smaller scope, so that it's clearer that the variable is not used outside of that scope. gcc/ada/ * sem_ch3.adb (Replace_Type): Reduce span of variable.
2023-05-25ada: Set Is_Not_Self_Hidden flag in more casesBob Duff3-3/+11
More work-in-progress for changing E_Void checks to the flag. gcc/ada/ * sem_ch9.adb (Analyze_Protected_Type_Declaration): Set the flag for protected types. (Analyze_Single_Protected_Declaration): Likewise, for singleton protected objects. (Analyze_Task_Type_Declaration): Set the flag for task types. (Analyze_Single_Task_Declaration): Likewise, for singleton task objects. * sem_ch10.adb (Decorate_Type): Set the flag for types treated as incomplete. (Build_Shadow_Entity): Set the flag for shadow entities. (Decorate_State): Set the flag for an abstract state. (Build_Limited_Views): Set the flag for limited view of package. * sem_attr.adb (Check_Not_Incomplete_Type): Disable the check when this is a current instance.
2023-05-25ada: Handle controlling access parameters in DTWsRonan Desplanques2-7/+7
This patch improves the way controlling access parameters are handled in dispatch table wrappers. The constructions of both the specifications and the bodies of wrappers are modified. gcc/ada/ * freeze.adb (Build_DTW_Body): Add appropriate type conversions for controlling access parameters. * sem_util.adb (Build_Overriding_Spec): Fix designated types in controlling access parameters.
2023-05-25ada: Add Entry_Cancel_Parameter to E_LabelBob Duff4-3/+9
...and other (minor) changes. gcc/ada/ * gen_il-gen-gen_entities.adb (E_Label): Add Entry_Cancel_Parameter. This is necessary because Analyze_Implicit_Label_Declaration set the Ekind to E_Label. Without this change, this field would fail the vanishing-fields check in Atree (which is currently commented out). * einfo.ads (Entry_Cancel_Parameter): Document for E_Label. * sem_eval.adb (Why_Not_Static): Protect against previous errors (no need to explain why something is not static if it's already illegal for other reasons). * sem_util.ads (Enter_Name): Fix misleading comment.
2023-05-25ada: Minor fixes in description of scope depthEric Botcazou1-3/+3
In particular, the scope depth of library units is 1 instead of 0. gcc/ada/ * einfo.ads (Scope_Depth): Fix circular definition. (Scope_Depth_Value): Fix value for library units.
2023-05-25ada: Tune warning about assignment just before a raise statementPiotr Trojanek3-6/+5
Tune warning about a possibly ineffective assignment to a formal parameter that happens just before a raise statement. The warning is now emitted for parameters of all by-copy types and not just of scalar types (this gives more warnings), but is suppressed for aliased parameters (this removes some spurious warnings). gcc/ada/ * sem_ch11.adb (Analyze_Raise_Expression): Tune warning condition. * libgnat/g-dirope.ads (Open): Remove a potentially inaccurate comment. * libgnat/g-dirope.adb (Open): Remove a potentially useless assignment; the Dir output parameter should be assigned a null value anyway by the preceding call to Free.
2023-05-25ada: Accept aliased parameters in Exceptional_CasesPiotr Trojanek1-1/+2
Aliased parameters, just like parameters by-reference types, can safely appear in consequences of Exceptional_Cases aspect. gcc/ada/ * sem_res.adb (Resolve_Entity_Name): Allow aliased parameters; tune error message.
2023-05-25ada: Fix incorrect handling of Aggregate aspectMarc Poulhiès1-2/+8
This change fixes 2 incorrect handlings of the aspect. The arguments are now correctly resolved and the aspect is rejected on non array types. gcc/ada/ * sem_ch13.adb (Analyze_One_Aspect): Mark Aggregate aspect as needing delayed resolution and reject the aspect on non-array type.
2023-05-25ada: Fix obsolete comment in Sinfo.UtilsBob Duff1-1/+1
...caused by moving code here from Atree. gcc/ada/ * sinfo-utils.adb: Update comment to refer to New_Node_Debugging_Output.
2023-05-25ada: Fix SPARK context not restored when Load_Unit is failingMarc Poulhiès2-12/+31
When Load_Unit fails to find the unit or encounters an error, the Load_Fail procedure is called and an exception is raised, skipping the restoration of the SPARK/Ghost context stored on procedure entry. gcc/ada/ * rtsfind.adb (Load_RTU.Restore_SPARK_Context): New. (Load_RTU): Use Restore_SPARK_Context on all exit paths. * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Initialize local variable to Empty.
2023-05-25ada: Restrict use of formal parameters within exceptional casesPiotr Trojanek2-0/+69
Restrict references to formal parameters within the new SPARK aspect Exceptional_Cases and allow occurrences of 'Old in this aspect. gcc/ada/ * sem_attr.adb (Analyze_Attribute_Old_Result): Allow uses of 'Old and 'Result within the new aspect. * sem_res.adb (Within_Exceptional_Cases_Consequence): New utility routine. (Resolve_Entity_Name): Restrict use of formal parameters within the new aspect.
2023-05-25RISC-V: Remove FRM_REGNUM dependency for rtx conversionsJuzhe-Zhong1-9/+3
According to RVV ISA: The conversions use the dynamic rounding mode in frm, except for the rtz variants, which round towards zero. So rtz conversion patterns should not have FRM dependency. We can't support mode switching for FRM yet since rvv intrinsic doc is not updated but I think this patch is correct. gcc/ChangeLog: * config/riscv/vector.md: Remove FRM_REGNUM dependency in rtz instructions. Signed-off-by: Juzhe-Zhong <juzhe.zhong@rivai.ai>
2023-05-25testsuite, analyzer: Fix testcases with fcloseChristophe Lyon2-0/+4
The gcc.dg/analyzer/data-model-4.c and gcc.dg/analyzer/torture/conftest-1.c fail with recent glibc headers and succeed with older headers. The new error message is: warning: use of possibly-NULL 'f' where non-null expected [CWE-690] [-Wanalyzer-possible-null-argument] Like similar previous fixes in this area, this patch updates the testcase so that this warning isn't reported. 2023-05-23 Christophe Lyon <christophe.lyon@linaro.org> gcc/testsuite/ * gcc.dg/analyzer/data-model-4.c: Exit if fopen returns NULL. * gcc.dg/analyzer/torture/conftest-1.c: Likewise.
2023-05-25Stream out NANs correctly.Aldy Hernandez3-9/+25
NANs don't have bounds, so there's no need to stream them out. gcc/ChangeLog: * data-streamer-in.cc (streamer_read_value_range): Handle NANs. * data-streamer-out.cc (streamer_write_vrange): Same. * value-range.h (class vrange): Make streamer_write_vrange a friend.
2023-05-25Disallow setting of NANs in frange setter unless setting trees.Aldy Hernandez2-11/+11
frange::set() is confusing in that we can set a NAN by specifying a bound of +-NAN, even though we tecnically disallow NANs in the setter because the kind can never be VR_NAN. This is a wart for get_tree_range(), which builds a range out of a tree from the source, to work correctly. It's ugly, and it showed its limitation while implementing LTO streaming of ranges. This patch disallows passing NAN bounds in frange::set() and fixes get_tree_range. gcc/ChangeLog: * value-query.cc (range_query::get_tree_range): Set NAN directly if necessary. * value-range.cc (frange::set): Assert that bounds are not NAN.
2023-05-25Hash known NANs correctly for franges.Aldy Hernandez1-7/+7
We're ICEing when trying to hash a known NAN. This is unnoticeable because the only user would be IPA, and even so, it currently doesn't handle floats. However, handling floats is a flip of a switch, so it's best to handle them already. gcc/ChangeLog: * value-range.cc (add_vrange): Handle known NANs.
2023-05-25Add an frange::set_nan() variant that takes a nan_state.Aldy Hernandez1-15/+17
Generalize frange::set_nan() to take a nan_state and make current set_nan() methods syntactic sugar. This is in preparation for better streaming of NANs for LTO/IPA. gcc/ChangeLog: * value-range.h (frange::set_nan): New.
2023-05-24[PR100106] Reject unaligned subregs when strict alignment is requiredAlexandre Oliva2-0/+19
The testcase for pr100106, compiled with optimization for 32-bit powerpc -mcpu=604 with -mstrict-align expands the initialization of a union from a float _Complex value into a load from an SCmode constant pool entry, aligned to 4 bytes, into a DImode pseudo, requiring 8-byte alignment. The patch that introduced the testcase modified simplify_subreg to avoid changing the MEM to outermode, but simplify_gen_subreg still creates a SUBREG or a MEM that would require stricter alignment than MEM's, and lra_constraints appears to get confused by that, repeatedly creating unsatisfiable reloads for the SUBREG until it exceeds the insn count. Avoiding the unaligned SUBREG, expand splits the DImode dest into SUBREGs and loads each SImode word of the constant pool with the proper alignment. for gcc/ChangeLog PR target/100106 * emit-rtl.cc (validate_subreg): Reject a SUBREG of a MEM that requires stricter alignment than MEM's. for gcc/testsuite/ChangeLog PR target/100106 * gcc.target/powerpc/pr100106-sa.c: New.
2023-05-24[testsuite] require profiling for -pgAlexandre Oliva2-0/+2
Fix two tests that use -pg but don't declare their requirement for profiling support. for gcc/testsuite/ChangeLog * gcc.target/i386/mcount_pic.c: Add dg-require-profiling. * gcc.target/i386/pr104447.c: Likewise.
2023-05-24[testsuite] require pthread for openmpAlexandre Oliva1-0/+2
Fix test that uses -fopenmp without declaring requirement for pthread support. for gcc/testsuite/ChangeLog * g++.dg/pr80481.C: Add explicit pthread requirement.
2023-05-24[testsuite] require pic for pr103074.cAlexandre Oliva1-0/+1
Fix test that uses -fPIC without stating the requirement for PIC support. for gcc/testsuite/ChangeLog * gcc.target/i386/pr103074.c: Require fpic support.
2023-05-24[testsuite] tsvc: skip include malloc.h when unavailableAlexandre Oliva1-1/+4
tsvc tests all fail on systems that don't offer a malloc.h, other than those that explicitly rule that out. Use the preprocessor to test for malloc.h's availability. tsvc.h also expects a definition for struct timeval, but it doesn't include sys/time.h. Add a conditional include thereof. for gcc/testsuite/ChangeLog * gcc.dg/vect/tsvc/tsvc.h: Test for and conditionally include malloc.h and sys/time.h.
2023-05-24[libstdc++] [testsuite] xfail to_chars/long_double on x86-vxworksAlexandre Oliva1-1/+1
Just as on aarch64, x86's wider long double experiences loss of precision with from_chars implemented in terms of double. Expect the execution fail. for libstdc++-v3/ChangeLog * testsuite/20_util/to_chars/long_double.cc: Expect execution fail on x86-vxworks.
2023-05-24[testsuite] [x86] cope with --enable-frame-pointerAlexandre Oliva13-0/+26
Various x86 tests fail if the toolchain is configured with --enable-frame-pointer, because the unexpected extra insns mess with the expected asm counts. Add -fomit-frame-pointer so that they can still pass. for gcc/testsuite/ChangeLog * gcc.target/i386/pieces-memcpy-7.c: Add -fomit-frame-pointer. * gcc.target/i386/pieces-memcpy-8.c: Likewise. * gcc.target/i386/pieces-memcpy-9.c: Likewise. * gcc.target/i386/pieces-memset-1.c: Likewise. * gcc.target/i386/pieces-memset-36.c: Likewise. * gcc.target/i386/pieces-memset-4.c: Likewise. * gcc.target/i386/pieces-memset-40.c: Likewise. * gcc.target/i386/pieces-memset-41.c: Likewise. * gcc.target/i386/pieces-memset-7.c: Likewise. * gcc.target/i386/pieces-memset-8.c: Likewise. * gcc.target/i386/pieces-memset-9.c: Likewise. * gcc.target/i386/pr102230.c: Likewise. * gcc.target/i386/pr78103-2.c: Likewise.
2023-05-25Daily bump.GCC Administrator6-1/+491
2023-05-24Gimple range PHI analyzer and testcasesAndrew MacLeod8-1/+699
Provide a PHI analyzer framework to provive better initial values for PHI nodes which formk groups with initial values and single statements which modify the PHI values in some predicatable way. PR tree-optimization/107822 PR tree-optimization/107986 gcc/ * Makefile.in (OBJS): Add gimple-range-phi.o. * gimple-range-cache.h (ranger_cache::m_estimate): New phi_analyzer pointer member. * gimple-range-fold.cc (fold_using_range::range_of_phi): Use phi_analyzer if no loop info is available. * gimple-range-phi.cc: New file. * gimple-range-phi.h: New file. * tree-vrp.cc (execute_ranger_vrp): Utililze a phi_analyzer. gcc/testsuite/ * gcc.dg/pr107822.c: New. * gcc.dg/pr107986-1.c: New.
2023-05-24Provide relation queries for a stmt.Andrew MacLeod2-15/+124
Allow fur_list and fold_stmt to be provided a range_query rather than always defaultsing to NULL (which becomes a global query). Also provide a fold_relations () routine which can provide a range_trio for an arbitrary statement using any range_query * gimple-range-fold.cc (fur_list::fur_list): Add range_query param to contructors. (fold_range): Add range_query parameter. (fur_relation::fur_relation): New. (fur_relation::trio): New. (fur_relation::register_relation): New. (fold_relations): New. * gimple-range-fold.h (fold_range): Adjust prototypes. (fold_relations): New.
2023-05-24Make ssa_cache a range_query.Andrew MacLeod4-1/+27
By providing range_of_expr as a range_query, we can fold and do other interesting things using values from the global table. Make ranger's knonw globals available via const_query. * gimple-range-cache.cc (ssa_cache::range_of_expr): New. * gimple-range-cache.h (class ssa_cache): Inherit from range_query. (ranger_cache::const_query): New. * gimple-range.cc (gimple_ranger::const_query): New. * gimple-range.h (gimple_ranger::const_query): New prototype.
2023-05-24Make ssa_cache and ssa_lazy_cache virtual.Andrew MacLeod2-39/+41
Making them virtual allows us to interchangebly use the caches. * gimple-range-cache.cc (ssa_cache::dump): Use get_range. (ssa_cache::dump_range_query): Delete. (ssa_lazy_cache::dump_range_query): Delete. (ssa_lazy_cache::get_range): Move from header file. (ssa_lazy_cache::clear_range): ditto. (ssa_lazy_cache::clear): Ditto. * gimple-range-cache.h (class ssa_cache): Virtualize. (class ssa_lazy_cache): Inherit and virtualize.
2023-05-24Fortran: reject bad DIM argument of SIZE intrinsic in simplification [PR104350]Harald Anlauf2-1/+30
gcc/fortran/ChangeLog: PR fortran/104350 * simplify.cc (simplify_size): Reject DIM argument of intrinsic SIZE with error when out of valid range. gcc/testsuite/ChangeLog: PR fortran/104350 * gfortran.dg/size_dim_2.f90: New test.
2023-05-24Fortran: checking and simplification of RESHAPE intrinsic [PR103794]Harald Anlauf6-6/+77
gcc/fortran/ChangeLog: PR fortran/103794 * check.cc (gfc_check_reshape): Expand constant arguments SHAPE and ORDER before checking. * gfortran.h (gfc_is_constant_array_expr): Add prototype. * iresolve.cc (gfc_resolve_reshape): Expand constant argument SHAPE. * simplify.cc (is_constant_array_expr): If array is determined to be constant, expand small array constructors if needed. (gfc_is_constant_array_expr): Wrapper for is_constant_array_expr. (gfc_simplify_reshape): Fix check for insufficient elements in SOURCE when no padding specified. gcc/testsuite/ChangeLog: PR fortran/103794 * gfortran.dg/reshape_10.f90: New test. * gfortran.dg/reshape_11.f90: New test.
2023-05-24libstdc++: Fix type of first argument to vec_cntm callMatthias Kretz2-6/+36
Signed-off-by: Matthias Kretz <m.kretz@gsi.de> libstdc++-v3/ChangeLog: PR libstdc++/109949 * include/experimental/bits/simd.h (__intrinsic_type): If __ALTIVEC__ is defined, map gnu::vector_size types to their corresponding __vector T types without losing unsignedness of integer types. Also prefer long long over long. * include/experimental/bits/simd_ppc.h (_S_popcount): Cast mask object to the expected unsigned vector type.
2023-05-24Remove deprecated vrange::kind().Aldy Hernandez1-3/+0
gcc/ChangeLog: * value-range.h (vrange::kind): Remove.
2023-05-24PR middle-end/109840: Preserve popcount/parity type in match.pd.Roger Sayle3-10/+67
PR middle-end/109840 is a regression introduced by my recent patch to fold popcount(bswap(x)) as popcount(x). When the bswap and the popcount have the same precision, everything works fine, but this optimization also allowed a zero-extension between the two. The oversight is that we need to be strict with type conversions, both to avoid accidentally changing the argument type to popcount, and also to reflect the effects of argument/return-value promotion in the call to bswap, so this zero extension needs to be preserved/explicit in the optimized form. Interestingly, match.pd should (in theory) be able to narrow calls to popcount and parity, removing a zero-extension from its argument, but that is an independent optimization, that needs to check IFN_ support. Many thanks to Andrew Pinski for his help/fixes with these transformations. 2023-05-24 Roger Sayle <roger@nextmovesoftware.com> gcc/ChangeLog PR middle-end/109840 * match.pd <popcount optimizations>: Preserve zero-extension when optimizing popcount((T)bswap(x)) and popcount((T)rotate(x,y)) as popcount((T)x), so the popcount's argument keeps the same type. <parity optimizations>: Likewise preserve extensions when simplifying parity((T)bswap(x)) and parity((T)rotate(x,y)) as parity((T)x), so that the parity's argument type is the same. gcc/testsuite/ChangeLog PR middle-end/109840 * gcc.dg/fold-parity-8.c: New test. * gcc.dg/fold-popcount-11.c: Likewise.
2023-05-24Provide an API for ipa_vr.Aldy Hernandez13-95/+136
This patch encapsulates the ipa_vr internals into an API. It also makes it type agnostic, in preparation for upcoming changes to IPA. Interestingly, there's a 0.44% improvement to IPA-cp, which I'm sure we'll soak up with future changes in this area :). gcc/ChangeLog: * ipa-cp.cc (ipa_value_range_from_jfunc): Use new ipa_vr API. (ipcp_store_vr_results): Same. * ipa-prop.cc (ipa_vr::ipa_vr): New. (ipa_vr::get_vrange): New. (ipa_vr::set_unknown): New. (ipa_vr::streamer_read): New. (ipa_vr::streamer_write): New. (write_ipcp_transformation_info): Use new ipa_vr API. (read_ipcp_transformation_info): Same. (ipa_vr::nonzero_p): Delete. (ipcp_update_vr): Use new ipa_vr API. * ipa-prop.h (class ipa_vr): Provide an API and hide internals. * ipa-sra.cc (zap_useless_ipcp_results): Use new ipa_vr API. gcc/testsuite/ChangeLog: * gcc.dg/ipa/pr78121.c: Adjust for vrange::dump use. * gcc.dg/ipa/vrp1.c: Same. * gcc.dg/ipa/vrp2.c: Same. * gcc.dg/ipa/vrp3.c: Same. * gcc.dg/ipa/vrp4.c: Same. * gcc.dg/ipa/vrp5.c: Same. * gcc.dg/ipa/vrp6.c: Same. * gcc.dg/ipa/vrp7.c: Same. * gcc.dg/ipa/vrp8.c: Same.
2023-05-24Fix sprintf length warningJan-Benedict Glaw1-1/+1
One of the supplied argument strings is unneccesarily long (c-sky, using basically the same code, fixed it to a shorter length) and this fixes overflow warnings, as GCC fails to deduce that the full 256 bytes for load_op[] are not used at all. gcc/ChangeLog: * config/mcore/mcore.cc (output_inline_const) Make buffer smaller to silence overflow warnings later on.
2023-05-24i386: Add v<any_shift:insn>v4qi3 expanderUros Bizjak7-19/+85
Also, move v<any_shift:insn>v8qi3 expander to a better place and enable it with TARGET_MMX_WITH_SSE. Remove handling of V8QImode from ix86_expand_vecop_qihi2 since all partial QI->HI vector modes expand via ix86_expand_vecop_qihi_partial. gcc/ChangeLog: * config/i386/i386-expand.cc (ix86_expand_vecop_qihi2): Remove handling of V8QImode. * config/i386/mmx.md (v<insn>v8qi3): Move from sse.md. Call ix86_expand_vecop_qihi_partial. Enable for TARGET_MMX_WITH_SSE. (v<insn>v4qi3): Ditto. * config/i386/sse.md (v<insn>v8qi3): Remove. gcc/testsuite/ChangeLog: * gcc.target/i386/vect-shiftv4qi.c (dg-options): Remove -ftree-vectorize. * gcc.target/i386/vect-shiftv8qi.c (dg-options): Ditto. * gcc.target/i386/vect-vshiftv4qi.c: New test. * gcc.target/i386/vect-vshiftv8qi.c: New test.
2023-05-24aarch64: PR target/99195 Annotate vector shift patterns for vec-concat-zeroKyrylo Tkachov4-12/+61
Continuing the series of straightforward annotations, this one handles the normal (not widening or narrowing) vector shifts. Tests included. Bootstrapped and tested on aarch64-none-linux-gnu and aarch64_be-none-elf. gcc/ChangeLog: PR target/99195 * config/aarch64/aarch64-simd.md (aarch64_simd_lshr<mode>): Rename to... (aarch64_simd_lshr<mode><vczle><vczbe>): ... This. (aarch64_simd_ashr<mode>): Rename to... (aarch64_simd_ashr<mode><vczle><vczbe>): ... This. (aarch64_simd_imm_shl<mode>): Rename to... (aarch64_simd_imm_shl<mode><vczle><vczbe>): ... This. (aarch64_simd_reg_sshl<mode>): Rename to... (aarch64_simd_reg_sshl<mode><vczle><vczbe>): ... This. (aarch64_simd_reg_shl<mode>_unsigned): Rename to... (aarch64_simd_reg_shl<mode>_unsigned<vczle><vczbe>): ... This. (aarch64_simd_reg_shl<mode>_signed): Rename to... (aarch64_simd_reg_shl<mode>_signed<vczle><vczbe>): ... This. (vec_shr_<mode>): Rename to... (vec_shr_<mode><vczle><vczbe>): ... This. (aarch64_<sur>shl<mode>): Rename to... (aarch64_<sur>shl<mode><vczle><vczbe>): ... This. (aarch64_<sur>q<r>shl<mode>): Rename to... (aarch64_<sur>q<r>shl<mode><vczle><vczbe>): ... This. gcc/testsuite/ChangeLog: PR target/99195 * gcc.target/aarch64/simd/pr99195_1.c: Add testing for shifts. * gcc.target/aarch64/simd/pr99195_6.c: Likewise. * gcc.target/aarch64/simd/pr99195_8.c: New test.
2023-05-24target/109944 - avoid STLF fail for V16QImode CTOR expansionRichard Biener3-5/+53
The following dispatches to V2DImode CTOR expansion instead of using sets of (subreg:DI (reg:V16QI 146) [08]) which causes LRA to spill DImode and reload V16QImode. The same applies for V8QImode or V4HImode construction from SImode parts which happens during 32bit libgcc build. PR target/109944 * config/i386/i386-expand.cc (ix86_expand_vector_init_general): Perform final vector composition using ix86_expand_vector_init_general instead of setting the highpart and lowpart which causes spilling. * gcc.target/i386/pr109944-1.c: New testcase. * gcc.target/i386/pr109944-2.c: Likewise.
2023-05-24Only update global value if it changes.Andrew MacLeod3-6/+14
Do not update and propagate a global value if it hasn't changed. PR tree-optimization/109695 * gimple-range-cache.cc (ranger_cache::get_global_range): Add changed param. * gimple-range-cache.h (ranger_cache::get_global_range): Ditto. * gimple-range.cc (gimple_ranger::range_of_stmt): Pass changed flag to set_global_range. (gimple_ranger::prefill_stmt_dependencies): Ditto.
2023-05-24Use negative values to reflect always_current in the temporal cache.Andrew MacLeod1-13/+30
Instead of using 0, use negative timestamps to reflect always_current state. If the value doesn't change, keep the timestamp rather than creating a new one and invalidating any dependencies. PR tree-optimization/109695 * gimple-range-cache.cc (temporal_cache::temporal_value): Return a positive int. (temporal_cache::current_p): Check always_current method. (temporal_cache::set_always_current): Add param and set value appropriately. (temporal_cache::always_current_p): New. (ranger_cache::get_global_range): Adjust. (ranger_cache::set_global_range): set always current first.
2023-05-24Choose better initial values for ranger.Andrew MacLeod1-1/+16
Instead of defaulting to VARYING, fold the stmt using just global ranges. PR tree-optimization/109695 * gimple-range-cache.cc (ranger_cache::get_global_range): Call fold_range with global query to choose an initial value.
2023-05-24RISC-V: Add FRM_ prefix to dynamic rounding mode enumJuzhe-Zhong1-1/+1
An obvious fix to make all enum naming consistent. gcc/ChangeLog: * config/riscv/riscv-protos.h (enum frm_field_enum): Add FRM_ prefix. Signed-off-by: Juzhe-Zhong <juzhe.zhong@rivai.ai>
2023-05-24tree-optimization/109849 - fix fallout of PRE hoisting changeRichard Biener2-8/+24
The PR109849 fix made us no longer hoist some memory loads because of the expression set intersection. We can still avoid to compute the union by simply taking the first sets expressions and leave the pruning of expressions with values not suitable for hoisting to sorted_array_from_bitmap_set. PR tree-optimization/109849 * tree-ssa-pre.cc (do_hoist_insertion): Do not intersect expressions but take the first sets. * gcc.dg/tree-ssa/ssa-hoist-9.c: New testcase.