Re: [Patch, fortran] PR110987 and PR113885 - gimplifier ICEs and wrong results in finalization

2024-03-29 Thread Paul Richard Thomas
Hi Harald, Thanks for the thumbs-up. Committed as 3c793f0361bc66d2a6bf0b3e1fb3234fc511e2a6. I will backport to 13-branch in a couple of weeks. Best regards Paul On Thu, 28 Mar 2024 at 22:27, Harald Anlauf wrote: > ...snip... > yes, this looks good here. > > ...snip... The patch looks rathe

[PATCH] gcc: header-tools scripts updated to python3

2024-03-29 Thread sundeep . kokkonda
From: Sundeep KOKKONDA The scripts in contrib/header-tools/ are breaks with python3. These scripts are updated for python3 compatability. Signed-off-by: Sundeep KOKKONDA --- contrib/header-tools/count-headers | 8 +- contrib/header-tools/gcc-order-headers | 64 contrib

Re: [PATCH] c++: Keep DECL_SAVED_TREE of destructor instantiations in modules [PR104040]

2024-03-29 Thread Patrick Palka
On Fri, 29 Mar 2024, Nathaniel Shead wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? LGTM > > -- >8 -- > > A template instantiation still needs to have its DECL_SAVED_TREE so that > its definition is emitted into the CMI. This way it can be emitted in > the object fil

[pushed] libstdc++-v3: drop GCC Runtime Library Exception from gen tests

2024-03-29 Thread Arsen Arsenović
It was mistakenly added to these files. libstdc++-v3/ChangeLog: * testsuite/24_iterators/range_generators/01.cc: Drop GCC Runtime Library Exception. * testsuite/24_iterators/range_generators/02.cc: Drop GCC Runtime Library Exception. * testsuite/24_iterator

[PATCH] aarch64: Fix typo in comment about FEATURE_STRING

2024-03-29 Thread Christophe Lyon
Fix the comment to document FEATURE_STRING instead of FEAT_STRING. 2024-03-29 Christophe Lyon gcc/ * config/aarch64/aarch64-option-extensions.def: Fix comment. --- gcc/config/aarch64/aarch64-option-extensions.def | 16 1 file changed, 8 insertions(+), 8 deleti

[committed] [aarch64, testsuite]: Fix lrcpc3 testcase

2024-03-29 Thread Christophe Lyon
There was a typo in the testcase, with GCC_CPUINFO pointing to the wrong file. Committed as obvious. 2024-03-29 Christophe Lyon gcc/testsuite/ * gcc.target/aarch64/cpunative/native_cpu_24.c: Fix GCC_CPUINFO. --- gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_24.c | 2 +

[PATCH v8 1/5] Provide counted_by attribute to flexible array member field (PR108896)

2024-03-29 Thread Qing Zhao
'counted_by (COUNT)' The 'counted_by' attribute may be attached to the C99 flexible array member of a structure. It indicates that the number of the elements of the array is given by the field "COUNT" in the same structure as the flexible array member. GCC may use this inf

[PATCH v8 0/5] New attribute "counted_by" to annotate bounds for C99 FAM(PR108896)

2024-03-29 Thread Qing Zhao
Hi, This is the 8th version of the patch. compare with the 7th version, the difference are: updates per Joseph's comments: 1. Wording changes in diagnostics; "non flexible" to "non-flexible"; Diagnostics starts with a lowercase letter; 2. Documentation changes: "named ``@var{count}'' t

[PATCH v8 5/5] Add the 6th argument to .ACCESS_WITH_SIZE

2024-03-29 Thread Qing Zhao
to carry the TYPE of the flexible array. Such information is needed during tree-object-size.cc. We cannot use the result type or the type of the 1st argument of the routine .ACCESS_WITH_SIZE to decide the element type of the original array due to possible type casting in the source code. gcc/c/C

[PATCH v8 2/5] Convert references with "counted_by" attributes to/from .ACCESS_WITH_SIZE.

2024-03-29 Thread Qing Zhao
Including the following changes: * The definition of the new internal function .ACCESS_WITH_SIZE in internal-fn.def. * C FE converts every reference to a FAM with a "counted_by" attribute to a call to the internal function .ACCESS_WITH_SIZE. (build_component_ref in c_typeck.cc) This includ

[PATCH v8 3/5] Use the .ACCESS_WITH_SIZE in builtin object size.

2024-03-29 Thread Qing Zhao
gcc/ChangeLog: * tree-object-size.cc (access_with_size_object_size): New function. (call_object_size): Call the new function. gcc/testsuite/ChangeLog: * gcc.dg/builtin-object-size-common.h: Add a new macro EXPECT. * gcc.dg/flex-array-counted-by-3.c: New test.

[PATCH v8 4/5] Use the .ACCESS_WITH_SIZE in bound sanitizer.

2024-03-29 Thread Qing Zhao
gcc/c-family/ChangeLog: * c-ubsan.cc (get_bound_from_access_with_size): New function. (ubsan_instrument_bounds): Handle call to .ACCESS_WITH_SIZE. gcc/testsuite/ChangeLog: * gcc.dg/ubsan/flex-array-counted-by-bounds-2.c: New test. * gcc.dg/ubsan/flex-array-counted

Re: [PATCH] Allow `gcc_jit_type_get_size` to work with pointers

2024-03-29 Thread David Malcolm
On Thu, 2024-03-28 at 23:47 +0100, Guillaume Gomez wrote: > Hi, > > Here's a little fix to allow the `gcc_jit_type_get_size` function to > work on pointer types as well. > Thanks, looks good to me. Are you able to push this, or do you want me to? Dave

