[PATCH] MATCH: Add pattern for `signbit(x) ? x : -x` into abs (and swapped)

2023-05-13 Thread Andrew Pinski via Gcc-patches
This adds a simple pattern to match.pd for `signbit(x) ? x : -x` into abs. This can be done for all types even ones that honor signed zeros and NaNs because both signbit and - are considered only looking at/touching the sign bit of those types and does not trap either. OK? Bootstrapped and tested

Re: [PATCH 05/14] m2: use _P() defines from tree.h

2023-05-13 Thread Gaius Mulley via Gcc-patches
Bernhard Reutner-Fischer via Gcc-patches writes: > From: Bernhard Reutner-Fischer > > gcc/m2/ChangeLog: > > * gm2-gcc/m2builtins.cc (doradix): Use _P defines from tree.h. > (doplaces): Ditto. > (doexponentmin): Ditto. > (doexponentmax): Ditto. > (dolarge): Ditto. >

Re: [PATCH 05/14] m2: use _P() defines from tree.h

2023-05-13 Thread Gaius Mulley via Gcc-patches
Bernhard Reutner-Fischer via Gcc-patches writes: > From: Bernhard Reutner-Fischer > > gcc/m2/ChangeLog: > > * gm2-gcc/m2builtins.cc (doradix): Use _P defines from tree.h. > (doplaces): Ditto. > (doexponentmin): Ditto. > (doexponentmax): Ditto. > (dolarge): Ditto. >

[PATCH 06/14] lto: use _P() defines from tree.h

