Re: [PATCH] Share work directories

2023-02-22 Thread Andrew Pinski via Gcc-patches
only source directory; explicitly so they can test that way. You are going to have to expand on why you need defaults.h from the build directory and not the source directory? As far as I Know there is no defaults.h in the build directory even. Do you have another patch which changes tha

Re: RISC-V: Add divmod instruction support

2023-02-18 Thread Andrew Pinski via Gcc-patches
spect I will be needing this kind of patch for the core that I am going to be using. If anything this should be under a tuning option. Thanks, Andrew Pinski > > > Currently, it isn't done for RISC-V. > > > > I've added an expander for DIVMOD which replaces 'rem' with 'mul + s

[PATCH 1/2] Support get_range_query with a nullptr argument

2023-02-17 Thread Andrew Pinski via Gcc-patches
get_range_query didn't support a nullptr argument before and would crash. See also the thread at https://inbox.sourceware.org/gcc/4f6718af-e17a-41ef-a886-f45e4ac3d...@redhat.com/T/ OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: * value-query.h

[PATCH 2/2] Remove #if GIMPLE around 1 - a pattern

2023-02-17 Thread Andrew Pinski via Gcc-patches
This removes the "#if GIMPLE" around the "1 - a" pattern as ssa_name_has_boolean_range (get_range_query) works when cfun is a nullptr. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: * match.pd: Remove #if GIMPLE around the "1 - a" pattern ---

Re: get_range_query vs NULL argument

2023-02-17 Thread Andrew Pinski via Gcc
On Wed, Feb 15, 2023 at 2:30 PM Andrew MacLeod wrote: > > > On 2/15/23 14:50, Andrew Pinski wrote: > > Hi, > >While fixing PR 108354, I came across that > > ssa_name_has_boolean_range calls get_range_query with cfun as the > > argument but sometimes whil

Re: [PATCH] rs6000: fmr gets used instead of faster xxlor [PR93571]

2023-02-17 Thread Andrew Pinski via Gcc-patches
ed. xxlor only exists in newer Power ISA. Thanks, Andrew Pinski > > copyright assignment form is still in the process of being sent. > > Thanks & Regards > Ajit > > rs6000: fmr gets used instead of faster xxlor [PR93571] > > This patch replaces 6

get_range_query vs NULL argument

