Re: [patch]: Implement PR104327 for avr

2023-05-24 Thread Richard Biener via Gcc
On Tue, May 23, 2023 at 2:56 PM Georg-Johann Lay wrote: > > PR target/104327 not only affects s390 but also avr: > The avr backend pre-sets some options depending on optimization level. > The inliner then thinks that always_inline functions are not eligible > for inlining and terminates with an er

Re: [patch]: Implement PR104327 for avr

2023-05-24 Thread Richard Biener via Gcc
On Wed, May 24, 2023 at 5:44 PM Georg-Johann Lay wrote: > > > > Am 24.05.23 um 11:38 schrieb Richard Biener: > > On Tue, May 23, 2023 at 2:56 PM Georg-Johann Lay wrote: > >> > >> PR target/104327 not only affects s390 but also avr: > >> The avr backend pre-sets some options depending on optimizat

Re: [patch]: Implement PR104327 for avr

2023-05-25 Thread Richard Biener via Gcc
> Am 25.05.2023 um 16:22 schrieb Georg-Johann Lay : > >  > >> Am 25.05.23 um 08:35 schrieb Richard Biener: >>> On Wed, May 24, 2023 at 5:44 PM Georg-Johann Lay wrote: >>> Am 24.05.23 um 11:38 schrieb Richard Biener: On Tue, May 23, 2023 at 2:56 PM Georg-Johann Lay wrote: > > P

Re: gcc tricore porting

2023-06-19 Thread Richard Biener via Gcc
On Sun, Jun 18, 2023 at 12:00 PM Claudio Eterno via Gcc wrote: > > Hi, this is my first time with open source development. I worked in > automotive for 22 years and we (generally) were using tricore series for > these products. GCC doesn't compile on that platform. I left my work some > days ago a

Re: Different ASM for ReLU function between GCC11 and GCC12

2023-06-20 Thread Richard Biener via Gcc
On Mon, Jun 19, 2023 at 9:45 PM Jakub Jelinek via Gcc wrote: > > On Mon, Jun 19, 2023 at 09:10:53PM +0200, André Günther via Gcc wrote: > > I noticed that a simple function like > > auto relu( float x ) { > > return x > 0.f ? x : 0.f; > > } > > compiles to different ASM using GCC11 (or lower)

GCC 13.1.1 Status Report (2023-06-23)

2023-06-23 Thread Richard Biener via Gcc
Status == The gcc-13 branch is open for regression and documentation fixes. It's time to plan for a GCC 13.2 release which should follow roughly two to three months after the .1 release. The plan is to do a release candidate for GCC 13.2 on Thursday, Jul 20th with the release following a w

GCC 10.4.1 Status Report (2023-06-23)

2023-06-23 Thread Richard Biener via Gcc
Status == The gcc-10 branch is open for regression and documentation fixes. The last release from the branch, GCC 10.5, before it is being closed is due. There will be a release candidate next week, Friday, June 30th followed by the actual release a week later on July 7th. Please check if

Re: [gimple-ssa] Get the gimple corresponding to the definition of a VAR_DECL

2023-06-27 Thread Richard Biener via Gcc
On Tue, Jun 27, 2023 at 11:36 AM Pierrick Philippe wrote: > > Hi everyone, > > I'm trying to get the gimple * associated to the definition of a given > var_decl. > Basically, I am iterating over the locals of a function (through the > local_decls member) and I need to be able to get the gimple * o

Re: CLOBBER(eol)

2023-06-27 Thread Richard Biener via Gcc
On Tue, Jun 27, 2023 at 12:07 PM Krister Walfridsson via Gcc wrote: > > I'm working on an updated version of my translation validator [*], and I > have some problems with CLOBBER(eol). > > I currently treat CLOBBER(eol) as making the memory invalid (i.e. all > subsequent accesses is undefined beha

Re: types in GIMPLE IR

2023-06-28 Thread Richard Biener via Gcc
On Wed, Jun 28, 2023 at 5:47 PM Michael Matz via Gcc wrote: > > Hello, > > On Wed, 28 Jun 2023, Krister Walfridsson via Gcc wrote: > > > Type safety > > --- > > Some transformations treat 1-bit types as a synonym of _Bool and mix the > > types > > in expressions, such as: > > > >_2; >

Re: types in GIMPLE IR

