[PATCH] Add initial octeontx2 support.

2020-01-10 Thread apinski
From: Andrew Pinski This adds octeontx2 naming. It currently uses the cortexa57 cost model and schedule model until I submit this. This is more a place holder to get the naming of the cores in GCC 10. I will submit the cost model in the next couple of days. OK? Bootstrapped and tested on aarc

[PATCHv2] Add initial octeontx2 support.

2020-01-11 Thread apinski
From: Andrew Pinski This adds octeontx2 naming. It currently uses the cortexa57 cost model and schedule model until I submit this. This is more a place holder to get the naming of the cores in GCC 10. I will submit the cost model in the next couple of days. OK? Bootstrapped and tested on aarc

[PATCH] Decrease cortexa57_extra_costs's alu.shift_reg

2020-01-11 Thread apinski
From: Andrew Pinski Like I mentioned in https://gcc.gnu.org/ml/gcc/2020-01/msg00157.html, The shift by a register should be just COSTS_N_INSNS (1) rather than COSTS_N_INSNS (2). This allows lshift_cheap_p to return true now and converting switches to be using shift and other like structures. I

[PATCH 1/2] Fix uninitialized field in expand_operand.

2020-01-15 Thread apinski
From: Andrew Pinski Commit g:f96bf49a0 added the target field to expand_operand. But it leaves it uninitialized when doing a full initialization inside create_expand_operand. This fixes the problem and improves the code generation inside create_expand_operand too. OK? Bootstrapped and tested on

[PATCH 2/2] Uninitialized padding in struct _dep.

2020-01-15 Thread apinski
From: Andrew Pinski In struct _dep, there is an implicit padding of 4bits. This bit-field padding is uninitialized when init_dep_1 is being called. This means we access uninitialized memory but never use it for anything. Adding an unused bit-field field and initializing it in init_dep_1 will im

[PATCH] Fix value numbering dealing with reverse byte order

2020-01-16 Thread apinski
From: Andrew Pinski Hi, While working on bit-field lowering pass, I came across this bug. The IR looks like: VIEW_CONVERT_EXPR(var1) = _12; _1 = BIT_FIELD_REF ; Where the BIT_FIELD_REF has REF_REVERSE_STORAGE_ORDER set on it and var1's type has TYPE_REVERSE_STORAGE_ORDER set on it. PRE/FRE

[PATCH] Fix target/93119 (aarch64): ICE with traditional TLS support on ILP32

2020-01-17 Thread apinski
From: Andrew Pinski The problem here was g:23b88fda665d2f995c was not a complete fix for supporting tranditional TLS on ILP32. So the problem here is a couple of things, first __tls_get_addr call will return a C pointer value so we need to use ptr_mode when we are creating the call. Then we nee

[PATCH] Fix PR 93242: patchable-function-entry broken on MIPS

2020-01-17 Thread apinski
From: Andrew Pinski On MIPS, .set noreorder/reorder needs to emitted around the nop. The template for the nop instruction uses %(/%) to do that. But default_print_patchable_function_entry uses fprintf rather than output_asm_insn to output the instruction. This fixes the problem by using output

[PATCH] Manually handle recursiveness in prepare_block_for_update

2020-01-19 Thread apinski
From: Andrew Pinski Reported as PR 93321, prepare_block_for_update with some huge recusive inlining can go past the stack limit. The loop at the end, could be transformed such that the last iteration goes back to the begining of the function instead of the call. This reduces the stack usage and

[PATCHv2] Change recursive prepare_block_for_update to use a worklist

2020-01-21 Thread apinski
From: Andrew Pinski Reported as PR 93321, prepare_block_for_update with some huge recusive inlining can go past the stack limit. Transforming this recursive into worklist improves the stack usage here and we no longer seg fault for the testcase. Note the order we OK? Bootstrapped and tested on

[PATCH/commited] Change recursive prepare_block_for_update to use a worklist

2020-01-21 Thread apinski
From: Andrew Pinski This is what I committed. Reported as PR 93321, prepare_block_for_update with some huge recusive inlining can go past the stack limit. Transforming this recursive into worklist improves the stack usage here and we no longer seg fault for the testcase. Note the order we walk

[PATCH] Fix target/93119 (aarch64): ICE with traditional TLS support on ILP32

2020-01-21 Thread apinski
From: Andrew Pinski This is what I committed after Richard's comments. The problem here was g:23b88fda665d2f995c was not a complete fix for supporting tranditional TLS on ILP32. So the problem here is a couple of things, first __tls_get_addr call will return a C pointer value so we need to use

[PATCH] Allow tree-ssa.exp to be run by itself

2020-01-21 Thread apinski
From: Andrew Pinski tree-ssa testcases sometimes check autovect effective target but does not set it up. On MIPS, those testcases fail with some TCL error messages. This fixes the issue by calling check_vect_support_and_set_flags inside tree-ssa.exp. There might be other .exp files which need t

[committed/PATCH] Revert "Allow tree-ssa.exp to be run by itself" and move some testcases