2023-02-15 Thread Andrew Pinski via Gcc
ications of negation (c.f. fold_negate_expr_1). */ (simplify ``` Note I can only so far reproduce the call to ssa_name_has_boolean_range that causes an issue while building Ada tools (while bootstrapping) because the code that needs to hit this is related to variable sized type accesses. Thanks

Re: XMM/YMM assembly bloat

2023-02-14 Thread Andrew Pinski via Gcc-bugs
On Tue, Feb 14, 2023 at 2:14 PM Owen Cook via Gcc-bugs wrote: > > Adding white space/newlines outside the function also affect the length of > assembly. Note -march=native is dependent on the machine which is being used. IIRC godbolt uses a few different machines and that means the answer which

Re: [RFC PATCH v1 08/10] ifcvt: add if-conversion to conditional-zero instructions

2023-02-13 Thread Andrew Pinski via Gcc-patches
On Mon, Feb 13, 2023 at 10:43 AM Jeff Law wrote: > > > > On 2/13/23 10:32, Richard Sandiford via Gcc-patches wrote: > > Andrew Pinski via Gcc-patches writes: > >> On Fri, Feb 10, 2023 at 2:47 PM Philipp Tomsich > >> wrote: > >>> &g

Re: [PATCH] libgccjit: Add support for machine-dependent builtins

2023-02-11 Thread Andrew Pinski via Gcc-patches
fferent patch too. Splitting out these parts would definitely make it easier for review and make incremental improvements. Thanks, Andrew Pinski > > Thanks for the review.

Re: [RFC PATCH v1 01/10] docs: Document a canonical RTL for a conditional-zero insns

2023-02-10 Thread Andrew Pinski via Gcc-patches
" "rZ,UsM,rZ,Ui1,rZ,UsM,Ui1")))] "!((operands[3] == const1_rtx && operands[4] == constm1_rtx) || (operands[3] == constm1_rtx && operands[4] == const1_rtx))" ;; Final two alternatives should be unreachable, but included for completeness "..." [(se

Re: [RFC PATCH v1 08/10] ifcvt: add if-conversion to conditional-zero instructions

2023-02-10 Thread Andrew Pinski via Gcc-patches
n_else (eq_ne (reg) (const_int 0)) (reg) (const_int 0))) Form instead of the really bad "canonical" form of the above? Thanks, Andrew Pinski > > Architectures that provide a conditional-zero are thus expected to > define an instruction matching this pattern in their backend

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

2023-02-09 Thread Andrew Pinski via Gcc-patches
The problem here is that aarch64_expand_setmem does not change the alignment for strict alignment case. This is version 4 of the fix, major changes from the last version is fixing the way store pairs are handled which allows handling of storing 2 SI mode at a time. This also adds a testcase to

[COMMITTED] tree-optimization: [PR108684] ICE in verify_ssa due to simple_dce_from_worklist

2023-02-09 Thread Andrew Pinski via Gcc-patches
In simple_dce_from_worklist, we were removing an inline-asm which had a vdef. We should not be removing inline-asm which have a vdef as this code does not check to the store. This fixes that oversight. This was a latent bug exposed recently by both VRP and removal of stores to static starting to

Re: [PATCH] testsuite: adjust patterns in RISC-V tests to skip unwind table directives

2023-02-09 Thread Andrew Pinski via Gcc-patches
ideas on how to make the tests less fragile I'm all > ears. > > I didn't actually run the tests and I'm pretty bad at doing regexes in > my head, though. If you ran them and can commit that's good with me, > but LMK if you want me to. Maybe you could use check-function-bodies fo

Re: [PATCH] tree-optimization: [PR108684] ICE in verify_ssa due to simple_dce_from_worklist

2023-02-09 Thread Andrew Pinski via Gcc-patches
On Thu, Feb 9, 2023 at 12:07 AM Richard Biener via Gcc-patches wrote: > > On Wed, Feb 8, 2023 at 8:14 PM Andrew Pinski via Gcc-patches > wrote: > > > > In simple_dce_from_worklist, we were removing an inline-asm which had a vdef > > (due to clobbering memory) but no

[PATCH] When simplifing BFR of an insert, require a mode precision integral type (PR108688)

2023-02-08 Thread Andrew Pinski via Gcc-patches
The same problem as PR 88739 has crept in but this time in match.pd when simplifying bit_field_ref of an bit_insert. That is we are generating a BIT_FIELD_REF of a non-mode-precision integral type. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. PR

[PATCH] tree-optimization: [PR108684] ICE in verify_ssa due to simple_dce_from_worklist

2023-02-08 Thread Andrew Pinski via Gcc-patches
In simple_dce_from_worklist, we were removing an inline-asm which had a vdef (due to clobbering memory) but not unlinking the statement's vdef. This fixes that oversight. This was a latent bug exposed recently by both VRP and removal of stores to static starting to use simple_dce_from_worklist.

Re: [pushed] [PR103541] RA: Implement reuse of equivalent memory for caller saves optimization

2023-02-07 Thread Andrew Pinski via Gcc-patches
cipe for target 'reflect.lo' failed make[7]: *** [reflect.lo] Error 1 Thanks, Andrew Pinski

[COMMITTED, GCC 12] Fix PR 108582: ICE due to PHI-OPT removing a still in use ssa_name.

2023-02-07 Thread Andrew Pinski via Gcc-patches
This patch adds a check in match_simplify_replacement to make sure the middlebb does not have any phi-nodes as we don't currently move those. This was just a thinko from before. Committed on the GCC 12 branch after a bootstrap/test on x86_64-linux-gnu. PR tree-optimization/108582

Re: [PATCH v5 0/5] P1689R5 support

2023-02-02 Thread Andrew Pinski via Gcc-patches
a new POSIX makefile syntax rather than changing C++ here. Thanks, Andrew Pinski > > [P1689R5]: https://isocpp.org/files/papers/P1689R5.html > > I've also added patches to include imported module CMI files and the > module mapper file as dependencies of the compilation. I briefly loo

Re: [PATCH v5 0/5] P1689R5 support

2023-02-02 Thread Andrew Pinski via Gcc
a new POSIX makefile syntax rather than changing C++ here. Thanks, Andrew Pinski > > [P1689R5]: https://isocpp.org/files/papers/P1689R5.html > > I've also added patches to include imported module CMI files and the > module mapper file as dependencies of the compilation. I briefly loo

[PATCH] Simplify "1 - bool_val" to "bool_val ^ 1"

2023-01-31 Thread Andrew Pinski via Gcc-patches
For bool values, it is easier to deal with xor 1 rather than having 1 - a. This is because we are more likely to simplify the xor further in many cases. This is a special case for (MASK - b) where MASK is a powerof2 - 1 and b <= MASK but only for bool ranges ([0,1]) as that is the main case where

[PATCH] Simplify "1 - bool_val" to "bool_val ^ 1"

2023-01-31 Thread Andrew Pinski via Gcc-patches
For bool values, it is easier to deal with xor 1 rather than having 1 - a. This is because we are more likely to simplify the xor further in many cases. This is a special case for (MASK - b) where MASK is a powerof2 - 1 and b <= MASK but only for bool ranges ([0,1]) as that is the main case where

Re: [PATCH] expr.cc: avoid unexpected side effects in expand_expr_divmod optimization

2023-01-30 Thread Andrew Pinski via Gcc-patches
On Thu, Dec 8, 2022 at 2:56 AM Jose E. Marchesi via Gcc-patches wrote: > > The expand_expr_divmod function in expr.cc attempts to optimize cases > where both arguments of a division/modulus are known to be positive > when interpreted as signed. In these cases, both signed division and > unsigned

[PATCH] Fix PR 108582: ICE due to PHI-OPT removing a still in use ssa_name.

2023-01-28 Thread Andrew Pinski via Gcc-patches
This patch adds a check in match_simplify_replacement to make sure the middlebb does not have any phi-nodes as we don't currently move those. This was just a thinko from before. Ok? Bootstrapped and tested on x86_64-linux-gnu with no regressions? PR tree-optimization/108582

Re: [PATCH]AArch64: Fix native detection in the presence of mandatory features which don't have midr values

2023-01-27 Thread Andrew Pinski via Gcc-patches
const unsigned long flags_on; > > + /* If this feature is turned off, these bits also need to be turned off. > > */ > > + const unsigned long flags_off; > > Please don't undo the aarch64_feature_flags abstraction. "long" isn't > enough for x86_32 to aarch6

Re: [PATCH] opts: SANITIZE_ADDRESS wrongly cleared [PR108543]

2023-01-25 Thread Andrew Pinski via Gcc-patches
On Wed, Jan 25, 2023 at 3:26 PM Marek Polacek via Gcc-patches wrote: > > Here we crash on a null fndecl ultimately because we haven't defined > the built-ins described in sanitizer.def. So > builtin_decl_explicit (BUILT_IN_ASAN_POINTER_SUBTRACT); > returns NULL_TREE, causing an ICE later. > >

Re: About ' * ' not recognized

2023-01-20 Thread Andrew Pinski via Gcc-bugs
s in the current working directory. This has nothing to do with GCC really. You can use quotes around the * to force the shell not expanding it such as this: ./mycalc 20 '*' 30 or you use \ to force the shell not to expand what comes after the * like this: ./mycalc 20 \* 30 Thanks, Andrew Pinski > 用法:mycalc 数値1 演算子 数値2

Re: [PATCH] c++: Fix up handling of references to anon union members in initializers [PR53932]

2023-01-19 Thread Andrew Pinski via Gcc-patches
86_64-linux and i686-linux, ok for trunk? I noticed (static) structured bindings has a similar issue but is not fixed by this because this checks to see if it is an anonymous union decl. I filed PR 108474 for that. Thanks, Andrew Pinski > > 2023-01-19 Jakub Jelinek >

Re: [RFC] tree-optimization: fix optimize-out variables passed into func to alloc

2023-01-17 Thread Andrew Pinski via Gcc-patches
NULL(compile with -Os) > } This code is violating C/C++ aliasing rules. You store to data via a "unsigned char*" and then do a load via "int*". You can just use -fno-strict-aliasing if you want your code to just work. Thanks, Andrew Pinski > > If the type of passed ar

[COMMITTED] Remove reference to Solaris 9 in comment of add_options_for_tls

2023-01-16 Thread Andrew Pinski via Gcc-patches
Since r5-172-gd9f069ab4f6450, the code no longer matches the comment as the code for Solaris 9 support was removed. This just updates the comment to reference AIX only as the code does. Committed as obvious. gcc/testsuite/ChangeLog: * lib/target-supports.exp (add_options_for_tls):

Re: [PATCH][pushed] contrib: add 'contrib' to default dirs in update-copyright.py

2023-01-15 Thread Andrew Pinski via Gcc-patches
ither. I wonder how many more were missed too ... Thanks, Andrew Pinski > > Jakub, can you please re-run the script? > > Cheers, > Martin > > contrib/ChangeLog: > > * update-copyright.py: Add contrib as a default dir. > --- > contrib/update-copyright.py | 1

Re: B^HDEAD code generation (AMD64)

2023-01-09 Thread Andrew Pinski via Gcc
On Mon, Jan 9, 2023 at 4:42 PM Stefan Kanthak wrote: > > "Thomas Koenig" wrote: > > > On 09.01.23 12:35, Stefan Kanthak wrote: > >> 20 superfluous instructions of the total 102 instructions! > > > > The proper place for bug reports is https://gcc.gnu.org/bugzilla/ . > > OUCH: there's NO proper

Re: [PATCH] Remove legacy pre-C++ 11 definitions

2023-01-06 Thread Andrew Pinski via Gcc-patches
nnot be used safely in certain contexts (e.g. as sentinels). Redefine NULL to nullptr in order to make it safer. Note that this might confuse system headers, however, by convention they must not be included after this point. */ #ifdef __cplusplus #undef NULL #define NULL nullptr #endif

Re: ICE on trunk with combination of "-Og -fcontracts", repro link in body

2023-01-02 Thread Andrew Pinski via Gcc-bugs
eation through this form is restricted. If creating an account fails, contact gcc-bugzilla-account-requ...@gcc.gnu.org to request a GCC Bugzilla account. You should receive a response within 24 hours." Thanks, Andrew Pinski > > On Mon, Jan 2, 2023 at 1:17 PM Andrew Pinski wrote:

Re: ICE on trunk with combination of "-Og -fcontracts", repro link in body

2023-01-02 Thread Andrew Pinski via Gcc-bugs
Please file a bug to bugzilla. With attaching the source there. This list is for automated emails from bugzilla really and most folks are not tracking the list. Thanks, Andrew On Mon, Jan 2, 2023 at 10:16 AM Gavin Ray via Gcc-bugs wrote: > > Hit the following ICE today, just sharing here to be

Re: [PATCH] loading float member of parameter stored via int registers

2022-12-30 Thread Andrew Pinski via Gcc-patches
_P8_VECTOR && (mode == SImode)) return 1; if (TARGET_P9_VECTOR && (mode == QImode || mode == HImode)) return 1; Which I suspect that means rs6000_modes_tieable_p should return true for SImode and SFmode if TARGET_P8_VECTOR is true. Likewise for TARGET_P9_VECTOR and SFmode and QImode/HImode too. Thanks, Andrew Pinski > > > Segher

Re: Document how to build PGO-optimized GCC version

2022-12-27 Thread Andrew Pinski via Gcc
C community does not provide prebuilt gcc binaries for a few different reasons. But distros do provide more recent prebuilt binaries, you could ask them to build using PGO (some do already I think). Thanks, Andrew Pinski > > Any feedback is appreciated. > > Thanks in advance! > > -- > Best regards, > Alexander Zaitsev

Re: [PATCHv2] Use toplevel configure for GMP and MPFR for gdb

2022-12-20 Thread Andrew Pinski via Gcc-patches
On Tue, Dec 20, 2022 at 10:59 AM Tom Tromey wrote: > > >>>>> "Andrew" == apinski--- via Gdb-patches > >>>>> writes: > > Andrew> From: Andrew Pinski > Andrew> This patch uses the toplevel configure parts for GMP/MPFR for > And

Re: testsuite: Fix pr55569.c excess errors

2022-12-20 Thread Andrew Pinski via Gcc-patches
On Tue, Dec 20, 2022 at 1:22 AM Jonathan Yong via Gcc-patches wrote: > > This fixes the following: It is not obvious from the email, why this patch is needed but I figured it was due to LLP64 targets or some other targets where long is not the same size of the size_t type. I think this patch is

Re: [-Wstringop-overflow=] strncat(3)

2022-12-14 Thread Andrew Pinski via Gcc
overflow=] > 14 |strncat(buf, "!", 1); >|^~~~ > > > So, what? Where's the problem? This function does exactly that: "take an > unterminated character sequence and catenate it to an existing string". Clang > seems to be fine with the code. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83404 and the background of why the warning was added here: https://www.us-cert.gov/bsi/articles/knowledge/coding-practices/strncpy-and-strncat. Thanks, Andrew Pinski > > Cheers, > > Alex > > > -- > <http://www.alejandro-colomar.es/>

Re: [BUG] missing warning for pointer arithmetic out of bounds

2022-12-13 Thread Andrew Pinski via Gcc
On Tue, Dec 13, 2022 at 11:16 AM Alejandro Colomar via Gcc wrote: > > > > On 12/13/22 20:08, Alejandro Colomar wrote: > > Hi! > > > > For the following program: > > > > > > $ cat buf.c > > #include > > > > int main(void) > > { > > char *p, buf[5]; > > > > p

Re: Bug with GCC's handling of lifetimes of implicit-lifetime types

2022-12-10 Thread Andrew Pinski via Gcc
do your code above, as far as I can see. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107115#c10 for what is going wrong. Basically GCC does not have a way to express this in the IR currently and there are proposals there on how to do it. Thanks, Andrew Pinski

Re: A problem of weak & weakref function attribute

2022-12-09 Thread Andrew Pinski via Gcc
On Fri, Dec 9, 2022 at 7:17 PM 刘畅 via Gcc wrote: > > Hi all, > > I met a problem when I was testing the weak attribute and the weakref > attribute of GCC. I've read the documentation and in the 6.33.1 Common > Function Attributes - weakref part I found: > > Without a target given as an

Re: RFC: Make builtin types only valid for some target features

2022-12-05 Thread Andrew Pinski via Gcc
le the right architecture feature, rather than > accidentally using the wrong type. So an error about missing architecture > features is probably good enough in most cases. I did have a patch which improved the situation for the SVE types to provide an error message at compile time when SVE is not enabled but I didn't get any feedback from either the C or C++ front-end folks. https://gcc.gnu.org/pipermail/gcc-patches/2021-November/583786.html I suspect if that patch gets reviewed by the front-end folks, Kewen could use the same infrastructure to error out on the types for rs6000 backend. Thanks, Andrew Pinski > > Thanks, > Richard

Re: [PATCH][GCC][DOC] Relocate list under Deprecated in options.texi to Var

2022-12-04 Thread Andrew Pinski via Gcc-patches
round the text better. Thanks, Andrew Pinski > > gcc/doc > 2018-05-10 Sam Tebbs > > * options.texi (Deprecated): Move list to Var section.

Re: [PATCH] Various pages: SYNOPSIS: Use VLA syntax in function parameters

2022-12-03 Thread Andrew Pinski via Gcc
On Sat, Dec 3, 2022 at 1:05 PM Alejandro Colomar via Gcc wrote: > > Hi! > > I'll probably have to release again before the Debian freeze of Bookworm. > That's something I didn't want to do, but there's some important bug that > affects downstream projects (translation pages), and I need to

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

2022-11-29 Thread Andrew Pinski via Gcc-patches
done even with less than perfect initializer too: e.g. int16x8_t foo(int16_t x, int16_t y) { return (int16x8_t) { x, y, x, y, x, y, x, 0 }; } Which should generate something like: dup v0.8h, w0 dup v1.8h, w1 zip1 v0.8h, v0.8h, v1.8h ins v0.h[7], wzr Thanks, Andrew Pinski > > Code gen at -O3:

Re: [committed] Fix up duplicated duplicated words in comments

2022-11-28 Thread Andrew Pinski via Gcc-patches
ODE" which shows up in the comments of the function calls. Thanks, Andrew Pinski > and for the cases that looked clearly wrong changed them, mostly by removing > one of the duplicated words but in some cases with other changes. > > Committed to trunk as obvious. > > 2022-03-07 Jakub Je

Re: [PATCH 19/56] Revert "Move void_list_node init to common code". (8ff2a92a0450243e52d3299a13b30f208bafa7e0)

2022-11-25 Thread Andrew Pinski via Gcc-patches
On Fri, Nov 25, 2022 at 11:37 PM Zopolis0 via Gcc-patches wrote: > > > How does the Java FE initialize void_list_node? > https://github.com/Zopolis4/gcj/blob/master/gcc/java/builtins.cc#L503 > ``` > void_list_node = end_params_node; > ``` > > end_params_node is defined a couple times around the

Re: Can't build Ada

2022-11-25 Thread Andrew Pinski via Gcc
On Fri, Nov 25, 2022 at 12:08 PM Paul Koning wrote: > > > > > On Nov 25, 2022, at 3:03 PM, Andrew Pinski wrote: > > > > On Fri, Nov 25, 2022 at 11:59 AM Paul Koning via Gcc > > wrote: > >> > >> I'm trying to use fairly recent GCC sources (the

Re: Can't build Ada

2022-11-25 Thread Andrew Pinski via Gcc
iler? If you are building a cross, you need to bootstrap a native compiler first. Thanks, Andrew Pinski > > It fails for several reasons. One is that two source files use [ ] for array > initializer brackets when ( ) is apparently supposed to be used instead. > Once I fix that, I get a

Re: -Warray-bounds interprets int *var as int var[0] ?

2022-11-23 Thread Andrew Pinski via Gcc
gt; > To me this looks like a GCC problem, and older versions of the compiler > don't complain. Or is there actually an issue with that code? Purpose > of the code is to save / restore SREG around a block of code, "nop" in > the example. > > The warning complains about the

Re: [committed] Fix comment typos noticed by Bernhard

2022-11-22 Thread Andrew Pinski via Gcc-patches
On Tue, Nov 22, 2022 at 3:25 PM Jeff Law wrote: > > Minor comment typo fixes as noticed by Bernhard. > > > Installed onto the trunk, Hmm: - int alternative + int bool That seems wrong and might cause a build failure. Thanks, Andrew > > > Jeff > >

Re: [PATCH] constexprify some tree variables

2022-11-18 Thread Andrew Pinski via Gcc-patches
On Fri, Nov 18, 2022 at 12:06 PM Jeff Law via Gcc-patches wrote: > > > On 11/18/22 11:05, apinski--- via Gcc-patches wrote: > > From: Andrew Pinski > > > > Since we use C++11 by default now, we can > > use constexpr for some const decls in tree-core.h. > >

Re: [PATCH] AArch64: Add support for -mdirect-extern-access

2022-11-17 Thread Andrew Pinski via Gcc-patches
On Thu, Nov 17, 2022 at 1:46 PM Fangrui Song wrote: > > On Thu, Nov 17, 2022 at 1:37 PM Andrew Pinski wrote: > > > > On Thu, Nov 17, 2022 at 1:21 PM maskray--- via Gcc-patches > > wrote: > > > > > > > +.. option:: -mdirect-extern-access, -mno-direct-

Re: [PATCH] AArch64: Add support for -mdirect-extern-access

2022-11-17 Thread Andrew Pinski via Gcc-patches
On Thu, Nov 17, 2022 at 1:21 PM maskray--- via Gcc-patches wrote: > > > +.. option:: -mdirect-extern-access, -mno-direct-extern-access > > + > > + Use direct accesses for external data symbols. It avoids a GOT > > indirection > > + on all external data symbols with :option:`-fpie` or

Re: [PATCH] RISC-V: Handle "(a & twobits) == singlebit" in branches using Zbs

2022-11-17 Thread Andrew Pinski via Gcc-patches
On Thu, Nov 17, 2022 at 10:25 AM Andrew Pinski wrote: > > On Sun, Nov 13, 2022 at 12:51 PM Philipp Tomsich > wrote: > > > > Use Zbs when generating a sequence for "if ((a & twobits) == singlebit) ..." > > that can be expressed as bexti + bexti + andn. &

Re: [PATCH] RISC-V: Handle "(a & twobits) == singlebit" in branches using Zbs

2022-11-17 Thread Andrew Pinski via Gcc-patches
+ > ;; A CONST_INT operand that fits into the unsigned half of a > ;; signed-immediate after the top bit has been cleared. > (define_predicate "uimm_extra_bit_operand" > diff --git a/gcc/testsuite/gcc.target/riscv/zbs-if_then_else-01.c > b/gcc/testsuite/gcc.target/riscv/z

Re: [whish] -Wunterminated-string-initialization: new warning

2022-11-13 Thread Andrew Pinski via Gcc
t;), typ1); That is the current code which does this warning even so it is just a matter of adding an option to c-family/c.opt and then having c++-compat enable it and using that new option here. Thanks, Andrew Pinski > > It's hard to keep track of sizes to make sure that the str

Re: [BUG] -Wuninitialized: initialize variable with itself

2022-11-13 Thread Andrew Pinski via Gcc
On Sun, Nov 13, 2022 at 10:41 AM Andrew Pinski wrote: > > On Sun, Nov 13, 2022 at 10:40 AM Andrew Pinski wrote: > > > > On Sun, Nov 13, 2022 at 10:36 AM Alejandro Colomar via Gcc > > wrote: > > > > > > Hi, > > > > > > While di

Re: [BUG] -Wuninitialized: initialize variable with itself

2022-11-13 Thread Andrew Pinski via Gcc
On Sun, Nov 13, 2022 at 10:40 AM Andrew Pinski wrote: > > On Sun, Nov 13, 2022 at 10:36 AM Alejandro Colomar via Gcc > wrote: > > > > Hi, > > > > While discussing some idea for a new feature, I tested the following example > > program: > > > >

Re: [BUG] -Wuninitialized: initialize variable with itself

2022-11-13 Thread Andrew Pinski via Gcc
ninitialized value of the variable in its own initializer, use the -Winit-self option." Thanks, Andrew Pinski > > > It seems obvious that it should give a warning, and in Clang it does: > > > $ clang --version | head -n1 > Debian clang version 14.0.6 > >

Re: [PATCH 4/5] value-range: Add as_string diagnostics helper

2022-11-12 Thread Andrew Pinski via Gcc-patches
else if (TREE_CODE (bound) == INTEGER_CST > + && wi::to_wide (bound) == type_max > + && TYPE_PRECISION (type) != 1) > +return xstrdup ("+INF"); > + else > +return print_generic_expr_to_str (bound); No reason to do xstrdup any more either. > +}

Re: [PATCH 7/7] ifcvt: add if-conversion to conditional-zero instructions

2022-11-12 Thread Andrew Pinski via Gcc-patches
s the normal a==0?0:z expression. Also all canonical forms of RTL should be documented too. They are documented here: https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gccint/Insn-Canonicalizations.html https://gcc.gnu.org/onlinedocs/gccint/machine-descriptions/canonicalization-of-instructions.html gcc/doc/gcc

Re: [PATCH] aarch64: Add support for +cssc

2022-11-11 Thread Andrew Pinski via Gcc-patches
name the aarch64_popcount pattern. Or use a *. Yes it does mess up the diff but the end result seems cleaner. I suspect all of the expands you are changing should be done this similar way too. Thanks, Andrew Pinski > > Thanks, > Kyrill > > gcc/ChangeLog: > > *

Re: [PATCH] fix small const data for riscv

2022-11-11 Thread Andrew Pinski via Gcc-patches
/cpp0x/constexpr-rom.C has some slightly different handling here. Seems like there should be a generic way to add -G0/-msmall-data-limit=0 if we don't want small data for a testcase rather than the current scheme of things. Thanks, Andrew Pinski > --- > gcc/testsuite/gcc.dg/pr25521.c | 3 ++-

Re: [PATCH] c++: init_priority and SUPPORTS_INIT_PRIORITY [PR107638]

2022-11-11 Thread Andrew Pinski via Gcc-patches
ess you use -mcmse option. Seems would be use if you want to use __has_attribute on cmse_nonsecure_entry to get the right value there too. Note I am not blocking this patch for this but just thinking out loud of how to improve this so special casing is not needed. Thanks, Andrew Pinski &g

Re: Different outputs in Gimple pass dump generated by two different architectures

2022-11-11 Thread Andrew Pinski via Gcc
On Fri, Nov 11, 2022 at 12:57 AM Marc Glisse via Gcc wrote: > > On Thu, 10 Nov 2022, Kevin Lee wrote: > > > While looking at the failure for gcc.dg/uninit-pred-9_b.c, I observed that > > x86-64 and risc-v has a different output for the gimple pass since > > r12-4790-g4b3a325f07acebf4 > >

Re: [PATCH (pushed)] sphinx: stop using parallel mode

2022-11-11 Thread Andrew Pinski via Gcc-patches
t for some manuals and it is not critical > for us. This alone should cause us to pause and just revert back to texinfo. People are not going to upgrade sphinx all the time just to get fixes for documentation layout. Texinfo is stable and we should just revert back to it. Thanks, Andrew Pinski > > C

Issues with Sphinx

2022-11-11 Thread Andrew Pinski via Gcc
Can we just revert back to texinfo? Sphinx requires manual page splitting which is a downgrade from texinfo. Stable URLs and links was something which we pushed for fixes for texinfo too. And many other issues with sphinx which makes it better if we revert back to texinfo until those are fixed

Re: [PATCH] Remove SLOW_SHORT_ACCESS from target headers

2022-11-10 Thread Andrew Pinski via Gcc-patches
On Thu, Nov 10, 2022 at 12:47 AM Richard Biener wrote: > > On Thu, Nov 10, 2022 at 2:21 AM Andrew Pinski via Gcc-patches > wrote: > > > > On Wed, Nov 9, 2022 at 5:16 PM apinski--- via Gcc-patches > > wrote: > > > > > > From: Andrew Pinski >

Re: [PATCH, GCC/testsuite] Fix dump-noaddr dumpbase

2022-11-09 Thread Andrew Pinski via Gcc-patches
On Tue, Dec 5, 2017 at 9:50 AM Thomas Preudhomme wrote: > > Hi, > > dump-noaddr test FAILS when $tmpdir is not the same as the directory > where runtest is called from. Note that this does not happen when > running make check because tmpdir is set to srcdir. > > In that case, file mkdir will

Re: [PATCH] Remove SLOW_SHORT_ACCESS from target headers

2022-11-09 Thread Andrew Pinski via Gcc-patches
On Wed, Nov 9, 2022 at 5:16 PM apinski--- via Gcc-patches wrote: > > From: Andrew Pinski > > SLOW_SHORT_ACCESS is defined in bfin and i386 target > headers but the target macro is not used elsewhere. > So let's remove it from those two headers and poison it. Just to add,

Re: [RFC][PATCH] Remove SLOW_BYTE_ACCESS

2022-11-09 Thread Andrew Pinski via Gcc-patches
and look through all of the (active) targets to figure out what is the correct value. I know arm still has it defined incorrectly. MIPS defines it based on MIPS16 which seems wrong too. This will be on my radar for GCC 14. Thanks, Andrew Pinski > > ChangeLog: > 2017-11-17 Wilco Dij

Re: [PATCH] RISC-V: costs: handle BSWAP

2022-11-08 Thread Andrew Pinski via Gcc-patches
so use contrib/gcc-git-customization.sh to install it such that you can use it when doing git commits. After invoking that inside the GCC git; you can just do "git gcc-commit-mklog " Where would be what you normally put for "git commit" (but as if in the toplevel directory). Thanks, Andrew Pinski > > > > > > Jeff

Re: [PATCH] match.pd: rewrite select to branchless expression

2022-11-08 Thread Andrew Pinski via Gcc-patches
mber/584411.html . I have not had time for the last year to go through the comments on that patch and resubmit it though. It seems like you are aiming for one specific case in coremarks rather than a more generic fix too. Thanks, Andrew Pinski > > Michael. > > 2022-11-08 Michael C

Re: [PATCH] Use toplevel configure for GMP and MPFR for gdb

2022-11-08 Thread Andrew Pinski via Gcc-patches
config-2.69 and will make sure I will be using that going forward and when approved use that with the pushed version but I don't see a reason to resubmit the patch otherwise. Thanks, Andrew Pinski > > -- > Andreas Schwab, SUSE Labs, sch...@suse.de > GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 > "And now for something completely different."

Re: why does gccgit require pthread?

2022-11-06 Thread Andrew Pinski via Gcc-patches
On Sun, Nov 6, 2022 at 10:51 PM LIU Hao wrote: > > 在 2022-11-07 12:37, Andrew Pinski 写道: > > > > The original code which used pthread was added in GCC 5 way before GCC > > moved to being written in C++11 which was only in the last 3 years. > > pthread_* functions we

Re: why does gccgit require pthread?

2022-11-06 Thread Andrew Pinski via Gcc
On Sun, Nov 6, 2022 at 10:51 PM LIU Hao wrote: > > 在 2022-11-07 12:37, Andrew Pinski 写道: > > > > The original code which used pthread was added in GCC 5 way before GCC > > moved to being written in C++11 which was only in the last 3 years. > > pthread_* functions we

Re: why does gccgit require pthread?

2022-11-06 Thread Andrew Pinski via Gcc
last 3 years. pthread_* functions were the best choice at the time (2014) but now GCC is written in C++11, I don't see any reason not to move them over to using C++11 threading code. Thanks, Andrew Thanks, Andrew Pinski > > > -- > Best regards, > LIU Hao

Re: [PATCH] [PHIOPT] Add A ? B + CST : B match and simplify optimizations

2022-11-05 Thread Andrew Pinski via Gcc-patches
On Fri, Nov 4, 2022 at 11:17 PM Zhongyunde wrote: > > hi, > This patch is try to fix the issue > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107190, > would you like to give me some suggestion, thanks. This seems like a "simplified" version of

Re: [PATCH 1/2][GCC][AArch64] Implement hint intrinsics for AArch64

2022-11-01 Thread Andrew Pinski via Gcc-patches
On Thu, Jan 10, 2019 at 11:20 AM Srinath Parvathaneni wrote: > > Hi All, > > This patch implements the ACLE hint intrinsics (nop, yield, wfe, wfi, > sev and sevl), for AArch64. Hmm, this (and the corresponding arm patch) was never reviewed. It might be useful to get an updated version which

Re: [PATCH 1/2]middle-end: RFC: On expansion of conditional branches, give hint if argument is a truth type to backend

2022-10-26 Thread Andrew Pinski via Gcc-patches
On Fri, Sep 23, 2022 at 2:26 AM Tamar Christina via Gcc-patches wrote: > > Hi All, > > This is an RFC to figure out how to deal with targets that don't have native > comparisons against QImode values. > > Booleans, at least in C99 and higher are 0-1 valued. This means that we only > really need

Re: [PATCH 2/3]AArch64 Promote function arguments using a paradoxical subreg when beneficial.

2022-10-26 Thread Andrew Pinski via Gcc-patches
On Fri, May 13, 2022 at 10:14 AM Tamar Christina via Gcc-patches wrote: > > Hi All, > > The PROMOTE_MODE always promotes 8 and 16-bit parameters to 32-bits. > This promotion is not required for the ABI which states: > > > ``` > C.9 If the argument is an Integral or Pointer Type, the size of

Re: [PATCH] RISC-V: Support (set (mem) (const_poly_int))

2022-10-23 Thread Andrew Pinski via Gcc-patches
./riscv-gcc/libgcc/unwind-dw2.c":1579:3 -1 (nil)) > + */ > + if (MEM_P (dest)) > + { > + rtx tmp = gen_reg_rtx (mode); > + emit_move_insn (tmp, src); > + emit_move_insn (dest, tmp); Couldn't you just use force_reg here instead of the ab

Re: [PATCH 1/2] Add a parameter for the builtin function of prefetch to align with LLVM

2022-10-20 Thread Andrew Pinski via Gcc-patches
On Thu, Oct 20, 2022 at 10:28 AM Segher Boessenkool wrote: > > On Thu, Oct 20, 2022 at 01:44:15AM +, Jiang, Haochen wrote: > > Maybe the testcase change cause some misunderstanding and concern. > > > > Actually, the patch did not disrupt the previous builtins, as the > > builtin_prefetch > >

Re: [PATCH 1/2] Add a parameter for the builtin function of prefetch to align with LLVM

2022-10-19 Thread Andrew Pinski via Gcc-patches
On Fri, Oct 14, 2022 at 1:40 AM Haochen Jiang via Gcc-patches wrote: > > gcc/ChangeLog: > > * builtins.cc (expand_builtin_prefetch): Handle the fourth parameter > in > expand function. > * config/aarch64/aarch64-sve.md: Add default parameter value. > *

Re: Need help with match.pd crash

2022-10-06 Thread Andrew Pinski via Gcc
ional moves which might be better than doing an and/neg/and/xor. AARCH64 and MIPS are good examples of that (I know because I spent time making sure GCC produces the conditional moves for coremarks for those targets inside crc8). Thanks, Andrew Pinski > I get a internal error, but in stepping throu

Re: [RFC] c++: parser - Support for target address spaces in C++

2022-10-06 Thread Andrew Pinski via Gcc
on either; https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1275.pdf has the definition of it for C and GCC tries to follow that. Fixed types support in GCC also follows that draft. Thanks, Andrew Pinski > > Depending on the reception, I'll add further testcases and will update > th

Re: [PATCH] RISC-V: Default to tuning for the thead-c906

2022-10-04 Thread Andrew Pinski via Gcc-patches
On Tue, Oct 4, 2022 at 8:55 PM Palmer Dabbelt wrote: > > The C906 is by far the most widely available RISC-V processor, so let's > default to tuning for it. > > gcc/ChangeLog > > * config/riscv/riscv.h (RISCV_TUNE_STRING_DEFAULT): Change to > thead-c906. > *

Re: How do I create a GCC source code tarball?

2022-10-04 Thread Andrew Pinski via Gcc
On Mon, Oct 3, 2022 at 4:32 PM Robert Dubner wrote: > > I have modified the source code of GCC, and I need a tarball for that > modified source. > > My code is based on the trunk branch of the repository at > git://gcc.gnu.org/git/gcc.git > > I attempted to execute "make dist", and have

Re: gcc-bug in gcc-11

2022-10-04 Thread Andrew Pinski via Gcc
ough but you could do a "git bisect" to find the patch or ask a few people who have pre-built binaries to find the patch which fixed it. I doubt we are going to backport the fix to a GCC 11 release either since it is NOT a regression from an earlier version. Thanks, Andrew Pinski > > Thanks and regards > Shivam

Re: [PATCH 1/2]middle-end Fold BIT_FIELD_REF and Shifts into BIT_FIELD_REFs alone

2022-09-26 Thread Andrew Pinski via Gcc-patches
On Sun, Sep 25, 2022 at 9:56 PM Tamar Christina wrote: > > > -Original Message- > > From: Andrew Pinski > > Sent: Saturday, September 24, 2022 8:57 PM > > To: Tamar Christina > > Cc: gcc-patches@gcc.gnu.org; nd ; rguent...@suse.de > >

Re: [PATCH 1/2]middle-end Fold BIT_FIELD_REF and Shifts into BIT_FIELD_REFs alone

2022-09-24 Thread Andrew Pinski via Gcc-patches
; += build_nonstandard_integer_type (newsize, 1); } Maybe use `build_nonstandard_integer_type (newsize, /* unsignedp = */ true);` or better yet `build_nonstandard_integer_type (newsize, UNSIGNED);` I had started to convert some of the unsignedp into enum signop but I never finished or submi