Re: [PATCH] Allow `gcc_jit_type_get_size` to work with pointers

2024-03-29 Thread Guillaume Gomez
I can push it. Thanks for the (very quick) review! Le ven. 29 mars 2024 à 18:48, David Malcolm a écrit : > > On Thu, 2024-03-28 at 23:47 +0100, Guillaume Gomez wrote: > > Hi, > > > > Here's a little fix to allow the `gcc_jit_type_get_size` function to > > work on pointer types as well. > > > Than

[PATCH 1/2] modula2: Add m2.install-html rule to gcc/m2/Make-lang.in

2024-03-29 Thread Christophe Lyon
This rule was missing, and 'make install-html' was failing. It is copied from the corresponding one in fortran. 2024-03-29 Christophe Lyon gcc/m2/ * Make-lang.in (install-html): New rule. --- gcc/m2/Make-lang.in | 19 +++ 1 file changed, 19 insertions(+) diff

[PATCH 2/2] modula2: Fix m2.install-info in gcc/m2/Make-lang.in

2024-03-29 Thread Christophe Lyon
Fix a few typos: the generated filename is m2.info (not gm2.info, and gm2$(exeext) is a file not a directory (so test -d would always fail). 2024-03-29 Christophe Lyon gcc/m2/ * Make-lang.in (m2.install-info): Fix rule. --- gcc/m2/Make-lang.in | 14 +++--- 1 file chang

Re: [PATCH v8 0/5] New attribute "counted_by" to annotate bounds for C99 FAM(PR108896)

2024-03-29 Thread Tom Tromey
> Qing Zhao writes: > This is the 8th version of the patch. > compare with the 7th version, the difference are: [...] Hi. I was curious to know if the information supplied by this attribute shows up in the DWARF. It would be good if it did, because that would let gdb correctly print thes

[PATCH] [RFC] Add function filtering to gcov

2024-03-29 Thread Jørgen Kvalsvik
This is a prototype for --include/--exclude flags, and I would like a review of both the approach and architecture, and the implementation, plus feedback on the feature itself. I did not update the manuals or carefully extend --help, in case the interface itself needs some revision before it can be

Re: [PATCH] Allow `gcc_jit_type_get_size` to work with pointers

2024-03-29 Thread Guillaume Gomez
Pushed as commit 4c18ace1cb69a31af4ac719850a66de79ed12e93. Le ven. 29 mars 2024 à 18:50, Guillaume Gomez a écrit : > > I can push it. Thanks for the (very quick) review! > > Le ven. 29 mars 2024 à 18:48, David Malcolm a écrit : > > > > On Thu, 2024-03-28 at 23:47 +0100, Guillaume Gomez wrote: >

Re: [PATCH v8 0/5] New attribute "counted_by" to annotate bounds for C99 FAM(PR108896)

2024-03-29 Thread Kees Cook
On Fri, Mar 29, 2024 at 12:09:15PM -0600, Tom Tromey wrote: > > Qing Zhao writes: > > > This is the 8th version of the patch. > > > compare with the 7th version, the difference are: > > [...] > > Hi. I was curious to know if the information supplied by this attribute > shows up in the DWA

Re: [PATCH] [tree-prof] skip if errors were seen [PR113681]

2024-03-29 Thread Alexandre Oliva
On Mar 22, 2024, Jeff Law wrote: > On 3/9/24 2:11 AM, Alexandre Oliva wrote: >> ipa_tree_profile asserts that the symtab is in IPA_SSA state, but we >> don't reach that state and ICE if e.g. ipa-strub passes report errors. >> Skip this pass if errors were seen. >> Regstrapped on x86_64-linux-gnu.

Re: [PATCH v8 0/5] New attribute "counted_by" to annotate bounds for C99 FAM(PR108896)

2024-03-29 Thread Qing Zhao
Hi, Tom, Thanks a lot for the comments. It’s good to hear that this new attribute might be able to be used to help gdb. We might spend some time to study to use this information in other consumers, for example, gdb, in the future, if necessary and possible. If you have good examples to sho

Re: [PATCH v1] RISC-V: Allow RVV intrinsic when function target("arch=+v")

2024-03-29 Thread Andreas Schwab
../../gcc/config/riscv/riscv-vector-builtins.cc: In function 'rtx_def* riscv_vector::expand_builtin(unsigned int, tree, rtx)': ../../gcc/config/riscv/riscv-vector-builtins.cc:4592:16: error: misspelled term 'builtin function' in format; use 'built-in function' instead [-Werror=format-diag] 4592

[PATCH] c++: ICE with scoped enum in switch condition [PR114451]

2024-03-29 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/13? -- >8 -- Here we ICE when gimplifying enum class Type { Pawn }; struct Piece { Type type : 4; }; void foo() { switch (Piece().type) case Type::Pawn:; } because we ended up with TYPE_PRECISION (cond) < TYPE_PR

Re: [PATCH v8 0/5] New attribute "counted_by" to annotate bounds for C99 FAM(PR108896)

2024-03-29 Thread Tom Tromey
Kees> Does DWARF have such an annotation? Regardless, I think this could be a Kees> future patch to not hold up landing the initial feature. Sure, the compiler can emit the array length (and structure size) as a DWARF expression using the length. Tom

Re: [PATCH v8 0/5] New attribute "counted_by" to annotate bounds for C99 FAM(PR108896)

2024-03-29 Thread Tom Tromey
> So, let’s delay the possible support to gdb in a later patch. > Does this sound reasonable to you? It's not really up to me, but sure. I was just curious if it perhaps already worked, but not enough to apply the patches and find out. Tom