2023-05-13 Thread Bernhard Reutner-Fischer via Gcc-patches
From: Bernhard Reutner-Fischer gcc/ChangeLog: * lto-streamer-in.cc (lto_input_var_decl_ref): Use _P defines from tree.h. (lto_read_body_or_constructor): Ditto. * lto-streamer-out.cc (tree_is_indexable): Ditto. (lto_output_var_decl_ref): Ditto. (DFS

[PATCH 14/14] gcc: use _P() defines from tree.h

2023-05-13 Thread Bernhard Reutner-Fischer via Gcc-patches
From: Bernhard Reutner-Fischer gcc/ChangeLog: * alias.cc (ref_all_alias_ptr_type_p): Use _P() defines from tree.h. * attribs.cc (diag_attr_exclusions): Ditto. (decl_attributes): Ditto. (build_type_attribute_qual_variant): Ditto. * builtins.cc (fold_builtin

[PATCH 00/14] use _P() defines from tree.h

2023-05-13 Thread Bernhard Reutner-Fischer via Gcc-patches
From: Bernhard Reutner-Fischer Dear maintainers I propose the following mechanical change to use the defines in tree.h. (Common convention is to use the defines as per tree.h, which is what we keep telling people.) Exceptions applied to the generator here: NULL_TREE # we want to retain "NULL"

[PATCH 09/14] rust: use _P() defines from tree.h

2023-05-13 Thread Bernhard Reutner-Fischer via Gcc-patches
From: Bernhard Reutner-Fischer gcc/rust/ChangeLog: * backend/rust-compile-expr.cc (CompileExpr::type_cast_expression): Use _P() defines from tree.h * backend/rust-tree.cc (build_cplus_array_type): Ditto. * backend/rust-tree.h (ARITHMETIC_TYPE_P): Ditto. (g

[PATCH 01/14] ada: use _P() defines from tree.h

2023-05-13 Thread Bernhard Reutner-Fischer via Gcc-patches
From: Bernhard Reutner-Fischer gcc/ada/ChangeLog: * gcc-interface/decl.cc (gnat_to_gnu_entity): Use _P defines from tree.h. (constructor_address_p): Ditto. (elaborate_expression_1): Ditto. * gcc-interface/trans.cc (Identifier_to_gnu): Ditto. (is_nr

[PATCH 04/14] c++: use _P() defines from tree.h

2023-05-13 Thread Bernhard Reutner-Fischer via Gcc-patches
From: Bernhard Reutner-Fischer gcc/cp/ChangeLog: * call.cc (promoted_arithmetic_type_p): Use _P defines from tree.h. (build_conditional_expr): Ditto. (convert_like_internal): Ditto. (convert_arg_to_ellipsis): Ditto. (build_over_call): Ditto. (compa

[PATCH 03/14] gcc/config/*: use _P() defines from tree.h

2023-05-13 Thread Bernhard Reutner-Fischer via Gcc-patches
From: Bernhard Reutner-Fischer gcc/ChangeLog: * config/aarch64/aarch64.cc (aarch64_short_vector_p): Use _P defines from tree.h. (aarch64_mangle_type): Ditto. * config/alpha/alpha.cc (alpha_in_small_data_p): Ditto. (alpha_gimplify_va_arg_1): Ditto.

[PATCH 08/14] fortran: use _P() defines from tree.h

2023-05-13 Thread Bernhard Reutner-Fischer via Gcc-patches
From: Bernhard Reutner-Fischer gcc/fortran/ChangeLog: * trans-array.cc (is_pointer_array): Use _P() defines from tree.h. (gfc_conv_scalarized_array_ref): Ditto. (gfc_conv_array_ref): Ditto. * trans-decl.cc (gfc_finish_decl): Ditto. (gfc_get_symbol_decl): D

[PATCH 05/14] m2: use _P() defines from tree.h

2023-05-13 Thread Bernhard Reutner-Fischer via Gcc-patches
From: Bernhard Reutner-Fischer gcc/m2/ChangeLog: * gm2-gcc/m2builtins.cc (doradix): Use _P defines from tree.h. (doplaces): Ditto. (doexponentmin): Ditto. (doexponentmax): Ditto. (dolarge): Ditto. (dosmall): Ditto. (dogUnderflow): Ditto.

[PATCH 11/14] objc: use _P() defines from tree.h

2023-05-13 Thread Bernhard Reutner-Fischer via Gcc-patches
From: Bernhard Reutner-Fischer gcc/objc/ChangeLog: * objc-act.cc (objc_volatilize_decl): Use _P() defines from tree.h. (objc_is_global_reference_p): Ditto. (objc_generate_write_barrier): Ditto. (objc_gimplify_property_ref): Ditto. * objc-next-runtime-abi-0

[PATCH 12/14] go: use _P() defines from tree.h

2023-05-13 Thread Bernhard Reutner-Fischer via Gcc-patches
From: Bernhard Reutner-Fischer gcc/go/ChangeLog: * go-gcc.cc (Gcc_backend::fill_in_array): Use _P() defines from tree.h. (Gcc_backend::named_type): Ditto. (Gcc_backend::convert_expression): Ditto. (operator_to_tree_code): Ditto. (Gcc_backend::init_statemen

[PATCH 13/14] omp: use _P() defines from tree.h

2023-05-13 Thread Bernhard Reutner-Fischer via Gcc-patches
From: Bernhard Reutner-Fischer gcc/ChangeLog: * omp-low.cc (scan_sharing_clauses): Use _P() defines from tree.h. (lower_reduction_clauses): Ditto. (lower_send_clauses): Ditto. (lower_omp_task_reductions): Ditto. * omp-oacc-neuter-broadcast.cc (install_var_

[PATCH 10/14] c: use _P() defines from tree.h

2023-05-13 Thread Bernhard Reutner-Fischer via Gcc-patches
From: Bernhard Reutner-Fischer gcc/c-family/ChangeLog: * c-ada-spec.cc (has_static_fields): Use _P() defines from tree.h. (dump_ada_declaration): Ditto. (dump_ada_structure): Ditto. * c-common.cc (unsafe_conversion_p): Ditto. (shorten_compare): Ditto.

[PATCH 07/14] d: use _P() defines from tree.h

2023-05-13 Thread Bernhard Reutner-Fischer via Gcc-patches
From: Bernhard Reutner-Fischer gcc/d/ChangeLog: * d-codegen.cc (underlying_complex_expr): Use _P defines from tree.h. * d-convert.cc (convert): Ditto. (convert_for_rvalue): Ditto. --- gcc/d/d-codegen.cc | 2 +- gcc/d/d-convert.cc | 9 - 2 files changed, 5 inserti

[PATCH 02/14] analyzer: use _P() defines from tree.h

2023-05-13 Thread Bernhard Reutner-Fischer via Gcc-patches
From: Bernhard Reutner-Fischer gcc/analyzer/ChangeLog: * region-model-manager.cc (get_code_for_cast): Use _P defines from tree.h. (region_model_manager::get_or_create_cast): Ditto. (region_model_manager::get_region_for_global): Ditto. * region-model.cc (re

Re: [PATCH] libffi: fix handling of homogeneous float128 structs [PR109447]

2023-05-13 Thread Peter Bergner via Gcc-patches
On 5/10/23 2:34 AM, Andreas Schwab wrote: > On Mai 09 2023, Peter Bergner via Gcc-patches wrote: >> I'm sorry to be dense, but can you point to the specific line? In my >> $GCC_BUILD/Makefile, the only mention of LD_LIBRARY_PATH is: >> >> RPATH_ENVVAR = LD_LIBRARY_PATH >> >> ...so that isn't set

[PATCH v3] Machine_Mode: Extend machine_mode from 8 to 16 bits

2023-05-13 Thread Pan Li via Gcc-patches
From: Pan Li We are running out of the machine_mode(8 bits) in RISC-V backend. Thus we would like to extend the machine_mode bit size from 8 to 16 bits. However, it is sensitive to extend the memory size in common structure like tree or rtx. This patch would like to extend the machine_mode bits t

RE: [PATCH] Machine_Mode: Extend machine_mode from 8 to 16 bits

2023-05-13 Thread Li, Pan2 via Gcc-patches
Oops, looks missed this part when I search all machine_mode by word. Thanks kito for catching this. It seems there is no easy way to remind the developer to change (for example 16 to 32 bits) the below part in future, how about add some comments to MACHINE_MODE_BITSIZE for this? Pan -Orig

[PATCH] RISC-V: Support TARGET_VECTORIZE_PREFERRED_VECTOR_ALIGNMENT to optimize codegen of RVV auto-vectorization

2023-05-13 Thread juzhe . zhong
From: Juzhe-Zhong This patch support vector alignement for RVV auto-vectorization. Consider this following case: void __attribute__((noinline, noclone)) f (int * __restrict dst, int * __restrict op1, int * __restrict op2, int count) { for (int i = 0; i < count; ++i) dst[i] = op1[i] + op2[i

Re: [PATCH] tree: Fix up save_expr [PR52339]

2023-05-13 Thread Eric Botcazou via Gcc-patches
> I think we really need Eric (as one who e.g. introduced the > DECL_INVARIANT_P apparently for this kind of stuff) to have a look at that > on the Ada side. I have been investigating this for a few days and it's no small change for Ada and probably for other languages with dynamic types. SAVE_E

[PATCH V2] Provide -fcf-protection=branch,return.

2023-05-13 Thread liuhongt via Gcc-patches
> I think this could be simplified if you use either EnumSet or > EnumBitSet instead in common.opt for `-fcf-protection=`. Use EnumSet instead of EnumBitSet since CF_FULL is not power of 2. It is a bit tricky for sets classification, cf_branch and cf_return should be in different sets, but they bo

Re: [Patch] LTO: Fix writing of toplevel asm with offloading [PR109816]

2023-05-13 Thread Thomas Schwinge
Hi! On 2023-05-12T14:46:21+0200, Tobias Burnus wrote: > Long standing issue but as top-level 'asm' statement were rare, it did not > show up. Thanks for tracking this down, and fixing it! Presumably latent "forever" (here: since code offloading support was added, approximately one decade ago).

Re: [aarch64] Use dup and zip1 for interleaving elements in initializing vector

2023-05-13 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 12 May 2023 at 00:37, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > diff --git a/gcc/testsuite/gcc.target/aarch64/vec-init-18.c > > b/gcc/testsuite/gcc.target/aarch64/vec-init-18.c > > new file mode 100644 > > index 000..598a51f17c6 > > --- /dev/null > > +++ b/gcc/

Re: [PATCH] Machine_Mode: Extend machine_mode from 8 to 16 bits

2023-05-13 Thread Kito Cheng via Gcc-patches
Hi Pan: Tried this patch and I ran into some issues, some variables are using unsigned char to hold machine mode and will have problems when the number of modes is larger than 255... And here is the fix: diff --git a/gcc/genmodes.cc b/gcc/genmodes.cc index 715787b8f483..55ac2adb5596 100644 ---