Re: [PATCH] Add support for floating point endpoints to frange.

2022-08-26 Thread Andrew Pinski via Gcc-patches
On Fri, Aug 26, 2022 at 12:16 PM Aldy Hernandez wrote: > > On Fri, Aug 26, 2022 at 7:40 PM Andrew Pinski wrote: > > > > On Fri, Aug 26, 2022 at 8:55 AM Aldy Hernandez wrote: > > > > > > [pinskia: I'm CCing you as the author of the match.pd pattern.] > &

Re: [PATCH] Add support for floating point endpoints to frange.

2022-08-26 Thread Andrew Pinski via Gcc-patches
g that can be done by improving the match.pd pattern, > or should be done elsewhere? Oh the pattern which is supposed to catch this does: (simplify (cnd (cmp @0 zerop) integer_zerop (negate@1 @0)) (if (!HONOR_SIGNED_ZEROS (type)) @1)) Notice the integer_zerop here. fold_cond_expr_with_com

Re: [PATCH 0/3] picolibc: Add picolibc linking help

2022-08-24 Thread Andrew Pinski via Gcc
at up for arm, nds32, riscv and sh targets. What OS libraries are not included in libc? I trying to figure out why this needs to be special cased here. Thanks, Andrew Pinski > > Keith Packard (3): > Allow default libc to be specified to configure > Add newlib and picolibc as de

Re: [PATCH 0/3] picolibc: Add picolibc linking help

2022-08-24 Thread Andrew Pinski via Gcc-patches
at up for arm, nds32, riscv and sh targets. What OS libraries are not included in libc? I trying to figure out why this needs to be special cased here. Thanks, Andrew Pinski > > Keith Packard (3): > Allow default libc to be specified to configure > Add newlib and picolibc as de

<    4   5   6   7   8   9   10   11   12   13   >