2023-06-29 Thread Richard Biener via Gcc
On Thu, Jun 29, 2023 at 2:06 PM Krister Walfridsson wrote: > > On Thu, 29 Jun 2023, Richard Biener wrote: > > > The thing with signed bools is that the two relevant values are -1 (true) > > and 0 (false), those are used for vector bool components where we also > > need them to be of wider type (32

GCC 10.4.1 Status Report (2023-06-30), branch frozen for release

2023-06-29 Thread Richard Biener via Gcc
Status == The gcc-10 branch is frozen for release and closing. All changes require release manager approval. Previous Report === https://gcc.gnu.org/pipermail/gcc/2023-June/241839.html

GCC 10.5 Release Candidate available from gcc.gnu.org

2023-06-30 Thread Richard Biener via Gcc
The first release candidate for GCC 10.5 is available from https://gcc.gnu.org/pub/gcc/snapshots/10.5.0-RC-20230630/ and shortly its mirrors. It has been generated from git commit r10-11483-g8c12c47d0c5c40. I have so far bootstrapped and tested the release candidate on x86_64-linux. Please tes

Re: Stepping down as maintainer for ARC and Epiphany

2023-07-05 Thread Richard Biener via Gcc
On Wed, Jul 5, 2023 at 8:44 PM Joern Rennecke wrote: > > I haven't worked with these targets in years and can't really do sensible > maintenance or reviews of patches for them. > I am currently working on optimizations for other ports like RISC-V. > > ARC has still an active maintainer in Claudiu

Re: [RFC] Exposing complex numbers to target backends

2023-07-06 Thread Richard Biener via Gcc
On Wed, Jul 5, 2023 at 5:14 PM Sylvain Noiry via Gcc wrote: > > Hi, > > My name is Sylvain, I am an intern at Kalray and I work on improving the GCC > backend for the KVX target. The KVX ISA has dedicated instructions for the > handling of complex numbers, which cannot be selected by GCC due to

Re: semantics of uninitialized values in GIMPLE

2023-07-06 Thread Richard Biener via Gcc
On Fri, Jul 7, 2023 at 1:23 AM Krister Walfridsson via Gcc wrote: > > I have implemented support for uninitialized memory in my translation > validator. But I am not sure how well this corresponds to the GIMPLE > semantics, so I have some questions... > > My implementation tracks uninitialized bit

GCC 10.5 Released

2023-07-07 Thread Richard Biener via Gcc
The GNU Compiler Collection version 10.5 has been released. GCC 10.5 is a bug-fix release from the GCC 10 branch containing important fixes for regressions and serious bugs in GCC 10.4 with more than 155 bugs fixed since the previous release. This is also the last release from the GCC 10 branch,

GCC 10 branch is now closed

2023-07-07 Thread Richard Biener via Gcc
After the GCC 10.5 release the GCC 10 branch is now closed. Thanks, Richard.

Re: Inquiry about SME support for gcov modifications

2023-07-07 Thread Richard Biener via Gcc
On Thu, Jul 6, 2023 at 11:15 PM Daria Shatalinska via Gcc wrote: > > Hello, > > My name is Daria Shatalinska and I am a Project Manager at Freelancer. I am > contacting you to see if you might be interested in collaborating with us > on a project for NASA's Open Innovation Services program (NOIS2)

Re: semantics of uninitialized values in GIMPLE

2023-07-11 Thread Richard Biener via Gcc
On Tue, Jul 11, 2023 at 12:56 AM Krister Walfridsson wrote: > > On Fri, 7 Jul 2023, Richard Biener wrote: > > >> I have implemented support for uninitialized memory in my translation > >> validator. But I am not sure how well this corresponds to the GIMPLE > >> semantics, so I have some questions.

Re: semantics of uninitialized values in GIMPLE

2023-07-11 Thread Richard Biener via Gcc
On Tue, Jul 11, 2023 at 10:29 AM Krister Walfridsson wrote: > > On Tue, 11 Jul 2023, Richard Biener wrote: > > >> With "plain copies", do you mean treating it as it is always defined? That > >> would prevent optimizations such as transforming > >> > >>int t; > >>if (1) > >> t = *p; >

Re: m68k Coldfire and PC-relative addressing distances

2023-07-11 Thread Richard Biener via Gcc
On Tue, Jul 11, 2023 at 11:36 AM Florian Weimer via Gcc wrote: > > How does the Coldfire m68k subtarget and sure that displacements in PIC > code are within the addressable range? There is usually a branch shortening pass relying on correct instruction lengths. I suggest to file a bugreport with

GCC 13.2 Released

2023-07-27 Thread Richard Biener via Gcc
The GNU Compiler Collection version 13.2 has been released. GCC 13.2 is the first bug-fix release from the GCC 13 branch containing important fixes for regressions and serious bugs in GCC 13.1 with more than 58 bugs fixed since the previous release. This release is available from the WWW servers

Re: [Predicated Ins vs Branches] O3 and PGO result in 2x performance drop relative to O2

2023-07-31 Thread Richard Biener via Gcc
On Mon, Jul 31, 2023 at 2:57 PM Changbin Du via Gcc wrote: > > Hello, folks. > This is to discuss Gcc's heuristic strategy about Predicated Instructions and > Branches. And probably something needs to be improved. > > [The story] > Weeks ago, I built a huffman encoding program with O2, O3, and PGO

Re: Should GCC warn about sizeof(flexible_struct)?

2023-08-13 Thread Richard Biener via Gcc
On Fri, Aug 11, 2023 at 8:30 PM Alejandro Colomar via Gcc wrote: > > Hi! > > Structures with flexible array members have restrictions about being > used in arrays or within other structures, as the size of the enclosing > aggregate type would be... inconsistent. > > In general, sizeof(flexible_str

Re: Porting to a custom ISA

2023-08-15 Thread Richard Biener via Gcc
On Tue, Aug 15, 2023 at 1:38 PM MegaIng via Gcc wrote: > > Hello everyone, > > I am currently in the process of porting gcc to an ISA I designed with a > few others (spec [1]). Using the old ggx/moxie tutorial as a guideline > and looking at the source of other backends, as well as the quite decen

Re: isl 0.26 C++17 issues when bootstrapping with GCC

2023-08-29 Thread Richard Biener via Gcc
> Am 29.08.2023 um 16:30 schrieb Ben Boeckel via Gcc : > > Hi, > > I tried adding isl 0.26 to a 13.2 GCC build using Iain's macOS aarch64 > patches: > >https://github.com/iains/gcc-13-branch > > It seems that the bootstrap's `CXX='g++ -std=c++11'` confuses isl's > build where C++17 is e

Re: vect_recog_mixed_size_cond_pattern dead code now

2023-08-30 Thread Richard Biener via Gcc
On Tue, 29 Aug 2023, Andrew Pinski wrote: > Hi, > I was reading some code in tree-vect-patterns.cc and I came across > vect_recog_mixed_size_cond_pattern . The code tries to handle > comparisons from COND_EXPR but that cannot happen any more (after > r13-707-g68e0063397ba82). > Should this code

Re: Question about wrapv-vect-reduc-dot-s8b.c

2023-08-30 Thread Richard Biener via Gcc
On Wed, 30 Aug 2023, juzhe.zh...@rivai.ai wrote: > Hi, I start to enable "vect" testsuite for RISC-V. > > I have a question when analyzing the 'wrapv-vect-reduc-dot-s8b.c' > It failed at: > FAIL: gcc.dg/vect/wrapv-vect-reduc-dot-s8b.c scan-tree-dump-times vect > "vect_recog_dot_prod_pattern: det

Re: Question about wrapv-vect-reduc-dot-s8b.c

2023-08-30 Thread Richard Biener via Gcc
On Wed, 30 Aug 2023, Robin Dapp wrote: > >> To fix it, is it necessary to support 'vec_unpack' ? > > > > both same units would be sext, not vec_unpacks_{lo,hi} - the vectorizer > > ties its hands by choosing vector types early and based on the number > > of incoming/outgoing vectors it chooses on

Re: Re: Question about wrapv-vect-reduc-dot-s8b.c

2023-08-30 Thread Richard Biener via Gcc
On Wed, 30 Aug 2023, juzhe.zh...@rivai.ai wrote: > I am wondering whether we do have some situations that > vec_pack/vec_unpack/vec_widen_xxx/dot_prod pattern can be beneficial for RVV ? > I have ever met some situation that vec_unpack can be beneficial when working > on SELECT_VL but I don't wh

Re: Question about dynamic choosing vectorization factor for RVV

2023-08-31 Thread Richard Biener via Gcc
On Thu, 31 Aug 2023, juzhe.zh...@rivai.ai wrote: > Hi, Richard and Richi. > > Currently, we are statically returning vectorization factor in > 'TARGET_VECTORIZE_PREFERRED_SIMD_MODE' > according to compile option. > > For example: > void > foo (int32_t *__restrict a, int32_t *__restrict b, int n

Re: Re: Question about dynamic choosing vectorization factor for RVV

2023-08-31 Thread Richard Biener via Gcc
On Thu, 31 Aug 2023, juzhe.zh...@rivai.ai wrote: > Thanks Richi. > > I am trying to figure out how to adjust finish_cost to lower the LMUL > > For example: > > void > foo (int32_t *__restrict a, int32_t *__restrict b, int n) > { > for (int i = 0; i < n; i++) > a[i] = a[i] + b[i]; > } > >

Re: Re: Question about dynamic choosing vectorization factor for RVV

2023-08-31 Thread Richard Biener via Gcc
On Thu, 31 Aug 2023, juzhe.zh...@rivai.ai wrote: > Hi. Thanks Richard and Richi. > > Now, I figure out how to choose smaller LMUL now. > > void > costs::finish_cost (const vector_costs *scalar_costs) > { > loop_vec_info loop_vinfo = dyn_cast (m_vinfo); > if (loop_vinfo) > { > if (l

Re: Re: Question about dynamic choosing vectorization factor for RVV

2023-08-31 Thread Richard Biener via Gcc
On Thu, 31 Aug 2023, juzhe.zh...@rivai.ai wrote: > Hi, Richi. > > /* Keep track of the VF for each mode. Initialize all to 0 which indicates > a mode has not been analyzed. */ > auto_vec cached_vf_per_mode; > for (unsigned i = 0; i < vector_modes.length (); ++i) > cached_vf_per_m

Re: CLZ when CLZ_DEFINED_VALUE_AT_ZERO is false

2023-09-01 Thread Richard Biener via Gcc
On Thu, Aug 31, 2023 at 3:58 PM Krister Walfridsson via Gcc wrote: > > My translation validation tool reports some miscompilations related to the > internal call CLZ(0) when CLZ_DEFINED_VALUE_AT_ZERO is false, but I am not > sure I use the correct semantics... > > I started by modeling CLZ(0) as u

Re: Using ranger from cfgexpand

2023-09-02 Thread Richard Biener via Gcc
> Am 03.09.2023 um 03:23 schrieb Jeff Law via Gcc : > >  > >> On 9/2/23 18:40, Andrew Pinski via Gcc wrote: >> Hi, >> I was trying to use the ranger from inside of cfgexpand but since at >> this point we have a mix of RTL and gimple basic blocks, things fall >> over very fast. >> First does

Re: gcc-12+: D / phobos runtime

2023-09-12 Thread Richard Biener via Gcc
On Sun, Sep 3, 2023 at 1:45 PM ASSI wrote: > > > Starting with gcc-12, gcd needs a D compiler to bootstrap, but gcc-11 > does not allow to build the necessary runtime on all platforms (Cygwin > for instance). How is the prospective bootstrap sequence on such > platforms? I think we should fix th

Re: Complex numbers in compilers - upcoming GNU Tools Cauldron.

2023-09-12 Thread Richard Biener via Gcc
On Tue, Sep 5, 2023 at 10:44 PM Toon Moene wrote: > > This is going to be an interesting discussion. > > In the upcoming GNU Tools Cauldron meeting the representation of complex > numbers in GCC will be discussed from the following "starting point": > > "Complex numbers are used to describe many p

Re: gcc-12+: D / phobos runtime

2023-09-12 Thread Richard Biener via Gcc
> Am 12.09.2023 um 21:18 schrieb ASSI : > > Richard Biener via Gcc writes: >> I think we should fix this build problems. Is there a bugzilla with >> more details about the problem? > > No, I don't have an account on that bugtracker. > > It is possible

Re: How to make parallelizing loops and vectorization work at the same time?

2023-09-15 Thread Richard Biener via Gcc
On Fri, Sep 15, 2023 at 1:21 PM Hanke Zhang via Gcc wrote: > > Hi I'm trying to accelerate my program with -ftree-vectorize and > -ftree-parallelize-loops. > > Here are my test results using the different options (based on > gcc10.3.0 on i9-12900KF): > gcc-10 test.c -O3 -flto > > time: 29000 ms >

Re: How to make parallelizing loops and vectorization work at the same time?

2023-09-15 Thread Richard Biener via Gcc
On Fri, Sep 15, 2023 at 3:09 PM Hanke Zhang wrote: > > Richard Biener 于2023年9月15日周五 19:59写道: > > > > > On Fri, Sep 15, 2023 at 1:21 PM Hanke Zhang via Gcc wrote: > > > > > > Hi I'm trying to accelerate my program with -ftree-vectorize and > > > -ftree-parallelize-loops. > > > > > > Here are my t

Re: How to make parallelizing loops and vectorization work at the same time?

2023-09-17 Thread Richard Biener via Gcc
On Fri, Sep 15, 2023 at 4:07 PM Hanke Zhang wrote: > > I get it. It's a `lto` problem. If I remove `-flto`, both work. That's odd - it might be that GCC thinks part of the program is cold and doesn't optimize it. Does using -fwhole-program instead of -flto also not work? Richard. > Thanks for

Re: Question on -fwrapv and -fwrapv-pointer

2023-09-18 Thread Richard Biener via Gcc
On Sat, Sep 16, 2023 at 10:38 AM Martin Uecker via Gcc wrote: > > > > (moved to gcc@) > > > On Fri, Sep 15, 2023 at 08:18:28AM -0700, Andrew Pinski wrote: > > > On Fri, Sep 15, 2023 at 8:12 AM Qing Zhao wrote: > > > > > > > > > > > > > > > > > On Sep 15, 2023, at 3:43 AM, Xi Ruoyao wrote: > > >

Re: How to enable DCE during late_ipa_passes?

2023-09-18 Thread Richard Biener via Gcc
On Mon, Sep 18, 2023 at 9:17 AM Hanke Zhang via Gcc wrote: > > Hi, I am currently developing a new pass in the late_ipa_passes phase, > located behind the pass_ipa_pta and in front of the > pass_omp_simd_clone. I now hope that after the pass I developed, the > code can be vectorized, that is, the

Re: Safe transposition of logical and operands

2023-09-18 Thread Richard Biener via Gcc
On Mon, Sep 18, 2023 at 9:24 AM Jonathan Wakely via Gcc wrote: > > On Mon, 18 Sept 2023, 08:03 Paul Floyd via Gcc, wrote: > > > > > > > On 17-09-23 22:51, Jonathan Wakely wrote: > > > > > > > > Why would it be trapping? It's loading an int64_t, which might be > > > uninitialised but it can't trap

Re: Concerns regarding the -ffp-contract=fast default

2023-09-18 Thread Richard Biener via Gcc
On Mon, Sep 18, 2023 at 9:51 AM Alexander Monakov wrote: > > Hi Florian, > > On Thu, 14 Sep 2023, Alexander Monakov wrote: > > > > > On Thu, 14 Sep 2023, Florian Weimer via Gcc wrote: > > > > > While rebuilding CentOS Stream with -march=x86-64-v3, I rediscovered > > > several packages had test sui

Re: Question on -fwrapv and -fwrapv-pointer

2023-09-18 Thread Richard Biener via Gcc
On Mon, Sep 18, 2023 at 10:17 AM Martin Uecker wrote: > > Am Montag, dem 18.09.2023 um 09:31 +0200 schrieb Richard Biener via Gcc: > > On Sat, Sep 16, 2023 at 10:38 AM Martin Uecker via Gcc > > wrote: > > > > > > > > > > > > (moved to gcc@)

Re: Concerns regarding the -ffp-contract=fast default

2023-09-18 Thread Richard Biener via Gcc
On Mon, Sep 18, 2023 at 12:10 PM Florian Weimer wrote: > > * Richard Biener: > > >> > > GCC contraction behavior is rather inconsistent. It does not contract > >> > > x > >> > > + x - x without -ffast-math, for example, although I believe it would > >> > > be > >> > > permissible under the rule

Re: Safe transposition of logical and operands

2023-09-18 Thread Richard Biener via Gcc
On Mon, Sep 18, 2023 at 4:49 PM Floyd, Paul via Gcc wrote: > > Hi Richard and Jonathan > > On 18/09/2023 10:00, Richard Biener wrote: > > On Mon, Sep 18, 2023 at 9:24 AM Jonathan Wakely via Gcc > > wrote: > >> Yes, GCC assumes that the reference is bound to a valid object, because C++ > >> requi

Re: Loop fusion in gcc

2023-09-23 Thread Richard Biener via Gcc
On Sat, Sep 23, 2023 at 2:54 PM Hanke Zhang via Gcc wrote: > > Hi, I have been very interested in loop fusion recently. I found that > both LLVM and icc have implemented this optimization. I also noticed > that gcc does not seem to implement it. > > I would like to ask if gcc have any plans to imp

Re: The order of loop traversal in gcc

2023-09-24 Thread Richard Biener via Gcc
> Am 25.09.2023 um 04:53 schrieb Hanke Zhang via Gcc : > > Hi, I have recently been working on loops in gcc, and I have some > questions about the loop traversal. > > I use loops_list(cfun, LI_ONLY_INNERMOST) to traverse the loops in my > pass to obtain the loop. > > I found that the order o

Re: Complex numbers support: discussions summary

2023-09-26 Thread Richard Biener via Gcc
On Mon, Sep 25, 2023 at 5:17 PM Sylvain Noiry via Gcc wrote: > > Hi, > > We had very interesting discussions during our presentation with Paul on > the > support of complex numbers in gcc at the Cauldron. > > Thank you all for your participation ! > > Here is a small summary from our viewpoint: >

Re: Question about merging if-else blocks

2023-09-27 Thread Richard Biener via Gcc
On Wed, Sep 27, 2023 at 7:21 AM Hanke Zhang via Gcc wrote: > > Thanks! I understand what you mean, then can I think that if the > function here is not an external function, but a function visible to > the compiler and the function doesn't modify `a`, then these two > blocks can be merged? Yes. T

Re: Test with an lto-build of libgfortran.

2023-09-27 Thread Richard Biener via Gcc
On Wed, Sep 27, 2023 at 11:48 PM Jeff Law via Fortran wrote: > > > > On 9/27/23 12:21, Toon Moene wrote: > > > > > The lto-ing of libgfortran did succeed, because I did get a new warning: > > > > gfortran -O3 -flto -flto-partition=none -static -o xlintstrfz zchkrfp.o > > zdrvrfp.o zdrvrf1.o zdrvr

Re: Question about merging if-else blocks

2023-10-04 Thread Richard Biener via Gcc
On Sun, Oct 1, 2023 at 6:13 AM Hanke Zhang wrote: > > Richard Biener 于2023年9月27日周三 15:30写道: > > > > On Wed, Sep 27, 2023 at 7:21 AM Hanke Zhang via Gcc wrote: > > > > > > Thanks! I understand what you mean, then can I think that if the > > > function here is not an external function, but a funct

Re: contrib/reghunt documentation

2023-10-04 Thread Richard Biener via Gcc
On Sun, Oct 1, 2023 at 9:20 PM Thomas Koenig via Gcc wrote: > > Hi, > > is there some sort of concise explanation of how to use the > scripts in contrib/reghunt? There is no real documentation > for what is in the directory, specifically not how to invoke > them, and which directory to invoke the

Re: Question about function splitting

2023-10-04 Thread Richard Biener via Gcc
On Mon, Oct 2, 2023 at 7:15 PM Hanke Zhang via Gcc wrote: > > Martin Jambor 于2023年10月3日周二 00:34写道: > > > > Hello, > > > > On Mon, Oct 02 2023, Hanke Zhang via Gcc wrote: > > > Hi, I have some questions about the strategy and behavior of function > > > splitting in gcc, like the following code: >

Re: Function return value can't be infered when it's not inlined

2023-10-04 Thread Richard Biener via Gcc
On Tue, Oct 3, 2023 at 6:30 PM Hanke Zhang via Gcc wrote: > > Hi, I'm a little confused about the behavior of gcc when the function > is not inlined. > > Here is an example code: > > int __attribute__((noinline)) foo() { > return 1; > } > > int main() { > if (foo()) { > printf("foo

Re: Function return value can't be infered when it's not inlined

2023-10-04 Thread Richard Biener via Gcc
On Wed, Oct 4, 2023 at 10:37 AM Richard Biener wrote: > > On Tue, Oct 3, 2023 at 6:30 PM Hanke Zhang via Gcc wrote: > > > > Hi, I'm a little confused about the behavior of gcc when the function > > is not inlined. > > > > Here is an example code: > > > > int __attribute__((noinline)) foo() { > >

Re: Function return value can't be infered when it's not inlined

2023-10-04 Thread Richard Biener via Gcc
> Am 04.10.2023 um 16:16 schrieb Hanke Zhang : > > Richard Biener 于2023年10月4日周三 16:43写道: >> >>> On Wed, Oct 4, 2023 at 10:37 AM Richard Biener >>> wrote: >>> >>> On Tue, Oct 3, 2023 at 6:30 PM Hanke Zhang via Gcc wrote: Hi, I'm a little confused about the behavior of gcc when t

Re: Scaling -fmacro-prefix-map= to thousands entries

2023-10-05 Thread Richard Biener via Gcc
On Wed, Oct 4, 2023 at 11:20 PM Sergei Trofimovich via Gcc wrote: > > Hi gcc developers! > > Tl;DR: > > I would like to implement a scalable way to pass `-fmacro-prefix-map=` > for `NixOS` distribution to avoid leaking build-time paths generated by > `__FILE__` macros used by various libraries. >

Re: Scaling -fmacro-prefix-map= to thousands entries

2023-10-05 Thread Richard Biener via Gcc
On Thu, Oct 5, 2023 at 1:59 PM Sergei Trofimovich wrote: > > On Thu, Oct 05, 2023 at 09:19:15AM +0200, Richard Biener wrote: > > On Wed, Oct 4, 2023 at 11:20 PM Sergei Trofimovich via Gcc > > wrote: > > > > > > Hi gcc developers! > > > > > > Tl;DR: > > > > > > I would like to implement a scalable

Re: Scaling -fmacro-prefix-map= to thousands entries

2023-10-05 Thread Richard Biener via Gcc
On Thu, Oct 5, 2023 at 2:17 PM Arsen Arsenović wrote: > > Hi, > > Sergei Trofimovich via Gcc writes: > > > Sounds good. Do you have any preference over specific syntax? My > > suggestions would be: > > > > 1. `-fmacro-prefix-map=file-name`: if `file-name` there is not in `key=val` > >format t

Re: why not optimize static local variables

2023-10-09 Thread Richard Biener via Gcc
On Sat, Oct 7, 2023 at 3:08 PM Hanke Zhang via Gcc wrote: > > Hi, I've recently been working on static local variables in C. I would > like to ask about some questions about that. > > For example, for the following program, > > void foo() { > static int x = 0; > x++; > } > > int main() { > f

Re: Documenting common C/C++ options

2023-10-10 Thread Richard Biener via Gcc
On Tue, Oct 10, 2023 at 1:13 PM Florian Weimer via Gcc wrote: > > * Richard Earnshaw: > > > On 10/10/2023 11:46, Richard Earnshaw (lists) via Gcc wrote: > >> On 10/10/2023 10:47, Florian Weimer via Gcc wrote: > >>> Currently, -fsigned-char and -funsigned-char are only documented as C > >>> languag

Re: RFD: doloop needs better support for nested loops

2023-10-10 Thread Richard Biener via Gcc
On Tue, Oct 10, 2023 at 2:43 PM Joern Rennecke wrote: > > I'm working on implementing hardware loops for the CORE-V CV32E40P > https://docs.openhwgroup.org/projects/cv32e40p-user-manual/en/latest/corev_hw_loop.html > > This core supports nested hardware lops, but does not allow any other flow > co

Re: Clarification regarding various classes DIE's attribute value class

2023-10-11 Thread Richard Biener via Gcc
On Tue, 10 Oct 2023, Rishi Raj wrote: > Hello, > I am working on a project to produce the LTO object file from the compiler > directly. So far, we have > correctly outputted .symtab along with various .debug sections. The only > thing remaining is to > correctly output attribute values and their c

Re: Vectorizer for types with different size

2023-10-17 Thread Richard Biener via Gcc
On Mon, Oct 16, 2023 at 4:05 PM Li, Pan2 wrote: > > Hi Richard Biener, > > Recently I am try to enable the RISC-V auto-vec for the lrint family, which > is trying to convert the HF/SF/DF to long type. > > Then I found the vectorizer can only act on the types with the same data > size. For exampl

Re: the elimination of if blocks in GCC during if-conversion and vectorization

2023-10-17 Thread Richard Biener via Gcc
On Thu, Oct 12, 2023 at 2:18 PM Hanke Zhang via Gcc wrote: > > Hi, I'm recently working on vectorization of GCC. I'm stuck in a small > problem and would like to ask for advice. > > For example, for the following code: > > int main() { > int size = 1000; > int *foo = malloc(sizeof(int) * size)

Re: Check whether a function is a pure function

2023-10-17 Thread Richard Biener via Gcc
On Tue, Oct 17, 2023 at 11:21 AM Hanke Zhang via Gcc wrote: > > Hi, I'm trying to write a pass to erase some useless functions or to > put it another way, detect whether a function is pure or not. (Of > course I know some passes can do the clean after inline) > > Here is the problem I got, If a fu

Re: the elimination of if blocks in GCC during if-conversion and vectorization

2023-10-17 Thread Richard Biener via Gcc
On Tue, Oct 17, 2023 at 1:54 PM Hanke Zhang wrote: > > Richard Biener 于2023年10月17日周二 17:26写道: > > > > On Thu, Oct 12, 2023 at 2:18 PM Hanke Zhang via Gcc wrote: > > > > > > Hi, I'm recently working on vectorization of GCC. I'm stuck in a small > > > problem and would like to ask for advice. > >

GCC 14.0.0 Status Report (2023-10-18), Stage 1 ends Nov. 19th

2023-10-18 Thread Richard Biener via Gcc
Status == The GCC development branch which will become GCC 14 is in general development mode (Stage 1) and will transition to general bugfixing mode (Stage 3) at the start of Nov. 19th and from there to regression and documentation fixing mode (Stage 4) at the start of Jan. 8th. Please plan a

Re: the elimination of if blocks in GCC during if-conversion and vectorization

2023-10-19 Thread Richard Biener via Gcc
On Tue, Oct 17, 2023 at 2:39 PM Hanke Zhang wrote: > > Hi Richard > I get it, thank you again. > > And I got another problem, so I'd like ask it by the way. Can the left > shift of the induction variable in a loop be optimized as a constant? > Like the code below: > > int ans = 0; > int width = ra

Re: Question about the pass_fre about merging if blocks.

2023-10-20 Thread Richard Biener via Gcc
On Fri, Oct 20, 2023 at 1:48 PM Hanke Zhang via Gcc wrote: > > Hi, I'm trying to make pass_fre work better for me. But I got a > problem. Like the code below: > > int glob; > > void __attribute__((oninline)) > foo() { > // do nothing meaningful > } > > int main() { > if (glob) { > foo(); >

Re: Question about the pass_fre about merging if blocks.

2023-10-20 Thread Richard Biener via Gcc
> Am 20.10.2023 um 16:33 schrieb Hanke Zhang : > > Richard Biener 于2023年10月20日周五 21:33写道: >> >>> On Fri, Oct 20, 2023 at 1:48 PM Hanke Zhang via Gcc wrote: >>> >>> Hi, I'm trying to make pass_fre work better for me. But I got a >>> problem. Like the code below: >>> >>> int glob; >>> >>>

Re: Question about the pass_fre about merging if blocks.

2023-10-21 Thread Richard Biener via Gcc
> Am 21.10.2023 um 10:58 schrieb Hanke Zhang : > > Richard Biener 于2023年10月20日周五 23:27写道: >> >> >> Am 20.10.2023 um 16:33 schrieb Hanke Zhang : >>> >>> Richard Biener 于2023年10月20日周五 21:33写道: > On Fri, Oct 20, 2023 at 1:48 PM Hanke Zhang via Gcc > wrote: > >

Re: Question about the pass_fre about merging if blocks.

2023-10-21 Thread Richard Biener via Gcc
> Am 21.10.2023 um 16:39 schrieb Hanke Zhang : > > Richard Biener 于2023年10月21日周六 18:23写道: >> >> >> Am 21.10.2023 um 10:58 schrieb Hanke Zhang : >>> >>> Richard Biener 于2023年10月20日周五 23:27写道: >> Am 20.10.2023 um 16:33 schrieb Hanke Zhang : > > Richard

Re: the elimination of if blocks in GCC during if-conversion and vectorization

2023-10-23 Thread Richard Biener via Gcc
On Mon, Oct 23, 2023 at 12:50 PM Hanke Zhang wrote: > > Hi Richard: > > Thanks for your advice. But when I try a simpler example like the one > below before looking at the code, GCC still does nothing. > > int main() { > int width; > scanf("%d", &width); > int sum = 0; > for (int i

Re: Question on replacing .MASK_STORE with ternary expressions

2023-10-25 Thread Richard Biener via Gcc
> Am 25.10.2023 um 17:25 schrieb Hanke Zhang via Gcc : > > Hi, I got a gimple relative question. > > I'm trying to replace the .MASK_STORE with a ternary expression in > pass_ifcvt like below: > > .MASK_STORE(addr, align, mask, value) => *addr = mask ? value : *addr; > > But when I do this,

Re: the elimination of if blocks in GCC during if-conversion and vectorization

2023-10-26 Thread Richard Biener via Gcc
On Mon, Oct 23, 2023 at 2:56 PM Hanke Zhang wrote: > > Richard Biener 于2023年10月23日周一 20:32写道: > > > > On Mon, Oct 23, 2023 at 12:50 PM Hanke Zhang wrote: > > > > > > Hi Richard: > > > > > > Thanks for your advice. But when I try a simpler example like the one > > > below before looking at the co

Re: Question about function Split with va_args

2023-11-02 Thread Richard Biener via Gcc
On Wed, Nov 1, 2023 at 11:12 AM Hanke Zhang via Gcc wrote: > > Hi > > I've been working on function splits recently, and I've noticed that > functions with va_args arguments won't be split, so why is that? I > tried to understand the comments in the source code, but I still don't > get the specifi

Re: Question on GIMPLE shifts

2023-11-02 Thread Richard Biener via Gcc
On Wed, Nov 1, 2023 at 5:01 PM Andrew Pinski via Gcc wrote: > > On Wed, Nov 1, 2023 at 3:56 AM Daniil Frolov wrote: > > > > Hi! > > > > When investigating bit shifts I got an incomprehensible moment with > > the following example: > > > > int f(int x, int k) > > { > > int tmp = x >> k; > >

Re: Suspecting a wrong behavior in the value range propagation analysis for __builtin_clz

2023-11-02 Thread Richard Biener via Gcc
On Wed, Nov 1, 2023 at 12:30 PM Giuseppe Tagliavini via Gcc wrote: > > I found an unexpected issue working with an experimental target (available > here: https://github.com/EEESlab/tricore-gcc), but I was able to reproduce it > on mainstream architectures. For the sake of clarity and reproducibi

Re: Questions about vectorizing a simple loop by inferring the range from array

2023-11-10 Thread Richard Biener via Gcc
On Thu, Nov 9, 2023 at 10:51 AM Hao Liu OS via Gcc wrote: > > Hi, > > I'm investigating how to vectorize the following simple case: > > int A[1024 * 2]; > int foo1 (unsigned offset) { > int sum = 0; > for (unsigned i = 0; i < 1024; i++) > sum += A[i + offset]; > r

Re: Missed optimization of strcpy(3) (or stpcpy(3))

2023-11-12 Thread Richard Biener via Gcc
On Sun, Nov 12, 2023 at 10:10 PM Alejandro Colomar via Gcc wrote: > > Hi, > > The following code can be optimized to use memcpy(3), since the length > of the copy is known (we've just called strnlen(3), and discarded the > possibility of truncated lengths). > > $ cat strxcpy.c > #include > #inclu

GCC 14.0.0 Status Report (2023-11-20), Stage 3 in effect now

2023-11-20 Thread Richard Biener via Gcc
Status == The GCC development branch which will become GCC 14 is in general bugfixing mode (Stage 3) now. There is still time to get larger changes in that were posted before the end of Stage 1 but this is more aimed at fixing important bugs that are not regressions and maybe flesh out detail

Re: Unjustified optimization due to restricted struct members?

2023-11-30 Thread Richard Biener via Gcc
On Thu, Nov 30, 2023 at 12:07 PM Ties Klappe via Gcc wrote: > > When reading section 6.7.3.1 of the C standard (quoted below) about > the *restrict > *type qualifier, the first section talks about *ordinary identifiers*. > These are defined in section 6.2.3, and exclude members of structures. > >

Re: Unjustified optimization due to restricted struct members?

2023-11-30 Thread Richard Biener via Gcc
On Thu, Nov 30, 2023 at 1:50 PM Ties Klappe wrote: > > Thank you Richard. > > Similar to the struct example, I was also wondering about why the following > code does not get optimized (e.g. https://godbolt.org/z/9eGrjjK81): > > int f(int* restrict a[restrict 2]) { > *(a[0]) = 10; > *(a[1]) = 11;

Re: libgcov, fork, and mingw (and other targets without the full POSIX set)

2023-12-01 Thread Richard Biener via Gcc
On Fri, Dec 1, 2023 at 9:04 AM Florian Weimer via Gcc wrote: > > I've received a report of a mingw build failure: > > ../../../gcc/libgcc/libgcov-interface.c: In function '__gcov_fork': > ../../../gcc/libgcc/libgcov-interface.c:185:9: error: implicit declaration of > function 'fork' [-Wimplicit-f

Re: libgcov, fork, and mingw (and other targets without the full POSIX set)

2023-12-01 Thread Richard Biener via Gcc
On Fri, Dec 1, 2023 at 9:57 AM Florian Weimer wrote: > > * Richard Biener: > > > On Fri, Dec 1, 2023 at 9:04 AM Florian Weimer via Gcc > > wrote: > >> > >> I've received a report of a mingw build failure: > >> > >> ../../../gcc/libgcc/libgcov-interface.c: In function '__gcov_fork': > >> ../../..

Re: NOP_EXPR vs. CONVERT_EXPR

2023-12-05 Thread Richard Biener via Gcc
On Tue, Dec 5, 2023 at 3:54 PM Alexander Monakov via Gcc wrote: > > Greetings, > > the definitions for NOP_EXPR and CONVERT_EXPR in tree.def, having survived > all the way from 1992, currently say: > > /* Represents a conversion of type of a value. >All conversions, including implicit

Re: NOP_EXPR vs. CONVERT_EXPR

2023-12-07 Thread Richard Biener via Gcc
On Fri, Dec 8, 2023 at 1:24 AM Jeff Law wrote: > > > > On 12/5/23 07:53, Richard Biener via Gcc wrote: > > On Tue, Dec 5, 2023 at 3:54 PM Alexander Monakov via Gcc > > wrote: > >> > >> Greetings, > >> > >> the definitions for NOP_EXP

Re: Request for Direction.

2023-12-18 Thread Richard Biener via Gcc
On Sat, Dec 16, 2023 at 11:53 PM Jonathan Wakely via Gcc wrote: > > On Sat, 16 Dec 2023 at 22:41, David H. Lynch Jr. wrote: > > I am looking for any help I can get - pointers as to where to start > > with GCC, docs or howto's through to someone that wishes to participate > > in the project. There

Re: Deprecating -fgnu-tm support for GCC 14 and removing it for GCC 15

2023-12-18 Thread Richard Biener via Gcc
On Mon, Dec 18, 2023 at 2:35 AM Andrew Pinski via Gcc wrote: > > On Sun, Dec 17, 2023 at 1:20 PM Eric Gallager wrote: > > > > On Sat, Dec 16, 2023 at 3:16 PM Andrew Pinski via Gcc > > wrote: > > > > > > -fgnu-tm support has not been improved since GCC 5 or earlier. It is > > > not even supporte

Re: Loop vectorizer optimization questions

2024-01-09 Thread Richard Biener via Gcc
On Mon, Jan 8, 2024 at 2:57 PM 钟居哲 wrote: > > Hi, Richard. > > I saw this following code: > > if (LOOP_VINFO_CAN_USE_PARTIAL_VECTORS_P (loop_vinfo)) > { > if (direct_internal_fn_supported_p (IFN_VCOND_MASK_LEN, vectype, > OPTIMI

GCC 14.0.1 Status Report (2024-01-12), Stage 4 in effect now

2024-01-12 Thread Richard Biener via Gcc
Status == The GCC development branch which will become GCC 14 is now in regression and documentation fixes only mode (Stage 4). Please concentrate now on fixing regressions from GCC 13 and earlier. GCC 14.1 will be released when we reach the milestone of zero P1 regressions (note not all reg

Re: How to compress the size of a field in a structure?

2024-01-15 Thread Richard Biener via Gcc
On Sat, Jan 13, 2024 at 8:46 AM Hanke Zhang via Gcc wrote: > > Hi, I'm attempting to compress the size of a field in a structure for > memory-friendly purposes. I created an IPA pass to achieve this, but I > ran into some issues as follows: > > // original > struct Foo { > long a1; > int a2; >

Re: Why is -ffold-mem-offsets a target option?

2024-01-15 Thread Richard Biener via Gcc
On Mon, Jan 15, 2024 at 11:22 AM Georg-Johann Lay wrote: > > Just noticed that -ffold-mem-offsets is a target option, i.e. it is > shown with --help=target > > > grep -A3 mem-off common.opt > ffold-mem-offsets > Target Bool Var(flag_fold_mem_offsets) Init(1) > Fold instructions calculating memory

Re: [Request for Comments] Using Rust libraries in the Rust frontend

2024-01-22 Thread Richard Biener via Gcc
On Mon, Jan 22, 2024 at 7:51 PM Arthur Cohen wrote: > > Hi everyone, > > In order to increase the development speed of Rust features, we are > seeking feedback on reusing some Rust components directly within our > front-end. As mentioned in other conferences, the most important > component we woul

<    1   2   3   4   5   6   7   8   >