2020-01-22 Thread apinski
From: Andrew Pinski This reverts commit 9085381f1931cc3667412c8fff91878184835901 as it was causing default dg-do to be set incorrectly on most targets. Instead move testcases that are vect related testcase that use "dg-require-effective-target vect_*" to the vect test area. Committed as obvious

[PATCH] Fix patchable-function-entry on arc

2020-01-22 Thread apinski
From: Andrew Pinski The problem here is arc looks at current_output_insn unconditional but sometimes current_output_insn is NULL. With patchable-function-entry, it will be. This is similar to how the nios2, handles "%.". Committed as obvious after a simple test with -fpatchable-function-entry=1

[PATCH] Fix gcc.target/aarch64/vec_zeroextend.c for big-endian

2020-01-25 Thread apinski
From: Andrew Pinski vec_zeroextend.c fails on big-endian as it assumes 0 index is the lower part but it is not for big-endian case. This fixes the problem by using the correct index for the lower part for big-endian. Committed as obvious after a test on aarch64_be-linux-gnu. Thanks, Andrew Pin

[PATCH] Add link to porting_to.html from the changes page for GCC 9

2020-02-05 Thread apinski
From: Andrew Pinski Looks like the porting_to page was not linked to the changes page for GCC 9. So uncomments it out. Committed as obvious. --- htdocs/gcc-9/changes.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/gcc-9/changes.html b/htdocs/gcc-9/changes.html index c0e581fe..

[COMMITTED] aarch64: fix strict alignment for vector load/stores (PR 91927)

2020-02-08 Thread apinski
From: Andrew Pinski Hi, The problem here is that the vector mode version of movmisalign was only conditionalized on if SIMD was enabled instead of being also conditionalized on STRICT_ALIGNMENT too. Applied as pre-approved in the bug report by Richard Sandiford after a bootstrap/test on aarch6

[PATCH] aarch64: Allow -mcpu=generic -march=armv8.5-a

2020-02-13 Thread apinski
From: Andrew Pinski Right if someone supplies a -mcpu= option and then overrides that option with -march=*, we get a warning when they conflict. What we need is a generic cpu for each arch level but that is not that useful because the only difference would be the arch level. The best option is to

[PATCH] Fix 'A' operand modifier: PR inline-asm/94095

2020-03-09 Thread apinski
From: Andrew Pinski The problem here is there was a typo in the documentation for the 'A' modifier in the table, it was recorded as 'a' in the table on the modifier column. Committed as obvious. 2020-03-09 Andrew Pinski PR inline-asm/94095 * doc/extend.texi (x86 Operand Modi

[PATCH] Fix libstdc++ compiling for an aarch64 multilib with big-endian.

2019-11-23 Thread apinski
From: Andrew Pinski Hi if we have a aarch64 compiler that has a big-endian multi-lib, it fails to compile libstdc++ because simd_fast_mersenne_twister_engine is only defined for little-endian in ext/random but ext/opt_random.h thinks it is defined always. OK? Built an aarch64-elf toolchain whic

[PATCH] [PATCH/AARCH64] Use neon_move instead of move_logic in some places

2019-03-10 Thread apinski
From: Andrew Pinski Hi, In some places in the aarch64 backend, neon_logic is used for mov v0.16b, v1.16b mov v0., v1. This patch moves them over to use neon_move instead. For most cores, this does not matter but for OcteonTX2 core it does matter. OK? Bootstrapped and tested on aarch64-linux-g

[PATCH] [AARCH64] Improve vector generation cost model

2019-03-14 Thread apinski
From: Andrew Pinski Hi, On OcteonTX2, ld1r and ld1 (with a single lane) are split into two different micro-ops unlike most other targets. This adds three extra costs to the cost table: ld1_dup: used for "ld1r {v0.4s}, [x0]" merge_dup: used for "dup v0.4s, v0.4s[0]" and "ins v0.4s[0], v0.4s[0]"

[PATCH] Fix PR 81721: ICE with PCH and Pragma warning and C++ operator

2019-04-01 Thread apinski
From: Andrew Pinski Hi, The problem here is the token->val.node is not saved over a precompiled header for C++ operator. This can cause an internal compiler error as we tried to print out the spelling of the token as we assumed it was valid. The fix is to have cpp_token_val_index return CPP_TO

[PATCH] Fix tree-opt/PR106087: ICE with inline-asm with multiple output and assigned only static vars

2022-07-07 Thread apinski--- via Gcc-patches
From: Andrew Pinski The problem here is that when we mark the ssa name that was referenced in the now removed dead store (to a write only static variable), the inline-asm would also be removed even though it was defining another ssa name. This fixes the problem by checking to make sure that the

[COMMITTED] Fix tree-opt/PR106087: ICE with inline-asm with multiple output and assigned only static vars

2022-07-08 Thread apinski--- via Gcc-patches
From: Andrew Pinski The problem here is that when we mark the ssa name that was referenced in the now removed dead store (to a write only static variable), the inline-asm would also be removed even though it was defining another ssa name. This fixes the problem by checking to make sure that the

[COMMITED] [RSIC-V] Fix 32bit riscv with zbs extension enabled

2022-08-04 Thread apinski--- via Gcc-patches
From: Andrew Pinski The problem here was a disconnect between splittable_const_int_operand predicate and the function riscv_build_integer_1 for 32bits with zbs enabled. The splittable_const_int_operand predicate had a check for TARGET_64BIT which was not needed so this patch removed it. Committe

[COMMITTED] Move testcase gcc.dg/tree-ssa/pr93776.c to gcc.c-torture/compile/pr93776.c

2022-08-07 Thread apinski--- via Gcc-patches
From: Andrew Pinski Since this testcase is not exactly SSA specific and it would be a good idea to compile this at more than just at -O1, moving it to gcc.c-torture/compile would do that. Committed as obvious after a test on x86_64-linux-gnu. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/

[PATCH] Fix middle-end/103645: empty struct store not removed when using compound literal

2022-08-07 Thread apinski--- via Gcc-patches
From: Andrew Pinski For compound literals empty struct stores are not removed as they go down a different path of the gimplifier; trying to optimize the init constructor. This fixes the problem by not adding the gimple assignment at the end of gimplify_init_constructor if it was an empty type. N

[PATCH] Fix PR c++/66590: incorrect warning "reaches end of non-void function" for switch

2021-08-13 Thread apinski--- via Gcc-patches
From: Andrew Pinski So the problem here is there is code in the C++ front-end not to add a break statement (to the IR) if the previous block does not fall through. The problem is the code which does the check to see if the block may fallthrough does not check a CLEANUP_STMT; it assumes it is alwa

[PATCH 1/2] Add gimple_truth_valued_p to match.pd and use it

2021-08-13 Thread apinski--- via Gcc-patches
From: Andrew Pinski While working on some more boolean optimizations, I noticed that there are places which does SSA_NAME@0 and then look at then either use get_nonzero_bits or ssa_name_has_boolean_range to see if the ssa name had a boolean range. This cleans this up slightly by have a simple mat

[PATCH 2/2] Fix 101805: Simplify min/max of boolean arguments

2021-08-13 Thread apinski--- via Gcc-patches
From: Andrew Pinski I noticed this while Richard B. fixing PR101756. Basically min of two bools is the same as doing an "and" and max of two bools is doing an "ior". gcc/ChangeLog: * match.pd: Add min/max patterns for bool types. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/bool

[PATCH] Add range/nonzero info to generated ADD_OVERFLOW and simplify

2021-08-13 Thread apinski--- via Gcc-patches
From: Andrew Pinski Even though this does not change the generated code, it does improve the initial RTL generation. gcc/ChangeLog: * tree-ssa-math-opts.c (match_arith_overflow): Add range and nonzero bits information to the new overflow ssa name. Also fold the

[PATCH] Fix a few problems with download_prerequisites.

2021-08-23 Thread apinski--- via Gcc-patches
From: Andrew Pinski There are a few problems with download_prerequisites are described in PR 82704. The first is on busy-box version of shasum and md5sum the extended option --check don't exist so just use -c. The second issue is the code for which shasum program to use is included twice and is

[PATCH] Fix PR 90142: contrib/download_prerequisites uses test ==

2021-08-30 Thread apinski--- via Gcc-patches
From: Andrew Pinski Since == is not portable, it is better to use = in contrib/ download_prerequisites. The only place == was used is inside the function md5_check which is used only on Mac OS X. Tested on Mac OS X as: ./contrib/download_prerequisites --md5 Both with all files having the correc

[PATCH] Fix PR driver/79181 (and others), not deleting some /tmp/cc* files for LTO.

2021-08-30 Thread apinski--- via Gcc-patches
From: Andrew Pinski So the main issue here is that some signals are not setup unlike collect2. So this merges the setting up of the signal handlers to one function in collect-utils and has collect2 and lto-wrapper call that function. OK? Bootstrapped and tested on x86_64-linux-gnu with no regres

[PATCH] Fix gcc.dg/ipa/inline-8.c for -fPIC

2021-08-30 Thread apinski--- via Gcc-patches
From: Andrew Pinski The problem here is with -fPIC, both cmp and move don't bind locally so they are not even tried to be inlined. This fixes the issue by marking both functions as static and now the testcase passes for both -fPIC and -fno-PIC cases. OK? Tested on x86_64-linux-gnu. gcc/testsui

[PATCH] Fix tree-optimization/101941: IPA splitting out function with error attribute

2022-01-18 Thread apinski--- via Gcc-patches
From: Andrew Pinski The Linux kernel started to fail compile when the jump threader was improved (r12-2591-g2e96b5f14e4025691). This failure was due to the IPA splitting code decided now to split off the basic block which contained two functions, one of those functions included the error attribut

[PATCH] [COMMITTED] Improve coment for the newly added code in ipa-split.

2022-01-18 Thread apinski--- via Gcc-patches
From: Andrew Pinski It was pointed out to me by Jakub, that the comment in front of the new code which handles warning/error attribute was not really understandable. This fixes the comment to be understandable; I don't know why I wrote the original comment that way even. Committed as obvious aft

[PATCH] [aarch64/64821]: Simplify __builtin_aarch64_sqrt* into internal function .SQRT.

2022-01-23 Thread apinski--- via Gcc-patches
From: Andrew Pinski This is a simple patch which simplifies the __builtin_aarch64_sqrt* builtins into the internal function SQRT which allows for constant folding and other optimizations at the gimple level. It was originally suggested we do to __builtin_sqrt just for __builtin_aarch64_sqrtdf whe

[PATCH v3] [AARCH64] Fix PR target/103100 -mstrict-align and memset on not aligned buffers

2022-01-25 Thread apinski--- via Gcc-patches
From: Andrew Pinski The problem here is that aarch64_expand_setmem does not change the alignment for strict alignment case. This is version 3 of this patch, is is based on version 2 and moves the check for the number of instructions from the optimizing for size case to be always and change the co

[PATCH] aarch64: [PR101529] Fix vector shuffle insertion expansion

2022-01-26 Thread apinski--- via Gcc-patches
From: Andrew Pinski The function aarch64_evpc_ins would reuse the target even though it might be the same register as the two inputs. Instead of checking to see if we can reuse the target, just use the original input directly. Committed as approved after bootstrapped and tested on aarch64-linux-

[PATCH] Fix aarch64/104201: branch-protection-attr.c fails after quoting difference

2022-01-27 Thread apinski--- via Gcc-patches
From: Andrew Pinski After the quoting changes in r12-6521-g03a1a86b5ee40d4e240, branch-protection-attr.c fails due to expecting a different quoting type for "leaf". This patch changes the quoting from "" to '' as that is what is used now. Committed as obvious after a test of the testcase. gcc/

[PATCH] Fix comment for operand_compare::operand_equal_p.

2022-01-31 Thread apinski--- via Gcc-patches
From: Andrew Pinski The OEP_* enums were moved to tree-core.h in r0-124973-g5e351e960763 but the comment was correct when it was added added to fold-const.h in r10-4231-g7f4a8ee03d40. This fixes the reference to the OEP_* enum to reference tree-core. Committed as obvious after a bootstrap/test o

[PATCH] [COMMITTED] Change multiprecision.org to use https

2022-02-01 Thread apinski--- via Gcc-patches
From: Andrew Pinski As reported at https://gcc.gnu.org/pipermail/gcc/2022-February/238216.html, multiprecision.org now uses https so this updates the documentation to use https instead of http. Committed as obvious. gcc/ChangeLog: * doc/install.texi: --- gcc/doc/install.texi | 2 +- 1

[PATCH] [COMMITTED] Fix PR aarch64/104474: ICE with vector float initializers and non-consts.

2022-02-09 Thread apinski--- via Gcc-patches
From: Andrew Pinski The problem here is that the aarch64 back-end was placing const0_rtx into the constant vector RTL even if the mode was a floating point mode. The fix is instead to use CONST0_RTX and pass the mode to select the correct zero (either const_int or const_double). Committed as obv

[PATCH] c: [PR104506] Fix ICE after error due to change of type to error_mark_node

2022-02-18 Thread apinski--- via Gcc-patches
From: Andrew Pinski The problem here is we end up with an error_mark_node when calling useless_type_conversion_p and that ICEs. STRIP_NOPS/tree_nop_conversion has had a check for the inner type being an error_mark_node since g9a6bb3f78c96 (2000). This just adds the check also to tree_ssa_useless_

[PATCH v2] Fix PR tree-optimization/103228 and 103228: folding of (type) X op CST where type is a nop convert

2021-11-17 Thread apinski--- via Gcc-patches
From: Andrew Pinski Currently we fold (type) X op CST into (type) (X op ((type-x) CST)) when the conversion widens but not when the conversion is a nop. For the same reason why we move the widening conversion (the possibility of removing an extra conversion), we should do the same if the conve

[PATCH] Fix PR 103317, ICE after PHI-OPT, minmax_replacement producing invalid SSA

2021-11-18 Thread apinski--- via Gcc-patches
From: Andrew Pinski The problem is r12-5300-gf98f373dd822b35c allows phiopt to recognize more basic blocks but missed one location where the basic block does not need to be empty but still needs to have a single predecessor. This patch fixes that over sight. OK? Bootstrapped and tested on x86_

[PATCH v2] [AARCH64] Fix PR target/103100 -mstrict-align and memset on not aligned buffers

2021-11-18 Thread apinski--- via Gcc-patches
From: Andrew Pinski The problem here is that aarch64_expand_setmem does not change the alignment for strict alignment case. This is a simplified patch from what I had previously. So constraining copy_limit to the alignment of the mem in the case of strict align fixes the issue without checking

[PATCH] Fix tree-optimization/103314 : Limit folding of (type) X op CST where type is a nop convert to gimple

2021-11-18 Thread apinski--- via Gcc-patches
From: Andrew Pinski There is some re-association code in fold_binary which conflicts with this optimization due keeping around some "constants" which are not INTEGER_CST (1 << -1) so we end up in an infinite loop because of that. So we need to limit this case to GIMPLE level only. OK? Bootstrapp

[PATCH] Fix tree-optimization/103220: Another missing folding of (type) X op CST where type is a nop convert

2021-11-19 Thread apinski--- via Gcc-patches
From: Andrew Pinski The problem here is that int_fits_type_p will return false if we just change the sign of things like -2 (or 254) so we should accept the case where we just change the sign (and not the precision) of the type. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions

[PATCH] tree-optimization: [PR31531] Improve ~a < CST, allow a nop cast inbetween ~ and a

2021-11-21 Thread apinski--- via Gcc-patches
From: Andrew Pinski This PR was orignally for the missed optimization of a few isnegative which had been solved a long time ago (sometime before 4.4.0). I noticed there was one missed optimization on the gimple level. There is a match.pd pattern for ~a < CST but we miss that there could be a nop_

[PATCH 1/2] Improve/Fix (m1 CMP m2) * d -> (m1 CMP m2) ? d : 0 pattern.

2021-11-21 Thread apinski--- via Gcc-patches
From: Andrew Pinski The pattern here was not catching all comparisons and the multiply was not commutative when it should have been. This patches fixes that by using tcc_comparison and adding :c to the multiply. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog:

[PATCH 2/2] tree-optimization: [PR92342] Move b & -(a==c) optimization to the gimple level

2021-11-21 Thread apinski--- via Gcc-patches
From: Andrew Pinski Combine disabled this optimization in r10-254-gddbb5da5199fb42 but it makes sense to do this on the gimple level and then let expand decide which way is better. So this adds the transformation on the gimple level (late like was done for the multiply case). OK? Bootstrapped an

[PATCH v2] Canonicalize &MEM[ssa_n, CST] to ssa_n p+ CST in fold_stmt_1

2021-11-22 Thread apinski--- via Gcc-patches
From: Andrew Pinski This is a new version of the patch to fix PR 102216. Instead of doing the canonicalization inside forwprop, Richi mentioned we should do it inside fold_stmt_1 and that is what this patch does. PR tree-optimization/102216 gcc/ChangeLog: * gimple-fold.c (fold_

[PATCH] Fix PR 62157: disclean in libsanitizer not working

2021-11-27 Thread apinski--- via Gcc-patches
From: Andrew Pinski So what is happening is DIST_SUBDIRS contains the conditional directories which is wrong, so we need to force DIST_SUBDIRS to be the same as SUBDIRS as recommened by the automake manual. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. Also now make distcl

[PATCH] Fix PR 19089: Environment variable TMP may yield gcc: abort

2021-11-27 Thread apinski--- via Gcc-patches
From: Andrew Pinski Even though I cannot reproduce the ICE any more, this is still a bug. We check already to see if we can access the directory but never check to see if the path is actually a directory. This adds the check and now we reject the file as not usable as a tmp directory. OK? Boots

[PATCH] tree-optimization: [PR101540] Simplify CONSTRUCTOR for vector(1) to be VCE

2021-11-28 Thread apinski--- via Gcc-patches
From: Andrew Pinski This just adds a simplification to simplify_vector_constructor for vector of 1 element to be VCE which should reduce memory usage in the compiler and maybe allow for some more optimizations. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. PR tree

[PATCH] [Committed] New testcase for C++/71792, bitfields and auto

2021-12-03 Thread apinski--- via Gcc-patches
From: Andrew Pinski This testcase used to fail before GCC 6.4.0 due to the wrong type being used for auto when used with bitfields, the C++ front-end was using the "bitfield" type rather than the underlaying type. Committed the testcase after a quick check. PR c++/71792 gcc/testsuite/C

[PATCH] Fix C++/93809 and C++/83469: typenames and unions

2021-12-07 Thread apinski--- via Gcc-patches
From: Andrew Pinski There are a few issues here with typenames and unions (and even struct keywords with unions). First in cp_parser_check_class_key, we need to allow typenames to name union types and union key to be able to use with typenames. The next issue is we need to record if we had a uni

[PATCH] Use simple_dce_from_worklist with match_simplify_replacement.

2022-10-27 Thread apinski--- via Gcc-patches
From: Andrew Pinski This is a simple patch to do some DCE after a successful match and simplify replacement in PHI-OPT. match and simplify likes to generate some extra statements which should be cleaned up. OK? Bootstrapped and tested on x86_64-linux with no regressions. Thanks, Andrew Pinski

[PATCH 1/2] Fix PR 105532: match.pd patterns calling tree_nonzero_bits with vector types

2022-11-02 Thread apinski--- via Gcc-patches
From: Andrew Pinski Even though this PR was reported with an ubsan issue, the problem is tree_nonzero_bits is being called with an expression which is a vector type. This fixes three patterns I noticed which does that. And adds a testcase for one of the patterns. OK? Bootstrapped and tested on x

[PATCH 0/2] tree_nonzero_bits vs vector and complex types

2022-11-02 Thread apinski--- via Gcc-patches
From: Andrew Pinski While looking at older unconfirmed bug reports, I noticed there was an ubsan found issue and noticed tree_nonzero_bits was being called with a vector type. How ubsan found it was at the end of tree_nonzero_bits, did "return wi::shwi (-1, TYPE_PRECISION (TREE_TYPE (t)));" and

[PATCH 2/2] Add assert for type on tree_nonzero_bits

2022-11-02 Thread apinski--- via Gcc-patches
From: Andrew Pinski Right now anyone could call tree_nonzero_bits with either complex or vector types and this will return the wrong thing. So just assert that nobody calls it with this. OK? Bootstrapped and tested with no regressions on x86_64-linux-gnu. gcc/ChangeLog: * fold-const.cc

[COMMITTED] [AARCH64] Remove reference to MD_INCLUDES

2022-08-11 Thread apinski--- via Gcc-patches
From: Andrew Pinski The comment reference to MD_INCLUDES is not needed as it is auto generated for long time now even before aarch64 target was added. MD_INCLUDES has been auto generated since r0-64489. Note some targets still manually set MD_INCLUDES and I suspect those can be changed but I don

[PATCH 04/10] [RISCV] Add the list of operand modifiers to riscv.md too

2022-08-18 Thread apinski--- via Gcc-patches
From: Andrew Pinski To make it easier to find operands modifiers while in the md file, add the list of modifiers to the top of the md file. This is similar to i386 target. OK? Built and tested for riscv32-linux-gnu and riscv64-linux-gnu. gcc/ChangeLog: * config/riscv/riscv.cc (riscv_pr

[PATCH 00/10] [RISCV] Fix/improve the RISCV backend

2022-08-18 Thread apinski--- via Gcc-patches
From: Andrew Pinski This set of patches fixes a few RISCV issues and does a few cleanups. Including moving all of the iterators to iterators.md like many newer backends. It also fixes a few PRs which I filed including the RISCV32 issue with ZBS enabled. Thanks, Andrew Pinski Andrew Pinski (10):

[PATCH 02/10] [RISCV] Move iterators from bitmanip.md to iterators.md

2022-08-18 Thread apinski--- via Gcc-patches
From: Andrew Pinski Just like the previous patch this move all of the iterators of bitmanip.md to iterators.md. All modern backends put the iterators in iterators.md for easier access. OK? Built and tested for riscv32-linux-gnu with --with-arch=rv32imafdc_zba_zbb_zbc_zbs. Thanks, Andrew Pinsk

[PATCH 03/10] [RISCV] Move iterators from sync.md to iterators.md

2022-08-18 Thread apinski--- via Gcc-patches
From: Andrew Pinski Like the previous two patches this moves the iterators that are in sync.md to iterators.md. OK? build and tested for riscv64-linux-gnu. gcc/ChangeLog: * config/riscv/sync.md (any_atomic, atomic_optab): Move to ... * config/riscv/iterators.md: Here. --- gcc/

[PATCH 01/10] [RISCV] Move iterators from riscv.md to iterators.md

2022-08-18 Thread apinski--- via Gcc-patches
From: Andrew Pinski This moves the iterators out from riscv.md to iterators.md like most modern backends. I have not moved the iterators from the other .md files yet. OK? Build and tested on riscv64-linux-gnu and riscv32-linux-gnu. Thanks, Andrew Pinski gcc/ChangeLog: * config/riscv/r

[PATCH 06/10] [RISCV] Use constraints/predicates instead of checking const_int directly for shNadd patterns

2022-08-18 Thread apinski--- via Gcc-patches
From: Andrew Pinski This simplifies the code by adding a predicate and a constraint for 1/2/3. The aarch64 backend has a similar predicate called aarch64_shift_imm_ which they use there. OK? Built and tested on riscv32-linux-gnu and riscv64-linux-gnu with no regressions. Thanks, Andrew Pinski

[PATCH 08/10] [RISCV] Fix PR 106586: riscv32 vs ZBS

2022-08-18 Thread apinski--- via Gcc-patches
From: Andrew Pinski The problem here is two fold. With RISCV32, 32bit const_int are always signed extended to 64bit in HWI. So that means for SINGLE_BIT_MASK_OPERAND, it should mask off the upper bits to see it is a single bit for !TARGET_64BIT. Plus there are a few locations which forget to call

[PATCH 09/10] [RISCV] Add constraints for not_single_bit_mask_operand/single_bit_mask_operand

2022-08-18 Thread apinski--- via Gcc-patches
From: Andrew Pinski Like a previous patch, just add constraints for predicates not_single_bit_mask_operand and single_bit_mask_operand. OK? Built and tested for riscv32-linux-gnu and riscv64-linux-gnu. Thanks, Andrew Pinski gcc/ChangeLog: * config/riscv/constraints.md (DbS): New const

[PATCH 10/10] [RISCV] Fix PR 106632 and PR 106588 a few constraints in bitmanip.md

2022-08-18 Thread apinski--- via Gcc-patches
From: Andrew Pinski The constraints should be n instead of i. Also there needs to a check for out of bounds zero_extract for *bexti. gcc/ChangeLog: PR target/106632 PR target/106588 * config/riscv/bitmanip.md (*shNadduw): Use n constraint instead of i. (*

[PATCH 07/10] [RISCV] Use a constraint for bset_mask and bset_1_mask

2022-08-18 Thread apinski--- via Gcc-patches
From: Andrew Pinski A constraint here just makes it easier to understand what the operands are. OK? Built and tested on riscv32-linux-gnu and riscv64-linux-gnu with --with-arch=rvNimafdc_zba_zbb_zbc_zbs (where N is 32 and 64). Thanks, Andrew Pinski gcc/ChangeLog: * config/riscv/constr

[PATCH 05/10] [RISCV] Add %~ to print w if TARGET_64BIT and use it

2022-08-18 Thread apinski--- via Gcc-patches
From: Andrew Pinski To make things easier and more maintainable, we need to add support printing out w if TARGET_64BIT so this patch adds %~ to do that, similar how the x86 backend uses %~ to print out i/f for TARGET_AVX2. We could have chosen any punctuation symbol but ~ looks the closest to w.

[PATCH 2/3] Fix PR 106601: __builtin_bswap16 code gen could be improved with ZBB enabled

2022-08-20 Thread apinski--- via Gcc-patches
From: Andrew Pinski The default expansion for bswap16 is two extractions (shift/and) followed by an insertation (ior) and then a zero extend. This can be improved with ZBB enabled to just full byteswap followed by a (logical) shift right. This patch adds a new pattern for this which does that. O

[PATCH 0/3] [RISCV] Improve bswap for ZBB

2022-08-20 Thread apinski--- via Gcc-patches
From: Andrew Pinski Just some improvements for bswap and ZBB including a testsuite change that will allow more testing to happen. Thanks, Andrew Pinski Andrew Pinski (3): Fix PR 106600: __builtin_bswap32 is not hooked up for ZBB for 32bit Fix PR 106601: __builtin_bswap16 code gen could be

[PATCH 1/3] Fix PR 106600: __builtin_bswap32 is not hooked up for ZBB for 32bit

2022-08-20 Thread apinski--- via Gcc-patches
From: Andrew Pinski The problem here is the bswap2 pattern had a check for TARGET_64BIT but then used the X iterator. Since the X iterator is either SI or DI depending on the setting TARGET_64BIT, there is no reason for the TARGET_64BIT. OK? Built and tested on both riscv32-linux-gnu and riscv64

[PATCH 3/3] Fix PR 106690: enable effective_target_bswap for RISCV targets with ZBB enabled by default

2022-08-20 Thread apinski--- via Gcc-patches
From: Andrew Pinski While looking for testcases to quickly test, I Noticed that check_effective_target_bswap was not enabled for riscv when ZBB is enabled. This patch checks if ZBB is enabled when targeting RISCV* for bswap. OK? Ran the testsuite for riscv32-linux-gnu both with and without ZBB e

[PATCH] Fix target/101934: aarch64 memset code creates unaligned stores for -mstrict-align

2021-08-31 Thread apinski--- via Gcc-patches
From: Andrew Pinski The problem here is the aarch64_expand_setmem code did not check STRICT_ALIGNMENT if it is creating an overlapping store. This patch adds that check and the testcase works. gcc/ChangeLog: PR target/101934 * config/aarch64/aarch64.c (aarch64_expand_setmem):

[PATCH] Add MIPS Linux support to gcc.misc-tests/linkage.c (testsuite/51748)

2021-08-31 Thread apinski--- via Gcc-patches
From: Andrew Pinski This adds MIPS Linux support to gcc.misc-tests/linkage.exp. Basically copying what was done for MIPS IRIX and changing the options to be correct. OK? gcc/testsuite/ChangeLog: PR testsuite/51748 * gcc.misc-tests/linkage.exp: Add mips*-linux-* support. --- g

[PATCH] Fix target/102173 ICE after error recovery

2021-09-02 Thread apinski--- via Gcc-patches
From: Andrew Pinski After the recent r12-3278-823685221de986a change, the testcase gcc.target/aarch64/sve/acle/general-c/type_redef_1.c started to ICE as the code was not ready for error_mark_node in the type. This fixes that and the testcase now passes. gcc/ChangeLog: * config/aarch64

[PATCH] [aarch64] Fix target/95969: __builtin_aarch64_im_lane_boundsi interferes with gimple

2021-09-02 Thread apinski--- via Gcc-patches
From: Andrew Pinski This patch adds simple folding of __builtin_aarch64_im_lane_boundsi where we are not going to error out. It fixes the problem by the removal of the function from the IR. OK? Bootstrapped and tested on aarch64-linux-gnu with no regressions. gcc/ChangeLog: * config/aa

[PATCH] Fix some GC issues in the aarch64 back-end.

2021-09-02 Thread apinski--- via Gcc-patches
From: Andrew Pinski I got some ICEs in my latest testsing while running the libstdc++ testsuite. I had noticed the problem was connected to types and had just touched the builtins code but nothing which could have caused this and I looked for some types/variables that were not being marked with G

[PATCHv2] [aarch64] Fix target/95969: __builtin_aarch64_im_lane_boundsi interferes with gimple

2021-09-03 Thread apinski--- via Gcc-patches
From: Andrew Pinski This patch adds simple folding of __builtin_aarch64_im_lane_boundsi where we are not going to error out. It fixes the problem by the removal of the function from the IR. OK? Bootstrapped and tested on aarch64-linux-gnu with no regressions. gcc/ChangeLog: PR target/9

[PATCH] Fix PR tree-opt/63184: add simplification of (& + A) != (& + B)

2021-09-05 Thread apinski--- via Gcc-patches
From: Andrew Pinski These two testcases have been failing since GCC 5 but things have improved such that adding a simplification to match.pd for this case is easier than before. In the end we have the following IR: _5 = &a[1] + _4; _7 = &a + _13; if (_5 != _7) So we can fold the _5 !=

[PATCH] Fix PR lto/49664: liblto_plugin.so exports too many symbols

2021-09-12 Thread apinski--- via Gcc-patches
From: Andrew Pinski So right now liblto_plugin.so exports many libiberty symbols and simple_object file symbols but really it just needs to export onload. This fixes the problem by using "-export-symbols-regex onload" on the libtool link line. lto-plugin/ChangeLog: * Makefile.am: Expor

[PATCH] Remove m32r{,le}-*-linux* support from GCC

2021-09-13 Thread apinski--- via Gcc-patches
From: Andrew Pinski m32r support never made it to glibc and the support for the Linux kernel was removed with 4.18. It does not remove much but no reason to keep around a port which never worked or one which the support in other projects is gone. OK? Checked to make sure m32r-linux and m32rle-li

[PATCH] Fix PR 67102: Add libstdc++ dependancy to libffi

2021-09-15 Thread apinski--- via Gcc-patches
From: Andrew Pinski The error message is obvious -funconfigured-libstdc++-v3 is used on the g++ command line. So we just add the dependancy. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. ChangeLog: * Makefile.def: Have configure-target-libffi depend on a

[PATCH 1/2] Fix PR bootstrap/102389: --with-build-config=bootstrap-lto is broken

2021-09-17 Thread apinski--- via Gcc-patches
From: Andrew Pinski So the problem here is that now the lto-plugin requires NM that works with LTO to work so we need to pass down NM just like we do for ranlib and ar. OK? Bootstrapped and tested with --with-build-config=bootstrap-lto on aarch64-linux-gnu. Note you need to use binutils 2.35 or

[PATCH 2/2] Update the section on binutils version

2021-09-17 Thread apinski--- via Gcc-patches
From: Andrew Pinski LTO usage requires binutils 2.35 or newer due to https://sourceware.org/PR25355. This adds a note in the prerequisites page about it. Ok? gcc/ChangeLog: * doc/install.texi: Add note about binutils 2.35 is required for LTO usage. --- gcc/doc/install.texi | 3

[PATCH] Fix middle-end/102395: reg_class having only NO_REGS and ALL_REGS.

2021-09-18 Thread apinski--- via Gcc-patches
From: Andrew Pinski So this is a simple fix is to just add to the assert that sclass and dclass are both greater than or equal to NO_REGS. NO_REGS is documented as the first register class so it should have the value of 0. gcc/ChangeLog: * lra-constraints.c (check_and_process_move): Ass

[PATCH] c: [PR32122] Require pointer types for computed gotos

2021-09-19 Thread apinski--- via Gcc-patches
From: Andrew Pinski So GCC has always accepted non-pointer types in computed gotos but that was wrong based on the documentation: Any expression of type void * is allowed. So this fixes the problem by requiring the type to be a pointer type. OK? Bootstrapped and tested on x86_64-linux-gnu with

[PATCH] Fix PR c/94726: ICE with __builtin_shuffle and changing of types

2021-09-26 Thread apinski--- via Gcc-patches
From: Andrew Pinski The problem here is __builtin_shuffle when called with two arguments instead of 1, uses a SAVE_EXPR to put in for the 1st and 2nd operand of VEC_PERM_EXPR and when we go and gimplify the SAVE_EXPR, the type is now error_mark_node and that fails hard. This fixes the problem by

[COMMITTED] Fix some testcases after my computed goto patch

2021-09-29 Thread apinski--- via Gcc-patches
From: Andrew Pinski For some reason I did not see these failures in my testing. Sorry about that. Anyways this fixes the testcases by adding a cast to __INTPTR_TYPE__ and then a cast to void*. Committed after testing them on x86_64-linux-gnu. gcc/testsuite/ChangeLog: * gcc.c-torture/c

[PATCH] [www] Add note about computed gotos to changes and porting guide

2021-09-29 Thread apinski--- via Gcc-patches
From: Andrew Pinski Even though there is not many computed gotos in the wild and even less that would use an integer type, it would still be a good idea to add this new error message to both changes and the porting to guide. OK? --- htdocs/gcc-12/changes.html| 6 ++-- htdocs/gcc-12/porting

[PATCH] Fix PR target/103100 -mstrict-align and memset on not aligned buffers

2021-11-05 Thread apinski--- via Gcc-patches
From: Andrew Pinski The problem here is with -mstrict-align, aarch64_expand_setmem needs to check the alginment of the mode to make sure we can use it for doing the stores. gcc/ChangeLog: PR target/103100 * config/aarch64/aarch64.c (aarch64_expand_setmem): Add check for

[PATCH] aarch64: [PR101529] Fix vector shuffle insertion expansion

2021-11-06 Thread apinski--- via Gcc-patches
From: Andrew Pinski The function aarch64_evpc_ins would reuse the target even though it might be the same register as the two inputs. Instead of checking to see if we can reuse the target, creating a new register always is better. OK? Bootstrapped and tested on aarch64-linux-gnu with no regressi

  1   2   3   >