[Bug c/117139] New: ICE with invalid constexpr expression (tree check: expected integer_cst, have real_cst in get_len, at tree.h:6509)

2024-10-14 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117139

Bug ID: 117139
   Summary: ICE with invalid constexpr expression (tree check:
expected integer_cst, have real_cst in get_len, at
tree.h:6509)
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: sjames at gcc dot gnu.org
  Target Milestone: ---

Originally reported downstream in Gentoo at https://bugs.gentoo.org/941543.

```
constexpr int myconst = 2 * 2.5;
```

```
$ gcc /tmp/foo.c -c -O1 -std=c23
/tmp/foo.c:1:25: error: ‘constexpr’ integer initializer is not an integer
constant expression
1 | constexpr int myconst = 2 * 2.5;
  | ^
/tmp/foo.c:1:1: internal compiler error: tree check: expected integer_cst, have
real_cst in get_len, at tree.h:6509
1 | constexpr int myconst = 2 * 2.5;
  | ^
0x5b159bea403d internal_error(char const*, ...)
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/diagnostic-global-context.cc:517
0x5b159b739809 tree_check_failed(tree_node const*, char const*, int, char
const*, ...)
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/tree.cc:9003
0x5b159a75afeb tree_check(tree_node const*, char const*, int, char const*,
tree_code)
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/tree.h:3921
0x5b159a75afeb wi::extended_tree<131072>::get_len() const
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/tree.h:6509
0x5b159a75afeb wi::int_traits >
>::decompose(long*, unsigned int, generic_wide_int >
const&)
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/wide-int.h:1050
0x5b159a75afeb wide_int_ref_storage::wide_int_ref_storage >
>(generic_wide_int > const&, unsigned int)
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/wide-int.h:1099
0x5b159a75afeb generic_wide_int
>::generic_wide_int >
>(generic_wide_int > const&, unsigned int)
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/wide-int.h:855
0x5b159a75afeb bool wi::lts_p >,
generic_wide_int >
>(generic_wide_int > const&,
generic_wide_int > const&)
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/wide-int.h:2296
0x5b159a75afeb wi::binary_traits >,
generic_wide_int >,
wi::int_traits > >::precision_type,
wi::int_traits >
>::precision_type>::signed_predicate_result operator<
 >,
generic_wide_int >
>(generic_wide_int > const&,
generic_wide_int > const&)
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/wide-int.h:3811
0x5b159a75afeb tree_int_cst_lt(tree_node const*, tree_node const*)
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/tree.h:6675
0x5b159a75afeb int_fits_type_p(tree_node const*, tree_node const*)
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/tree.cc:8219
0x5b159b50690f check_constexpr_init
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/c/c-typeck.cc:8650
0x5b159a774061 digest_init
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/c/c-typeck.cc:9096
0x5b159c88045b store_init_value(unsigned int, tree_node*, tree_node*,
tree_node*)
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/c/c-typeck.cc:8390
0x5b159c0c2fe1 finish_decl(tree_node*, unsigned int, tree_node*, tree_node*,
tree_node*)
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/c/c-decl.cc:5843
0x5b159c84f8ed c_parser_declaration_or_fndef
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/c/c-parser.cc:2764
0x5b159c84eb9b c_parser_external_declaration
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/c/c-parser.cc:2060
0x5b159c84a6da c_parser_translation_unit
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/c/c-parser.cc:1914
0x5b159c84a6da c_parse_file()
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/c/c-parser.cc:27348
0x5b159c83dca0 c_common_parse_file()
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/c-family/c-opts.cc:1349
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
```

[Bug ipa/115033] [12 Regression] Incorrect optimization of by-reference closure fields by fre1 pass since r12-5113-gd70ef65692fced

2024-10-14 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115033

Sam James  changed:

   What|Removed |Added

  Known to work||12.4.1
 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #27 from Sam James  ---
Fixed (backporting done per
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111613#c13) for 12.5 too.

[Bug ipa/114207] [12 Regression] modref gets confused by vectorized code `-O3 -fno-tree-forwprop` since r12-5439

2024-10-14 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114207

Sam James  changed:

   What|Removed |Added

  Known to work||12.4.1
 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #11 from Sam James  ---
Fixed (backporting done per
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111613#c13) for 12.5 too.

[Bug ipa/111613] [12 Regression] Bit field stores can be incorrectly optimized away when -fstore-merging is in effect since r12-5383-g22c242342e38eb

2024-10-14 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111613

--- Comment #19 from GCC Commits  ---
The releases/gcc-12 branch has been updated by Sam James :

https://gcc.gnu.org/g:0e3580191b449e599a4c8d7bfd634df2ca351d4a

commit r12-10772-g0e3580191b449e599a4c8d7bfd634df2ca351d4a
Author: Sam James 
Date:   Mon Jul 29 21:47:16 2024 +0100

testsuite: fix PR111613 test

PR ipa/111613
* gcc.c-torture/pr111613.c: Rename to..
* gcc.c-torture/execute/pr111613.c: ...this.

(cherry picked from commit 5e5d7a88932b132437069f716160f8b20862890b)

[Bug tree-optimization/113787] [12 Regression] Wrong code at -O with ipa-modref on aarch64

2024-10-14 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113787

Sam James  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
  Known to work||12.4.1
 Resolution|--- |FIXED

--- Comment #27 from Sam James  ---
Fixed (backporting done per
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111613#c13) for 12.5 too.

[Bug ipa/111613] [12 Regression] Bit field stores can be incorrectly optimized away when -fstore-merging is in effect since r12-5383-g22c242342e38eb

2024-10-14 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111613

Sam James  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED
  Known to work||12.4.1

--- Comment #20 from Sam James  ---
All done, fixed for 12.5 too.

[Bug tree-optimization/117140] [15 regression] RISC-V: ICE in initialize_flags_in_bb for rv32gcv

2024-10-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117140

--- Comment #2 from Andrew Pinski  ---
I suspect r15-4324-gaccb85345edb91 .

[Bug target/113952] Finish LRA transition for sparc by removing -mlra

2024-10-14 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113952

Sam James  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |sjames at gcc dot 
gnu.org
 Status|NEW |ASSIGNED

--- Comment #1 from Sam James  ---
I have a patch to clean it up.

[Bug testsuite/115545] [15 regression] missing/excess errors after r15-1394 for targets where sizeof(int)==sizeof(long)

2024-10-14 Thread seurer at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115545

--- Comment #9 from seurer at gcc dot gnu.org ---
Looks OK on powerpc, too.

[Bug bootstrap/117109] [15 Regression] "make gcc.pot" fails with "emit_diagnostic used incompatibly" since r15-4081-g385a232229a5b4 (diagnostics: bulletproof opening of SARIF output)

2024-10-14 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117109

--- Comment #2 from GCC Commits  ---
The master branch has been updated by David Malcolm :

https://gcc.gnu.org/g:23e7b702521aa5611060a0b8dd194f3801fc

commit r15-4343-g23e7b702521aa5611060a0b8dd194f3801fc
Author: David Malcolm 
Date:   Mon Oct 14 19:22:46 2024 -0400

diagnostics: fix overload of emit_diagnostic [PR117109]

I accidentally broke "make gcc.pot" in r15-4081 by adding
a member function diagnostic_context::emit_diagnostic with a
gmsgid in a different position to the existing emit_diagnostic
functions, which exgettext's parser can't handle.

Fixed thusly.

gcc/ChangeLog:
PR bootstrap/117109
* diagnostic-format-sarif.cc
(diagnostic_output_format_init_sarif_file): Rename
diagnostic_context::emit_diagnostic to
diagnostic_context::emit_diagnostic_with_group.
* diagnostic.cc (diagnostic_context::emit_diagnostic): Rename
to...
(diagnostic_context::emit_diagnostic_with_group): ...this.
(diagnostic_context::emit_diagnostic_va): Rename to...
(diagnostic_context::emit_diagnostic_with_group_va): ...this.
* diagnostic.h (diagnostic_context::emit_diagnostic): Rename to...
(diagnostic_context::emit_diagnostic_with_group): ...this.
(diagnostic_context::emit_diagnostic_va): Rename to...
(diagnostic_context::emit_diagnostic_with_group_va): ...this.

Signed-off-by: David Malcolm 

[Bug bootstrap/117109] [15 Regression] "make gcc.pot" fails with "emit_diagnostic used incompatibly" since r15-4081-g385a232229a5b4 (diagnostics: bulletproof opening of SARIF output)

2024-10-14 Thread dmalcolm at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117109

David Malcolm  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from David Malcolm  ---
Should be fixed by the above patch; marking as resolved as the "make gcc.pot"
issue seems to be resolved by this patch.

[Bug target/117111] [SH] delay slot is filled with wrong instruction

2024-10-14 Thread olegendo at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117111

--- Comment #6 from Oleg Endo  ---
(In reply to Jeffrey A. Law from comment #5)
> reorg splits insns because doing so gives more opportunities to fill delay
> slot, particularly when the asm-output step would generate multiple
> instructions for a single insn.
> 
> My recollection (and it's been decades since I've really worked on reorg) is
> that validity is checked dynamically when we try to fill the slot with a
> particular insn.  In theory the insns created by splitting should be no
> different than insns that were in the insn chain prior to reorg.

What the split pattern in question does is basically:

;;  movtr2  ->  movtr2
;;  movtr13 mov r2,r13

The split and change happens on the 2nd insn.  It looks for a previous insn
that does a "movt -> reg" within the current BB and if found replaces the
operand.  This changes the insn inter-dependency.  Before the change the two
insns depend on T_REG and can be reordered.  After the change the 2nd insn
depends on the 1st and must not be reordered -- which is what seems to be going
wrong here.

[Bug target/117111] [SH] delay slot is filled with wrong instruction

2024-10-14 Thread law at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117111

--- Comment #7 from Jeffrey A. Law  ---
But reorg should handle that fine.  It's got code to track dependencies and not
move something in an unsafe manner.  Of course all that code is incredibly
hairy as it predates a control flow graph and real data dependency analysis. 
Think late 80s, early 90s.

[Bug target/117140] [15 regression] RISC-V: ICE in initialize_flags_in_bb for rv32gcv

2024-10-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117140

--- Comment #1 from Andrew Pinski  ---
  /* We are going to use the operand cache API, such as
 SET_USE, SET_DEF, and FOR_EACH_IMM_USE_FAST.  The operand
 cache for each statement should be up-to-date.  */
  gcc_checking_assert (!gimple_modified_p (stmt));

[Bug ipa/108250] [12/13 regression] llvm-tblgen miscompiled on powerpc-unknown-linux-gnu since r12-5383-g22c242342e38eb

2024-10-14 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108250

--- Comment #17 from Sam James  ---
Various IPA fixes have been backported now including for PR111613. I haven't
yet checked if LLVM still fails but I suspect it works now.

[Bug ipa/115135] [12/13/14/15 regression] [C++] GCC produces wrong code at certain inlining levels on Aarch64 with -fno-exceptions, related to lambdas and variants since r12-5113-gd70ef65692fced

2024-10-14 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115135

Sam James  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2024-10-14
 Status|UNCONFIRMED |WAITING

--- Comment #14 from Sam James  ---
Carlos, could you try again with ideally both trunk and releases/gcc-14?
Thanks.

[Bug fortran/117136] [15 regression] ICE for gfortran.dg/typebound_operator_11.f90 since r15-4298-g3269a722b7a036

2024-10-14 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117136

Sam James  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2024-10-14
   Target Milestone|--- |15.0

[Bug target/117140] New: [15 regression] RISC-V: ICE in initialize_flags_in_bb for rv32gcv

2024-10-14 Thread ewlu at rivosinc dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117140

Bug ID: 117140
   Summary: [15 regression] RISC-V: ICE in initialize_flags_in_bb
for rv32gcv
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ewlu at rivosinc dot com
  Target Milestone: ---

Created attachment 59347
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59347&action=edit
freport-bug output

The following tests are failing on rv32gcv-ilp32d for linux and newlib targets

FAIL: gcc.target/riscv/rvv/autovec/partial/multiple_rgroup_run-1.c (internal
compiler error: in initialize_flags_in_bb, at tree-into-ssa.cc:434)
FAIL: gcc.target/riscv/rvv/autovec/partial/multiple_rgroup_run-1.c (test for
excess errors)

https://github.com/patrick-rivos/gcc-postcommit-ci/issues/1925

In the process of bisecting and reducing testcase

[Bug c++/106057] [12/13/14/15 regression] Missed stmt_can_throw_external check in stmt_kills_ref_p

2024-10-14 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106057

Sam James  changed:

   What|Removed |Added

  Known to fail||10.5.0, 11.5.0, 12.4.1,
   ||13.3.1, 14.2.1, 15.0, 6.1.0
Summary|Missed  |[12/13/14/15 regression]
   |stmt_can_throw_external |Missed
   |check in stmt_kills_ref_p   |stmt_can_throw_external
   ||check in stmt_kills_ref_p
  Known to work||5.5.0

--- Comment #7 from Sam James  ---
5.5 is fine, 6.1 isn't

[Bug c++/106057] [12/13/14/15 regression] Missed stmt_can_throw_external check in stmt_kills_ref_p

2024-10-14 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106057

Sam James  changed:

   What|Removed |Added

   Last reconfirmed||2024-10-15
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1

[Bug c++/106057] [12/13/14/15 regression] Missed stmt_can_throw_external check in stmt_kills_ref_p

2024-10-14 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106057

--- Comment #8 from Sam James  ---
I guess that's why Honza didn't add it in
r13-1241-g7fd34782b95bbe1b4dc9936b8923f86d4aaee379, actually. So the question
is just if the testcase is valid or not. If it isn't, we're all done.

[Bug ipa/111245] [12/13/14/15 Regression] miscompilation: missing assignment when exception thrown since r12-5244-g64f3e71c302b4a13e61656ee509e7050b9bce978

2024-10-14 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111245

--- Comment #6 from Sam James  ---
Honza?

[Bug other/116613] RFE: support outputting diagnostics in *multiple* formats

2024-10-14 Thread dmalcolm at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116613

--- Comment #22 from David Malcolm  ---
(In reply to David Malcolm from comment #18)
[...snip...]
> 
> I have work-in-progress patches that implement this as a new
>   -fdiagnostics-add-output=
> option, but they're not yet ready to push upstream (currently they break
> some targets, plus the Fortran, and Modula 2 frontends).  I still hope to
> get them ready for GCC 15 feature freeze.

FWIW, I've posted a partial patch for the target-breakage and Modula 2 issue
here:
"[RFC/PATCH] Use unique_ptr in more places in pretty_printer/diagnostics
[PR116613]"
  https://gcc.gnu.org/pipermail/gcc-patches/2024-October/665443.html

I don't yet have a fix for the Fortran issue; hope to tackle that next.

[Bug target/117082] [15 Regression] FAIL: gcc.target/i386/stack-check-17.c since r15-1619-g3b9b8d6cfdf593

2024-10-14 Thread haochen.jiang at intel dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117082

Haochen Jiang  changed:

   What|Removed |Added

 CC||haochen.jiang at intel dot com

--- Comment #3 from Haochen Jiang  ---
Dup with PR117081:

https://gcc.gnu.org/pipermail/gcc-regression/2024-June/080148.html

[Bug c/117142] New: ICE: verify_flow_info failed: error: returns_twice call is not first in basic block 2 at -O1 and above

2024-10-14 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117142

Bug ID: 117142
   Summary: ICE: verify_flow_info failed: error: returns_twice
call is not first in basic block 2 at -O1 and above
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

***
OS and Platform:
$ uname -a:
Linux 65dac7c84719 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC
2023 x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
Using built-in specs.
COLLECT_GCC=/home/software/gcc-trunk-3aa004f/bin/gcc
COLLECT_LTO_WRAPPER=/home/software/gcc-trunk-3aa004f/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --disable-multilib --disable-bootstrap
--enable-languages=c,c++ --prefix=/home/software/gcc-trunk-3aa004f
--enable-coverage
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240630 (experimental) (GCC) 

***
Program:
$ cat mutant.c
struct a {
  int b;
} c();
void __attribute__((returns_twice)) bar() {
struct a d;
{
bar(d);
c(d.b, d.b);
}
}

***
Command Lines:
$ gcc -O1 mutant.c
mutant.c: In function 'bar':
mutant.c:10:1: error: returns_twice call is not first in basic block 2
   10 | }
  | ^
bar (d);
during GIMPLE pass: esra
mutant.c:10:1: internal compiler error: verify_flow_info failed
0x5071bcf diagnostic_context::report_diagnostic(diagnostic_info*)
???:0
0x50724a1 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, int, char const*, __va_list_tag (*) [1],
diagnostic_t)
???:0
0x50924c7 internal_error(char const*, ...)
???:0
0x11b395c verify_flow_info()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

It can be compiled normally with -O0.
Also ICE on trunk.
Compiler Explorer: https://godbolt.org/z/c3YGen7hb

[Bug c++/117146] ICE on error recovery with openscad-2021.01

2024-10-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117146

--- Comment #2 from Andrew Pinski  ---
>Extracting preprocessed source for this is a pain as it doesn't ICE with that.


Since it is in tree_decl_hash, that looks like a GC issue ...

So `--param=ggc-min-expand=1 --param=ggc-min-heapsize=1`

[Bug c++/117146] ICE on error recovery with openscad-2021.01

2024-10-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117146

--- Comment #3 from Andrew Pinski  ---
It also might be related to r9-2651-gbdd039843c2df9 ...

[Bug tree-optimization/117147] [15 regression] ICE when building vtk-9.3.0 (crash in vect_build_slp_tree_1)

2024-10-14 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117147

--- Comment #1 from Sam James  ---
==2895651== Invalid read of size 1
==2895651==at 0x23DD0DF: vect_build_slp_tree_1(vec_info*, unsigned char*,
vec<_stmt_vec_info*, va_heap, vl_ptr>, unsigned int, poly_int<1u, unsigned
long>*, bool*, bool*, tree_node**) [clone .constprop.0] (tree-vect-slp.cc:1459)
==2895651==by 0x2784F42: vect_build_slp_tree_2(vec_info*, _slp_tree*,
vec<_stmt_vec_info*, va_heap, vl_ptr>, unsigned int, poly_int<1u, unsigned
long>*, bool*, unsigned int*, unsigned int*, hash_map, _slp_tree*, simple_hashmap_traits >*)
[clone .constprop.0] (tree-vect-slp.cc:1966)
==2895651==by 0x2781E61: vect_build_slp_tree(vec_info*,
vec<_stmt_vec_info*, va_heap, vl_ptr>, unsigned int, poly_int<1u, unsigned
long>*, bool*, unsigned int*, unsigned int*, hash_map, _slp_tree*, simple_hashmap_traits >*)
[clone .lto_priv.0] (tree-vect-slp.cc:1793)
==2895651==by 0x27851AD: vect_build_slp_tree_2(vec_info*, _slp_tree*,
vec<_stmt_vec_info*, va_heap, vl_ptr>, unsigned int, poly_int<1u, unsigned
long>*, bool*, unsigned int*, unsigned int*, hash_map, _slp_tree*, simple_hashmap_traits >*)
[clone .constprop.0] (tree-vect-slp.cc:2687)
==2895651==by 0x2781E61: vect_build_slp_tree(vec_info*,
vec<_stmt_vec_info*, va_heap, vl_ptr>, unsigned int, poly_int<1u, unsigned
long>*, bool*, unsigned int*, unsigned int*, hash_map, _slp_tree*, simple_hashmap_traits >*)
[clone .lto_priv.0] (tree-vect-slp.cc:1793)
==2895651==by 0x27851AD: vect_build_slp_tree_2(vec_info*, _slp_tree*,
vec<_stmt_vec_info*, va_heap, vl_ptr>, unsigned int, poly_int<1u, unsigned
long>*, bool*, unsigned int*, unsigned int*, hash_map, _slp_tree*, simple_hashmap_traits >*)
[clone .constprop.0] (tree-vect-slp.cc:2687)
==2895651==by 0x2781E61: vect_build_slp_tree(vec_info*,
vec<_stmt_vec_info*, va_heap, vl_ptr>, unsigned int, poly_int<1u, unsigned
long>*, bool*, unsigned int*, unsigned int*, hash_map, _slp_tree*, simple_hashmap_traits >*)
[clone .lto_priv.0] (tree-vect-slp.cc:1793)
==2895651==by 0x2780B96: vect_build_slp_instance(vec_info*,
slp_instance_kind, vec<_stmt_vec_info*, va_heap, vl_ptr>&, vec<_stmt_vec_info*,
va_heap, vl_ptr>&, vec&, unsigned int, unsigned
int*, hash_map, _slp_tree*,
simple_hashmap_traits >*, _stmt_vec_info*, bool)
(tree-vect-slp.cc:3790)
==2895651==by 0x23CC56F: vect_analyze_slp(vec_info*, unsigned int, bool)
(tree-vect-slp.cc:4781)
==2895651==by 0x27D4785: vect_analyze_loop_2(_loop_vec_info*, bool&,
unsigned int*, unsigned int&) (tree-vect-loop.cc:2885)
==2895651==by 0x27D2EB6: vect_analyze_loop_1(loop*, vec_info_shared*,
vect_loop_form_info const*, _loop_vec_info*, vec
const&, unsigned int&, machine_mode&, bool&) (tree-vect-loop.cc:3454)
==2895651==by 0x24F8C2A: vect_analyze_loop(loop*, gimple*,
vec_info_shared*) (tree-vect-loop.cc:3614)
==2895651==  Address 0x18 is not stack'd, malloc'd or (recently) free'd
==2895651==
during GIMPLE pass: vect
/var/tmp/portage/sci-libs/vtk-9.3.0-r3/work/VTK-9.3.0/Filters/Statistics/vtkPCAStatistics.cxx:
In member function ‘virtual void vtkPCAStatistics::Test(vtkTable*,
vtkMultiBlockDataSet*, vtkTable*)’:
/var/tmp/portage/sci-libs/vtk-9.3.0-r3/work/VTK-9.3.0/Filters/Statistics/vtkPCAStatistics.cxx:752:6:
internal compiler error: Segmentation fault

[Bug tree-optimization/117147] [15 regression] ICE when building vtk-9.3.0 (crash in vect_build_slp_tree_1)

2024-10-14 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117147

--- Comment #2 from Sam James  ---
Maybe a dupe of PR117060?

[Bug tree-optimization/117148] New: `-Os` results in much larger code than `-O2` about bitfields

2024-10-14 Thread lh_mouse at 126 dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117148

Bug ID: 117148
   Summary: `-Os` results in much larger code than `-O2` about
bitfields
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: lh_mouse at 126 dot com
  Target Milestone: ---

This code is complex but the two `atomic_*` routines can be ignored.
(https://godbolt.org/z/G6zsdPsrj)
```
#include 
#include 

inline
void
atomic_load_iptr(void* out, const void* mem)
  {
intptr_t ival = __atomic_load_n((intptr_t*) mem, __ATOMIC_ACQUIRE);
*(intptr_t*) out = ival;
  }

inline
bool
atomic_cmpxchg_iptr(void* out, void* mem, const void* cmp, const void* val)
  {
intptr_t icmp = *(intptr_t*) cmp;
intptr_t ival = *(intptr_t*) val;
bool r = __atomic_compare_exchange_n((intptr_t*) mem, &icmp, ival, 
 1 /* weak */,
 __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE);
*(intptr_t*) out = ival;
return r;
  }

struct Mutex
  {
uintptr_t locked : 1;
uintptr_t reserved : 8;
uintptr_t waiter_count : __SIZEOF_POINTER__ * 8 - 9;
  };

bool
mutex_try_lock(struct Mutex* m)
  {
struct Mutex old, new;

atomic_load_iptr(&old, m);
do {
  new.locked = 1;
  new.reserved = old.reserved;
  new.waiter_count = old.waiter_count + old.locked;
}
while(!atomic_cmpxchg_iptr(&old, m, &old, &new));

return old.locked == 0;
  }
```

GCC 14 with `-O2` (59 bytes in total):
```
mutex_try_lock:
 movrax,QWORD PTR [rdi]
 movrdx,rax
 movrcx,rdx
 movrsi,rdx
 andedx,0x1fe
 shrrcx,0x9
 andesi,0x1
 or rdx,0x1
 addrcx,rsi
 shlrcx,0x9
 or rdx,rcx
 lock cmpxchg QWORD PTR [rdi],rdx
 jne36 
 moveax,edx
 noteax
 andeax,0x1
 ret
 movrax,rdx
 jmp6 
```

GCC 14 with `-Os` (92 bytes in total, which is ~156%):
```
mutex_try_lock:
 push   rbx
 movrbx,rdi
 movrsi,rbx
 subrsp,0x10
 leardi,[rsp+0x8]
 call   15 
R_X86_64_PLT32 atomic_load_iptr-0x4
 movrax,QWORD PTR [rsp+0x8]
 movcl,BYTE PTR [rsp+0x8]
 movrdx,rax
 andecx,0x1
 shrrdx,0x9
 addrdx,rcx
 movecx,DWORD PTR [rsp+0x8]
 shlrdx,0x9
 shrcx,1
 movzx  ecx,cl
 addrcx,rcx
 or rcx,0x1
 or rdx,rcx
 lock cmpxchg QWORD PTR [rbx],rdx
 movQWORD PTR [rsp+0x8],rdx
 jne15 
 moveax,edx
 addrsp,0x10
 noteax
 poprbx
 andeax,0x1
 ret
```

[Bug bootstrap/117110] [15 Regression] Bootstrap broken on FreeBSD with build/genmatch

2024-10-14 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117110

--- Comment #7 from GCC Commits  ---
The master branch has been updated by Jakub Jelinek :

https://gcc.gnu.org/g:384faebde257b0b5a0aa334718ef1b645d4c8d1e

commit r15-4345-g384faebde257b0b5a0aa334718ef1b645d4c8d1e
Author: Jakub Jelinek 
Date:   Tue Oct 15 07:50:35 2024 +0200

genmatch: Revert recent genmatch changes, instead add custom diag_vfprintf
routine [PR117110]

My recent changes to genmatch apparently broke bootstrap on FreeBSD
and Darwin and perhaps others, and also broke $build != $host
builds including canadian cross.

The change was to link in libcommon.a into build/genmatch, so that
we can use pp_format_verbatim.  Unfortunately that has various
dependencies in libcommon.a, and more importantly, libcommon.a is
a host library, while build/genmatch carefully links with build/vec.o
etc., build version of libcpp.
So, in order to use pretty-print.o stuff, we'd need to build a build/
version of all those objects and worse ensure there is and we properly
link build version of libintl and/or libiconv when needed (those 2 are
the reasons for FreeBSD/Darwin failures).

The following patch just reverts those changes and instead adds a very
simple variant of gcc_diag style vfprintf, which prints the result
directly into a stream.
We don't need anything fancy, like UTF-8 quotes, colors, URLs, in the
usual case genmatch shouldn't print anything at all.
The patch implements what pretty-print.cc implements, except the fancy
stuff (no colors, no URLs printed, quotes always printed just as
'something', strings even in %qs printed normally rather than trying to
pass through ASCII and valid UTF-8 and use <80><35> style printing for the
rest) and except %@ and %e (neither libcpp nor genmatch.cc use those
currently and they need extra structures etc. which aren't used in libcpp
at all).  It handles both "%.*s %d" and "%3$.*2$s %1$d" styles just in case
something got translated (although at least the cross-compiler and stage1
genmatch shouldn't be translating anything, but stage2+ native can).

I've tested it with hacking up most of pretty-print.cc self-tests
to just use warning_at ((location_t) 1, ...) and doing manual verification
of what was printed vs. what was expected (with a few additions for the
%M$ style formats); as it goes into a FILE * directly, I'm afraid
self-tests
of this aren't easily possible.

2024-10-15  Jakub Jelinek  

PR bootstrap/117110
* Makefile.in (generated_files, generated_match_files,
build/genmatch$(build_exeext), LINKER_FOR_BUILD): Revert
2024-10-12 changes.
* genmatch.cc: Don't include pretty-print.h and input.h.
(fatal, ggc_internal_cleared_alloc, ggc_free, line_table,
linemap_client_expand_location_to_spelling_point): Revert
2024-10-12 changes.
(DIAG_ARGMAX): Define.
(diag_integer_with_precision): Define.
(diag_vfprintf): New function.
(diagnostic_cb): Use diag_vfprintf instead of pp_format_verbatim.
(output_line_directive): Revert 2024-10-12 changes.

[Bug tree-optimization/117147] New: [15 regression] ICE when building vtk-9.3.0 (crash in vect_build_slp_tree_1)

2024-10-14 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117147

Bug ID: 117147
   Summary: [15 regression] ICE when building vtk-9.3.0 (crash in
vect_build_slp_tree_1)
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: sjames at gcc dot gnu.org
  Target Milestone: ---

Created attachment 59351
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59351&action=edit
vtkPCAStatistics.cxx.ii.xz

```
# g++ -O2 -mprefer-vector-width=512 -fno-vect-cost-model -fvisibility=hidden
-fvisibility-inlines-hidden -pipe  -c vtkPCAStatistics.cxx.ii 
-march=sapphirerapids -mabm -mno-sgx -mrtm -mshstk
--param=l1-cache-line-size=64 --param=l1-cache-size=48
--param=l2-cache-size=76800
during GIMPLE pass: vect
/var/tmp/portage/sci-libs/vtk-9.3.0-r3/work/VTK-9.3.0/Filters/Statistics/vtkPCAStatistics.cxx:
In member function ‘virtual void vtkPCAStatistics::Test(vtkTable*,
vtkMultiBlockDataSet*, vtkTable*)’:
/var/tmp/portage/sci-libs/vtk-9.3.0-r3/work/VTK-9.3.0/Filters/Statistics/vtkPCAStatistics.cxx:752:6:
internal compiler error: Segmentation fault
0x5a5b54a39e1b internal_error(char const*, ...)
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/diagnostic-global-context.cc:517
0x5a5b5425892d crash_signal
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/toplev.cc:322
0x703eede1e3ef ???
   
/usr/src/debug/sys-libs/glibc-2.40-r5/glibc-2.40/signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x5a5b552ae0df vect_build_slp_tree_1
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/tree-vect-slp.cc:1459
0x5a5b55655f42 vect_build_slp_tree_2
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/tree-vect-slp.cc:1966
0x5a5b55652e61 vect_build_slp_tree
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/tree-vect-slp.cc:1793
0x5a5b556561ad vect_build_slp_tree_2
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/tree-vect-slp.cc:2687
0x5a5b55652e61 vect_build_slp_tree
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/tree-vect-slp.cc:1793
0x5a5b556561ad vect_build_slp_tree_2
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/tree-vect-slp.cc:2687
0x5a5b55652e61 vect_build_slp_tree
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/tree-vect-slp.cc:1793
0x5a5b55651b96 vect_build_slp_instance
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/tree-vect-slp.cc:3790
0x5a5b5529d56f vect_analyze_slp(vec_info*, unsigned int, bool)
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/tree-vect-slp.cc:4781
0x5a5b556a5785 vect_analyze_loop_2
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/tree-vect-loop.cc:2885
0x5a5b556a3eb6 vect_analyze_loop_1
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/tree-vect-loop.cc:3454
0x5a5b553c9c2a vect_analyze_loop(loop*, gimple*, vec_info_shared*)
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/tree-vect-loop.cc:3614
0x5a5b556a1e6d try_vectorize_loop_1
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/tree-vectorizer.cc:1072
0x5a5b556a1e6d try_vectorize_loop
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/tree-vectorizer.cc:1189
0x5a5b553ba0a5 execute
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/tree-vectorizer.cc:1305
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
```

[Bug tree-optimization/117148] `-Os` results in much larger code than `-O2` about bitfields

2024-10-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117148

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement

--- Comment #1 from Andrew Pinski  ---
bitfields strick again.

[Bug tree-optimization/117147] [15 regression] ICE when building vtk-9.3.0 (crash in vect_build_slp_tree_1)

2024-10-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117147

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
 CC||pinskia at gcc dot gnu.org
   Target Milestone|--- |15.0

--- Comment #3 from Andrew Pinski  ---
Most likely due to r15-4324-gaccb85345edb91 .

[Bug c++/116838] Problem with warming c23, c++23

2024-10-14 Thread lukaszcz18 at wp dot pl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116838

--- Comment #6 from Jamaika  ---
(In reply to Jonathan Wakely from comment #3)
> If you enable C++20 (or C++23) and GCC tells you that your code is not
> compatible with C++20, fix the code.
> 
> (In reply to Jamaika from comment #0)
> > Codec vvenc
> > ```
> > In file included from MCTF.cpp:52:
> > ../Utilities/NoMallocThreadPool.h: In lambda function:
> > ../Utilities/NoMallocThreadPool.h:160:31: warning: implicit capture of
> > 'this' via '[=]' is deprecated in C++20 [-Wdeprecated]
> >   160 | nonconst->m_cond.wait( l, [=] { return
> > !m_intBarrier.isBlocked(); } );
> >   |   ^
> > ../Utilities/NoMallocThreadPool.h:160:31: note: add explicit 'this' or
> > '*this' capture
> > ```
> 
> This is a language change in C++20. If you want to compile the code as C++20
> or C++23, then the code needs to be fixed. This is not a GCC bug.
> 

https://github.com/fraunhoferhhi/vvenc/pull/437

[Bug tree-optimization/105495] `__atomic_compare_exchange` prevents tail-call optimization

2024-10-14 Thread lh_mouse at 126 dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105495

--- Comment #8 from LIU Hao  ---
(In reply to LIU Hao from comment #7)
> Oh, the sample code contained a typo:
> 
>*(intptr_t*) out = ival;
> 
> should be
> 
>*(intptr_t*) out = icmp;
> 
> However it doesn't affect the bug.

ahh sorry posted to a wrong thread.

[Bug tree-optimization/105495] `__atomic_compare_exchange` prevents tail-call optimization

2024-10-14 Thread lh_mouse at 126 dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105495

--- Comment #7 from LIU Hao  ---
Oh, the sample code contained a typo:

   *(intptr_t*) out = ival;

should be

   *(intptr_t*) out = icmp;

However it doesn't affect the bug.

[Bug tree-optimization/117148] `-Os` results in much larger code than `-O2` about bitfields

2024-10-14 Thread lh_mouse at 126 dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117148

--- Comment #2 from LIU Hao  ---
Oh, the sample code contained a typo:

   *(intptr_t*) out = ival;

should be

   *(intptr_t*) out = icmp;

However it doesn't affect the bug. (https://godbolt.org/z/fdxbbadnj) It's
because GCC fail to inline `atomic_load_iptr`. Forcing that function to be
inlined with `always_inline` seems a workaround.

[Bug middle-end/117141] New: gcc/match.pd: patten duplicates around signed_integer_sat_sub

2024-10-14 Thread slyfox at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117141

Bug ID: 117141
   Summary: gcc/match.pd: patten duplicates around
signed_integer_sat_sub
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: slyfox at gcc dot gnu.org
  Target Milestone: ---

Noticed today that `gcc/match.pd` contains duplicate patterns. Build also
complains about them on `x86_64-linux` as:

build/genmatch --generic \
--header=tmp-generic-match-auto.h --include=generic-match-auto.h \
/home/slyfox/dev/git/gcc/gcc/match.pd  tmp-generic-match-1.cc 
tmp-generic-match-2.cc  tmp-generic-match-3.cc  tmp-generic-match-4.cc 
tmp-generic-match-5.cc  tmp-generic-match-6.cc  tmp-generic-match-7.cc 
tmp-generic-match-8.cc  tmp-generic-match-9.cc  tmp-generic-match-10.cc
/home/slyfox/dev/git/gcc/gcc/match.pd:3424:3 warning: duplicate pattern
 (cond^ (ne (imagpart (IFN_SUB_OVERFLOW:c@2 @0 @1)) integer_zerop)
  ^
/home/slyfox/dev/git/gcc/gcc/match.pd:3397:3 warning: previous pattern defined
here
 (cond^ (ne (imagpart (IFN_SUB_OVERFLOW@2 @0 @1)) integer_zerop)
  ^
(COND_EXPR (NE_EXPR (IMAGPART_EXPR (CFN_SUB_OVERFLOW @0 @1)@2) integer_zerop)
(BIT_XOR_EXPR (NEGATE_EXPR (CONVERT_EXPR (LT_EXPR @0 integer_zerop)))
max_value) (REALPART_EXPR @2))
/home/slyfox/dev/git/gcc/gcc/match.pd:3424:3 warning: duplicate pattern
 (cond^ (ne (imagpart (IFN_SUB_OVERFLOW:c@2 @0 @1)) integer_zerop)
  ^
/home/slyfox/dev/git/gcc/gcc/match.pd:3397:3 warning: previous pattern defined
here
 (cond^ (ne (imagpart (IFN_SUB_OVERFLOW@2 @0 @1)) integer_zerop)
  ^
(COND_EXPR (NE_EXPR (IMAGPART_EXPR (CFN_SUB_OVERFLOW @0 @1)@2) integer_zerop)
(BIT_XOR_EXPR max_value (NEGATE_EXPR (CONVERT_EXPR (LT_EXPR @0
integer_zerop (REALPART_EXPR @2))

$ gcc/xgcc -Bgcc -v
Reading specs from gcc/specs
COLLECT_GCC=gcc/xgcc
COLLECT_LTO_WRAPPER=gcc/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/slyfox/dev/git/gcc/configure --disable-multilib
--disable-bootstrap --disable-lto --disable-libsanitizer
--disable-libstdcxx-pch --enable-languages=c,c++ --disable-libgomp
--disable-libquadmath --disable-libvtv CFLAGS='-O1 -ggdb3' CXXFLAGS='-O1
-ggdb3' LDFLAGS='-O1 -ggdb3'
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20241014 (experimental) (GCC)

[Bug target/117116] [15 regression] error: unrecognizable insn: with -march=znver3

2024-10-14 Thread ubizjak at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117116

--- Comment #12 from Uroš Bizjak  ---
Created attachment 59348
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59348&action=edit
Proposed patch

Patch in testing.

Just leave CONST_VECTOR RTXes that won't simplify to integer in memory. The
follow-up code that handles (offsettable_memref_p (operand)) handles
CONST_VECTOR RTXes in memory just fine.

I tried to split V2SImode CONST_VECTOR to two SImode CONST elements, but there
were some further ICEs generated, and it is getting a bit late here...

[Bug c/117139] ICE with invalid constexpr expression (tree check: expected integer_cst, have real_cst in get_len, at tree.h:6509)

2024-10-14 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117139

--- Comment #1 from Sam James  ---
Note that for GCC 14 without checking (see https://godbolt.org/z/Tb53j8WWz),
the user reports an odd "confused by earlier errors, bailing out" note:

"""
gcc-14 (14.2.1_p20240921 p1) also is a bit weird about the same:
gcc -O2 -pipe -Wall --std=gnu23 -o test test.c
test.c:1:25: error: ‘constexpr’ integer initializer is not an integer constant
expression
1 | constexpr int myconst = 2 * 2.5;
  | ^
test.c:1: confused by earlier errors, bailing out

The first message is actually correct - the line is not valid, and was used
during playing with the limits of constexpr.
"""

[Bug c/117139] ICE with invalid constexpr expression (tree check: expected integer_cst, have real_cst in get_len, at tree.h:6509)

2024-10-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117139

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2024-10-14
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW

--- Comment #2 from Andrew Pinski  ---
Confirmed.

[Bug middle-end/117141] gcc/match.pd: patten duplicates around signed_integer_sat_sub

2024-10-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117141

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2024-10-14
 CC||pinskia at gcc dot gnu.org

--- Comment #1 from Andrew Pinski  ---
(match (signed_integer_sat_sub @0 @1)
 (cond^ (ne (imagpart (IFN_SUB_OVERFLOW@2 @0 @1)) integer_zerop)
(bit_xor:c (negate (convert (lt @0 integer_zerop)))
   max_value)
(realpart @2))
 (if (INTEGRAL_TYPE_P (type) && !TYPE_UNSIGNED (type)
  && types_match (type, @0, @1


(match (signed_integer_sat_sub @0 @1)
 (cond^ (ne (imagpart (IFN_SUB_OVERFLOW:c@2 @0 @1)) integer_zerop)
(bit_xor:c (nop_convert?
(negate (nop_convert? (convert (lt @0 integer_zerop)
   max_value)
(realpart @2))
 (if (INTEGRAL_TYPE_P (type) && !TYPE_UNSIGNED (type)
  && types_match (type, @0, @1


The difference is the second has a optional nop_convert which allows for the
first one.

I think the first one can be safely removed as the second one will match it
too.

So confirmed.

[Bug pch/54050] Add support for chaining of PCH

2024-10-14 Thread egallager at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54050

Eric Gallager  changed:

   What|Removed |Added

Summary|chaining|Add support for chaining of
   ||PCH
 CC||egallager at gcc dot gnu.org

--- Comment #3 from Eric Gallager  ---
retitling to clarify

[Bug debug/111425] ia64: ICE in net/ipv4/fib_semantics.c:1621:1: internal compiler error: Segmentation fault

2024-10-14 Thread frank.scheiner at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111425

--- Comment #9 from Frank Scheiner  ---
Looks like this is fixed in gcc-15-20241013, I assume thanks to the fix for
#116627. Just checked that cross-building Linux v6.12-rc3 for ia64 with the
mentioned snapshot now works w/o using the workaround patch ([1]):

```
[...]
Making kernel...
time make -j8 LOCALVERSION="-80ea26b1f-ia64-ice-check" ARCH=ia64
CROSS_COMPILE=ia64-linux- all
Tue Oct 15 12:21:24 AM CEST 2024
[...]
  NM  .tmp_vmlinux2.syms
  KSYMS   .tmp_vmlinux2.kallsyms.S
  AS  .tmp_vmlinux2.kallsyms.o
  LD  vmlinux
  NM  System.map
  OBJCOPY vmlinux.bin
  GZIPvmlinux.gz
No errors detected in 27904 functions.

real7m55.590s
user57m29.416s
sys 2m27.477s
0
Tue Oct 15 12:29:20 AM CEST 2024
```

[1]:
http://epic-linux.org/testing-effort/patches/ia64-linux-workaround-ice-with-gcc-13-v2.patch

Great! Thanks Andrew for linking #116627 to this bug. I have hoped those were
related.

I still need to confirm that with compilers w/ and w/o [2] applied, to be sure,
though. Waiting to mark thsi bug resolved until then.

[2]: https://gcc.gnu.org/g:73726725ae03995ef8b61622c954f7ca70416f79

[Bug c/117144] Waddress warning does not show up via macros with integrated preprocessor

2024-10-14 Thread syq at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117144

YunQiang Su  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|UNCONFIRMED |RESOLVED

--- Comment #3 from YunQiang Su  ---
Thanks. So let's close it.

[Bug c/117144] New: More warnings if gcc -E xx.c -o xx.i and gcc -c xx.i

2024-10-14 Thread syq at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117144

Bug ID: 117144
   Summary: More warnings if gcc -E xx.c -o xx.i and gcc -c xx.i
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: syq at gcc dot gnu.org
  Target Milestone: ---

We may get some warning if
```
gcc -E -O2 xx.c -o xx.i
gcc -c -O2 xx.i -o xx.o
```

While not if `gcc -c` directly.

This is an example:
```
#define NULL (void *)0

#define hashmap_cast_ptr(p) ({ 
\
_Static_assert((__builtin_constant_p((p)) ? (p) == NULL : 0) ||
\
sizeof(*(p)) == sizeof(long),  
\
   #p " pointee should be a long-sized integer or a
pointer");  \
(long *)(p);   
\
})

_Bool hashmap_find(long *map, long key, long *cands) {
if (*map > key) {
cands = map;
return 1==1;
}
cands = NULL;
return 1==0;
}

long *test (long *map, int key)  {
long *value = NULL;
if (hashmap_find((map), (long)(key), hashmap_cast_ptr(&value)))
return value;
return NULL;
}
```
$ gcc -c -O2 xx.c 
$ gcc -c -Wall -O2 xx.c 
$ gcc -O2 -E xx.c -o xx.i 
$ gcc -O2 -c -Wall xx.i -o xx.o
xx.c: In function ‘test’:
xx.c:21:107: warning: the comparison will always evaluate as ‘false’ for the
address of ‘value’ will never be NULL [-Waddress]
   21 | if (hashmap_find((map), (long)(key), hashmap_cast_ptr(&value)))
  |
  ^ 
xx.c:20:15: note: ‘value’ declared here
   20 | long *value = NULL;
  |   ^
```

I find this problem when I try to use distcc to build libbpf/libbpf.c from
linux kernel.

[Bug c/117144] Waddress warning does not show up via macros with integrated preprocessor

2024-10-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117144

Andrew Pinski  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=102867

--- Comment #1 from Andrew Pinski  ---
I think this is by design, see PR 102867 .

[Bug c/117144] Waddress warning does not show up via macros with integrated preprocessor

2024-10-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117144

--- Comment #2 from Andrew Pinski  ---
Note you can easily reproduce it by using `-save-temps` .

[Bug target/113341] Using GCC as the bootstrap compiler breaks LLVM on 32-bit PowerPC

2024-10-14 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113341

Sam James  changed:

   What|Removed |Added

   See Also||https://github.com/llvm/llv
   ||m-project/pull/111995

--- Comment #18 from Sam James  ---
See https://github.com/llvm/llvm-project/pull/111995 which fixes a problem that
bisected to the same commit on ppc32.

[Bug tree-optimization/117145] New: ICE: in make_ssa_name_fn, at tree-ssanames.cc:355 at -O1 and above with vector_size

2024-10-14 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117145

Bug ID: 117145
   Summary: ICE: in make_ssa_name_fn, at tree-ssanames.cc:355 at
-O1 and above with vector_size
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

***
OS and Platform:
$ uname -a:
Linux 65dac7c84719 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC
2023 x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
Using built-in specs.
COLLECT_GCC=/home/software/gcc-trunk-3aa004f/bin/gcc
COLLECT_LTO_WRAPPER=/home/software/gcc-trunk-3aa004f/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --disable-multilib --disable-bootstrap
--enable-languages=c,c++ --prefix=/home/software/gcc-trunk-3aa004f
--enable-coverage
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240630 (experimental) (GCC) 

***
Program:
$ cat mutant.c
int a;
void b();
int e(int *c, struct d{__attribute__((vector_size(4))) char an[*c]} *) {
  sizeof(struct d);
}
void f() {
  if (e(&a, 0))
b();
}

***
Command Lines:
$ gcc -O1 mutant.c
mutant.c:3:67: warning: no semicolon at end of struct or union
3 | int e(int *c, struct d{__attribute__((vector_size(4))) char an[*c]} *)
{
  |   ^
mutant.c:3:22: warning: 'struct d' declared inside parameter list will not be
visible outside of this definition or declaration
3 | int e(int *c, struct d{__attribute__((vector_size(4))) char an[*c]} *)
{
  |  ^
during IPA pass: inline
In function 'e':
cc1: internal compiler error: in make_ssa_name_fn, at tree-ssanames.cc:355
0x5071bcf diagnostic_context::report_diagnostic(diagnostic_info*)
???:0
0x50724a1 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, int, char const*, __va_list_tag (*) [1],
diagnostic_t)
???:0
0x50924c7 internal_error(char const*, ...)
???:0
0x50729e4 fancy_abort(char const*, int, char const*)
???:0
0x2499c77 make_ssa_name_fn(function*, tree_node*, gimple*, unsigned int)
???:0
0x11a4332 make_ssa_name(tree_node*, gimple*)
???:0
0x202beeb copy_tree_body_r(tree_node**, int*, void*)
???:0
0x2697510 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*))
???:0
0x2699036 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*))
???:0
0x2028ab8 remap_type(tree_node*, copy_body_data*)
???:0
0x20244c2 remap_decl(tree_node*, copy_body_data*)
???:0
0x2028ab8 remap_type(tree_node*, copy_body_data*)
???:0
0x2028ab8 remap_type(tree_node*, copy_body_data*)
???:0
0x20244c2 remap_decl(tree_node*, copy_body_data*)
???:0
0x204a890 tree_function_versioning(tree_node*, tree_node*,
vec*, ipa_param_adjustments*, bool,
bitmap_head*, basic_block_def*)
???:0
0x187c46c inline_transform(cgraph_node*)
???:0
0x1c23e63 execute_all_ipa_transforms(bool)
???:0
0x12524ae cgraph_node::expand()
???:0
0x12549cc symbol_table::compile()
???:0
0x1255373 symbol_table::finalize_compilation_unit()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

It can be compiled normally without vector_size attribute.
Also ICE on trunk.
Compiler Explorer: https://godbolt.org/z/T6bP3vzae

[Bug ipa/117145] [14/15 Regression] ICE: in make_ssa_name_fn, at tree-ssanames.cc:355 at -O1 and above with vector_size and VLA in struct argument

2024-10-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117145

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |14.3
Summary|ICE: in make_ssa_name_fn,   |[14/15 Regression] ICE: in
   |at tree-ssanames.cc:355 at  |make_ssa_name_fn, at
   |-O1 and above with  |tree-ssanames.cc:355 at -O1
   |vector_size |and above with vector_size
   ||and VLA in struct argument
  Component|tree-optimization   |ipa
  Known to work||13.3.0
  Known to fail||14.1.0
 Ever confirmed|0   |1
   Last reconfirmed||2024-10-15
 Status|UNCONFIRMED |NEW
   Keywords||ice-on-valid-code,
   ||needs-bisection
 CC||pinskia at gcc dot gnu.org

--- Comment #1 from Andrew Pinski  ---
Confirmed.

[Bug ipa/117145] [14/15 Regression] ICE: in make_ssa_name_fn, at tree-ssanames.cc:355 at -O1 and above with vector_size and VLA in struct argument

2024-10-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117145

Andrew Pinski  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=112488

--- Comment #2 from Andrew Pinski  ---
  gcc_assert (VAR_P (var)
  || TREE_CODE (var) == PARM_DECL
  || TREE_CODE (var) == RESULT_DECL
  || (TYPE_P (var) && is_gimple_reg_type (var)));

Looks so much like PR 112488 .

[Bug c/117139] ICE with invalid constexpr expression (tree check: expected integer_cst, have real_cst in get_len, at tree.h:6509)

2024-10-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117139

--- Comment #3 from Andrew Pinski  ---
Even more reduced:
```
constexpr int myconst = 5.0;
```

Also ICEs with complex integer too:
```
constexpr int myconst = 5i;
```

[Bug fortran/117136] [15 regression] ICE for gfortran.dg/typebound_operator_11.f90 since r15-4298-g3269a722b7a036

2024-10-14 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117136

Sam James  changed:

   What|Removed |Added

 CC||vehre at gcc dot gnu.org
   Keywords||ice-on-valid-code
Summary|ice for |[15 regression] ICE for
   |gfortran.dg/typebound_opera |gfortran.dg/typebound_opera
   |tor_11.f90  |tor_11.f90 since
   ||r15-4298-g3269a722b7a036

--- Comment #2 from Sam James  ---
https://inbox.sourceware.org/gcc-patches/20241014140536.581ce56a@vepi2/

[Bug ipa/91682] IPA-cp can not propagate value for by-ref argument in form of *arg = param op constant

2024-10-14 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91682

Sam James  changed:

   What|Removed |Added

   Target Milestone|--- |10.0

[Bug pch/79306] ICE on valid code building WebRTC with PCH

2024-10-14 Thread egallager at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79306

Eric Gallager  changed:

   What|Removed |Added

Summary|ICE on valid code   |ICE on valid code building
   ||WebRTC with PCH
 Resolution|--- |INVALID
 Status|WAITING |RESOLVED
 CC||egallager at gcc dot gnu.org
   Keywords||ice-on-valid-code,
   ||needs-reduction,
   ||needs-testcase

--- Comment #2 from Eric Gallager  ---
(In reply to Richard Biener from comment #1)
> Usually an invalid use of PCH not correctly diagnosed.  GCC 4.8 is no longer
> maintained and later releases contain mitigations against more invalid uses
> so please check at least GCC 5.

Reporter never got back with this info, so closing.

[Bug libstdc++/44952] #include implies global constructor.

2024-10-14 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44952

--- Comment #19 from Sam James  ---
Is this one essentially fixed? I don't see a way of handling it for non-ELF and
I doubt anyone really cares much about that for an optimisation like this.

[Bug target/117116] [15 regression] error: unrecognizable insn: with -march=znver3

2024-10-14 Thread liuhongt at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117116

Hongtao Liu  changed:

   What|Removed |Added

   Assignee|liuhongt at gcc dot gnu.org|uros at gcc dot gnu.org

--- Comment #13 from Hongtao Liu  ---
(In reply to Uroš Bizjak from comment #12)
>It's not a problem with the above pattern, which *does* support V2DI:
Oh, yes, I must have been blind not to see that v2di.

> Created attachment 59348 [details]
> Proposed patch
> 
> Patch in testing.
> 
> Just leave CONST_VECTOR RTXes that won't simplify to integer in memory. The
> follow-up code that handles (offsettable_memref_p (operand)) handles
> CONST_VECTOR RTXes in memory just fine.
> 
> I tried to split V2SImode CONST_VECTOR to two SImode CONST elements, but
> there were some further ICEs generated, and it is getting a bit late here...?

The codegen looks much better, please go ahead with the patch.

[Bug target/79786] [12/13/14/15 Regression] ICE tree check: expected class 'type', have 'declaration' (var_decl) in iamcu_alignment, at config/i386/i386.c:30263

2024-10-14 Thread liuhongt at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79786

Hongtao Liu  changed:

   What|Removed |Added

 CC||liuhongt at gcc dot gnu.org

--- Comment #7 from Hongtao Liu  ---
(In reply to Richard Biener from comment #6)
> Hongtao - do we care about -miamcu?  Should we eventually deprecate it?  Can
> you pick up the fix from comment #2?  The bug shows the option is
> practically ununsed I guess.

I need to check with my coworkers, but given this particular moment, it may
take some time and then get back to you.

[Bug fortran/117136] ice for gfortran.dg/typebound_operator_11.f90

2024-10-14 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117136

--- Comment #1 from anlauf at gcc dot gnu.org ---
Running f951 under valgrind I see:

==5119== Conditional jump or move depends on uninitialised value(s)
==5119==at 0xAF2DFC: gfc_conv_procedure_call(gfc_se*, gfc_symbol*,
gfc_actual_arglist*, gfc_expr*, vec*)
(trans-expr.cc:8256)
==5119==by 0xAF7DDD: gfc_conv_procedure_call(gfc_se*, gfc_symbol*,
gfc_actual_arglist*, gfc_expr*, vec*)
(trans-expr.cc:6831)
==5119==by 0xB51AE2: gfc_trans_call(gfc_code*, bool, tree_node*,
tree_node*, bool) (trans-stmt.cc:425)
==5119==by 0xAB0F13: trans_code(gfc_code*, tree_node*) (trans.cc:2434)
==5119==by 0xAE8214: gfc_generate_function_code(gfc_namespace*)
(trans-decl.cc:7958)
==5119==by 0xAB64C1: gfc_generate_module_code(gfc_namespace*)
(trans.cc:2780)
==5119==by 0xA56F8A: translate_all_program_units(gfc_namespace*)
(parse.cc:7159)
==5119==by 0xA57989: gfc_parse_file() (parse.cc:7489)
==5119==by 0xAADBEF: gfc_be_parse_file() (f95-lang.cc:241)
==5119==by 0x111DB4D: compile_file() (toplev.cc:451)
==5119==by 0x99CEDE: do_compile (toplev.cc:2209)
==5119==by 0x99CEDE: toplev::main(int, char**) (toplev.cc:2369)
==5119==by 0x99E89A: main (main.cc:39)

The offending line is traced back to r15-4298-g3269a722b7a036 by Tobias.

Can you try the following patch?

diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc
index b9f585d0d2f..2f6d3b06889 100644
--- a/gcc/fortran/trans-expr.cc
+++ b/gcc/fortran/trans-expr.cc
@@ -6378,7 +6381,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
   gfc_actual_arglist *arg;
   int has_alternate_specifier = 0;
   bool need_interface_mapping;
-  bool is_builtin;
+  bool is_builtin = false;
   bool callee_alloc;
   bool ulim_copy;
   gfc_typespec ts;

[Bug c++/107151] Specializing a concepted template can emit bogus assembly

2024-10-14 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107151

Patrick Palka  changed:

   What|Removed |Added

 CC||ppalka at gcc dot gnu.org
 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #3 from Patrick Palka  ---
(In reply to Jonathan Wakely from comment #2)
> I think this is PR 100825
Yeah, GCC 14 successfully compiles the testcase ever since the constraint
mangling patch r14-6064

*** This bug has been marked as a duplicate of bug 100825 ***

[Bug c++/100825] function signature constraints are not a part of mangled name

2024-10-14 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100825

Patrick Palka  changed:

   What|Removed |Added

 CC||blubban at gmail dot com

--- Comment #15 from Patrick Palka  ---
*** Bug 107151 has been marked as a duplicate of this bug. ***

[Bug c++/100825] function signature constraints are not a part of mangled name

2024-10-14 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100825

--- Comment #16 from Patrick Palka  ---
*** Bug 103884 has been marked as a duplicate of this bug. ***

[Bug c++/103884] ICE when calling static and non-static member function templates with the same parameter types and requires clause

2024-10-14 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103884

Patrick Palka  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #2 from Patrick Palka  ---
Fixed since r14-6064, thus essentially a dup of PR100825

*** This bug has been marked as a duplicate of bug 100825 ***

[Bug target/117140] [15 regression] RISC-V: ICE in initialize_flags_in_bb for rv32gcv

2024-10-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117140

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
   Target Milestone|--- |15.0

[Bug target/49564] [cppcheck][patch] fixed resource and memory leaks in /gcc/gcc/config/alpha/host-osf.c

2024-10-14 Thread egallager at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49564

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org

--- Comment #4 from Eric Gallager  ---
(In reply to Martin Ettl from comment #0)
> Created attachment 24619 [details]
> proposed patch to fix the issues
> 
> cppcheck revealed two resource leaks and a memory leak in
> /gcc/gcc/config/alpha/host-osf.c.
> 
> Please refer the attached patch that fixed the issues.
> 
> Best regards from the cppcheck team
> 
> Martin

Please send the patch to the gcc-patches mailing list for review, if it still
applies. Although it looks like the whitespace may need a bit of cleanup to be
consistent.

[Bug other/89863] [meta-bug] Issues in gcc that other static analyzers (cppcheck, clang-static-analyzer, PVS-studio) find that gcc misses

2024-10-14 Thread egallager at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89863
Bug 89863 depends on bug 47170, which changed state.

Bug 47170 Summary: [cppcheck][PATCH] found resource leaks in 
gcc/intl/localealias.c
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47170

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |WONTFIX

[Bug ipa/115033] [12 Regression] Incorrect optimization of by-reference closure fields by fre1 pass since r12-5113-gd70ef65692fced

2024-10-14 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115033

--- Comment #26 from GCC Commits  ---
The releases/gcc-12 branch has been updated by Sam James :

https://gcc.gnu.org/g:f2686f12e9345d95a2d6b7291bd777501d197869

commit r12-10768-gf2686f12e9345d95a2d6b7291bd777501d197869
Author: Jan Hubicka 
Date:   Mon Jul 22 18:08:08 2024 +0200

Fix modref_eaf_analysis::analyze_ssa_name handling of values dereferenced
to function call parameters

modref_eaf_analysis::analyze_ssa_name misinterprets EAF flags.  If
dereferenced
parameter is passed (to map_iterator in the testcase) it can be returned
indirectly which in turn makes it to escape into the next function call.

PR ipa/115033

gcc/ChangeLog:

* ipa-modref.cc (modref_eaf_analysis::analyze_ssa_name): Fix
checking of
EAF flags when analysing values dereferenced as function
parameters.

gcc/testsuite/ChangeLog:

* gcc.c-torture/execute/pr115033.c: New test.

(cherry picked from commit cf8ffc58aad3127031c229a75cc4b99c8ace25e0)

[Bug ipa/114207] [12 Regression] modref gets confused by vectorized code `-O3 -fno-tree-forwprop` since r12-5439

2024-10-14 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114207

--- Comment #10 from GCC Commits  ---
The releases/gcc-12 branch has been updated by Sam James :

https://gcc.gnu.org/g:e098149b6b2c61ffe9e758dcd3ef021a78f2d132

commit r12-10767-ge098149b6b2c61ffe9e758dcd3ef021a78f2d132
Author: Jan Hubicka 
Date:   Mon Jul 22 18:05:26 2024 +0200

Fix accounting of offsets in unadjusted_ptr_and_unit_offset

unadjusted_ptr_and_unit_offset accidentally throws away the offset computed
by
get_addr_base_and_unit_offset. Instead of passing extra_offset it passes
offset.

PR ipa/114207

gcc/ChangeLog:

* ipa-prop.cc (unadjusted_ptr_and_unit_offset): Fix accounting of
offsets in ADDR_EXPR.

gcc/testsuite/ChangeLog:

* gcc.c-torture/execute/pr114207.c: New test.

(cherry picked from commit 391f46f10b0586c074014de82efe76787739bb0c)

[Bug tree-optimization/113787] [12 Regression] Wrong code at -O with ipa-modref on aarch64

2024-10-14 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113787

--- Comment #26 from GCC Commits  ---
The releases/gcc-12 branch has been updated by Sam James :

https://gcc.gnu.org/g:92889011625f16e7eed654a137b9c14a29282917

commit r12-10769-g92889011625f16e7eed654a137b9c14a29282917
Author: Jan Hubicka 
Date:   Thu May 16 15:33:55 2024 +0200

Fix points_to_local_or_readonly_memory_p wrt TARGET_MEM_REF

TARGET_MEM_REF can be used to offset constant base into a memory object (to
produce lea instruction).  This confuses
points_to_local_or_readonly_memory_p
which treats the constant address as a base of the access.

Bootstrapped/regtsted x86_64-linux, comitted.
Honza

gcc/ChangeLog:

PR ipa/113787
* ipa-fnsummary.cc (points_to_local_or_readonly_memory_p): Do not
look into TARGET_MEM_REFS with constant opreand 0.

gcc/testsuite/ChangeLog:

* gcc.c-torture/execute/pr113787.c: New test.

(cherry picked from commit 96d53252aefcbc2fe419c4c3b4bcd3fc03d4d187)

[Bug ipa/111613] [12 Regression] Bit field stores can be incorrectly optimized away when -fstore-merging is in effect since r12-5383-g22c242342e38eb

2024-10-14 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111613

--- Comment #18 from GCC Commits  ---
The releases/gcc-12 branch has been updated by Sam James :

https://gcc.gnu.org/g:65b67169fb1c641a11973988bd439e255d62131a

commit r12-10771-g65b67169fb1c641a11973988bd439e255d62131a
Author: Jan Hubicka 
Date:   Mon Jul 22 19:00:39 2024 +0200

Fix modref's iteraction with store merging

Hi,
this patch fixes wrong code in case store-merging introduces load of
function
parameter that was previously write-only (which happens for bitfields).
Without this, the whole store-merged area is consdered to be killed.

PR ipa/111613

gcc/ChangeLog:

* ipa-modref.cc (analyze_parms): Do not preserve EAF_NO_DIRECT_READ
and
EAF_NO_INDIRECT_READ from past flags.

gcc/testsuite/ChangeLog:

* gcc.c-torture/pr111613.c: New test.

(cherry picked from commit 14074773350ffed7efdebbc553adf0f23b572e87)

[Bug other/47170] [cppcheck][PATCH] found resource leaks in gcc/intl/localealias.c

2024-10-14 Thread egallager at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47170

Eric Gallager  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |WONTFIX
 CC||egallager at gcc dot gnu.org

--- Comment #2 from Eric Gallager  ---
GCC no longer contains this file; closing.

[Bug tree-optimization/109985] [12/14 Regression] __builtin_prefetch ignored by GCC 12/13

2024-10-14 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109985

--- Comment #12 from GCC Commits  ---
The releases/gcc-12 branch has been updated by Sam James :

https://gcc.gnu.org/g:b454ad0e4eb6bb38a6dfe15a43acb6792315640b

commit r12-10770-gb454ad0e4eb6bb38a6dfe15a43acb6792315640b
Author: Jan Hubicka 
Date:   Mon Jul 22 23:01:50 2024 +0200

Fix handling of ICF_NOVOPS in ipa-modref

As shown in somewhat convoluted testcase, ipa-modref is mistreating
ECF_NOVOPS as "having no side effects".  This come from time when
modref cared only about memory accesses and thus it was possible to
shortcut on it.

This patch removes (hopefully) all those bad shortcuts.
Bootstrapped/regtested x86_64-linux, comitted.

gcc/ChangeLog:

PR ipa/109985

* ipa-modref.cc (modref_summary::useful_p): Fix handling of
ECF_NOVOPS.
(modref_access_analysis::process_fnspec): Likevise.
(modref_access_analysis::analyze_call): Likevise.
(propagate_unknown_call): Likevise.
(modref_propagate_in_scc): Likevise.
(modref_propagate_flags_in_scc): Likewise.
(ipa_merge_modref_summary_after_inlining): Likewise.

(cherry picked from commit efcbe7b985e24ac002a863afd609c44a67761195)

[Bug target/116883] Compile cpp code with rv32imafc_zve32f failed

2024-10-14 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116883

Huaqi  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from Huaqi  ---
This patch https://gcc.gnu.org/g:fd8e590ff11266598d8f9b3d03d72ba7a6100512
 fixed my case, thanks .

[Bug c++/106057] Missed stmt_can_throw_external check in stmt_kills_ref_p

2024-10-14 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106057

Sam James  changed:

   What|Removed |Added

   Keywords||EH, wrong-code
 CC||sjames at gcc dot gnu.org

--- Comment #6 from Sam James  ---
I was about to close this as done but the testcase in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106057#c0 aborts at -O2 for me
with 10..15 (not tried others).

[Bug c++/117146] New: ICE on error recovery with openscad-2021.01

2024-10-14 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117146

Bug ID: 117146
   Summary: ICE on error recovery with openscad-2021.01
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Keywords: error-recovery
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: sjames at gcc dot gnu.org
  Target Milestone: ---

Originally reported downstream in Gentoo at https://bugs.gentoo.org/941523.

```
$ x86_64-pc-linux-gnu-g++ -c -O3 -march=native -mtls-dialect=gnu2
-fno-semantic-interposition -pipe -fcf-protection=none
-fdiagnostics-color=always -fdiagnostics-urls=never -frecord-gcc-switches
-fdiagnostics-explain-harder -Wa,-O2 -Wa,-mtune=znver2 -Warray-bounds=2
-Wstrict-aliasing -Wfree-nonheap-object -Werror=lto-type-mismatch
-Werror=strict-aliasing -Werror=odr -Wformat -Werror=format-security
-DSTACKSIZE=8388608 -fno-strict-aliasing -std=c++1y -I/usr/include/cairo
-I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/harfbuzz
-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1
-I/usr/include -I/usr/include/hidapi -I/usr/include/libxml2
-I/usr/include/lib3mf -I/usr/include/freetype2 -I/usr/include/harfbuzz
-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2
-I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include
-I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/glib-2.0
-I/usr/lib64/glib-2.0/include -I/usr/include/glib-2.0
-I/usr/lib64/glib-2.0/include -DEIGEN_DONT_ALIGN -frounding-math -D_REENTRANT
-Wall -Wextra -Wno-unused-local-typedefs -fPIC -DOPENSCAD_VERSION=2021.01
-DOPENSCAD_SHORTVERSION=2021.01 -DOPENSCAD_YEAR=2021.0 -DOPENSCAD_MONTH=01.0
-DOPENSCAD_DAY=.0 -DDEBUG -DSTACKSIZE=8388608 -DUSE_QOPENGLWIDGET -DENABLE_DBUS
-DENABLE_JOYSTICK -DENABLE_CAIRO -DENABLE_SPNAV -DENABLE_HIDAPI -DENABLE_LIBZIP
-DLIB3MF_API_2 -DENABLE_LIB3MF -DENABLE_OPENCSG -DENABLE_CGAL
-DCGAL_HEADER_ONLY -DUSE_SCINTILLA_EDITOR -DQSCINTILLA_DLL -DQT_NO_DEBUG
-DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_MULTIMEDIA_LIB -DQT_GUI_LIB
-DQT_CONCURRENT_LIB -DQT_NETWORK_LIB -DQT_DBUS_LIB -DQT_CORE_LIB -I. -Isrc
-Isrc/ext/libtess2/Include -I/usr/include/qt5 -I/usr/include/qt5/QtPrintSupport
-I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtMultimedia
-I/usr/include/qt5/QtGui -I/usr/include/qt5/QtConcurrent
-I/usr/include/qt5/QtNetwork -I/usr/include/qt5/QtDBus
-I/usr/include/qt5/QtCore -Iobjects -I/usr/include/eigen3
-I/usr/lib64/qt5/mkspecs/linux-g++ -o objects/src/polyset-utils.o
src/polyset-utils.cc
In file included from /usr/include/CGAL/license/Nef_3.h:17,
 from /usr/include/CGAL/Nef_3/SNC_iteration.h:18,
 from src/ext/CGAL/CGAL_workaround_Mark_bounded_volumes.h:36,
 from src/cgal.h:12,
 from src/cgalutils.h:3,
 from src/polyset-utils.cc:9:
/usr/include/CGAL/config.h:147:2: error: #error "CGAL requires C++ 17"
  147 | #error "CGAL requires C++ 17"
  |  ^
In file included from /usr/include/CGAL/basic.h:27,
 from /usr/include/CGAL/number_type_basic.h:23,
 from /usr/include/CGAL/Gmpq.h:16,
 from src/cgal.h:13:
[...]
/usr/include/CGAL/double.h:190:25:   required from here
   
06:32:22 [22/9470]
  190 |   return CGAL::is_finite(d) && (std::ceil(d) == d);
  |  ~~~^~~
/usr/include/CGAL/number_utils.h:253:1: error: no type named ‘result_type’ in
‘class CGAL::Real_embeddable_traits::Is_finite’
  253 | is_finite( const Real_embeddable& x ) {
  | ^
In file included from /usr/include/CGAL/Interval_nt.h:41,
 from /usr/include/CGAL/long_double.h:27,
 from /usr/include/CGAL/number_type_basic.h:52:
/usr/include/CGAL/Interval_traits.h: At global scope:
/usr/include/CGAL/Interval_traits.h:60:17: internal compiler error:
Segmentation fault
   60 |   typedef CGAL::Tag_falseIs_interval;
  | ^
0x5d3f319c9e1b internal_error(char const*, ...)
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/diagnostic-global-context.cc:517
0x5d3f311e892d crash_signal
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/toplev.cc:322
0x719fa161e3ef ???
   
/usr/src/debug/sys-libs/glibc-2.40-r5/glibc-2.40/signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x5d3f32621a0e contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/tree.h:3778
0x5d3f32621a0e tree_decl_hash::hash(tree_node*)
/usr/src/debug/sys-devel/gcc-15.0./gcc-15.0./gcc/tree.h:5914
0x5d3f31af5e6f simple_hashmap_traits::hash(tree_node* const&)
   
/usr/src/debug/sys-devel/gcc-15.0./gcc-1

[Bug c++/117146] ICE on error recovery with openscad-2021.01

2024-10-14 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117146

--- Comment #1 from Sam James  ---
==2895333== Invalid read of size 2
==2895333==at 0x1C94E6B: UnknownInlinedFun (hash-map-traits.h:50)
==2895333==by 0x1C94E6B: UnknownInlinedFun (hash-map.h:52)
==2895333==by 0x1C94E6B: hash_table >::hash_entry, false,
xcallocator>::verify(tree_node* const
&, unsigned int) [clone .isra.0] (hash-table.h:1116)
==2895333==by 0x1E: ???
==2895333==by 0x12224B: UnknownInlinedFun (hash-table.h:1046)
==2895333==by 0x12224B: UnknownInlinedFun (hash-map.h:201)
==2895333==by 0x12224B: UnknownInlinedFun (hash-map.h:376)
==2895333==by 0x12224B: cp_adjust_diagnostic_info(diagnostic_context*,
diagnostic_info*) [clone .part.0] [clone .cold] (error.cc:242)
==2895333==by 0x1CBFC1B: UnknownInlinedFun (opts-common.cc:1861)
==2895333==by 0x1CBFC1B:
diagnostic_context::report_diagnostic(diagnostic_info*) (diagnostic.cc:1227)
==2895333==by 0x1CBF5B4:
diagnostic_context::diagnostic_impl(rich_location*, diagnostic_metadata const*,
diagnostic_option_id, char const*, __va_list_tag (*) [1], diagnostic_t) (diag
nostic.cc:1425)
==2895333==by 0x319875: error_at(rich_location*, char const*, ...)
(diagnostic-global-context.cc:439)
==2895333==by 0x3C2FA4: cp_parser_diagnose_invalid_type_name(cp_parser*,
tree_node*, unsigned int) [clone .lto_priv.0] [clone .cold] (parser.cc:3868)
==2895333==by 0x26CC34C:
cp_parser_parse_and_diagnose_invalid_type_name(cp_parser*) [clone .lto_priv.0]
(parser.cc:3975)
==2895333==by 0x1ED144E: cp_parser_member_declaration(cp_parser*) [clone
.lto_priv.0] (parser.cc:28344)
==2895333==by 0x1E818F2: UnknownInlinedFun (parser.cc:28187)
==2895333==by 0x1E818F2: cp_parser_class_specifier(cp_parser*) [clone
.lto_priv.0] (parser.cc:27166)
==2895333==by 0x1E29B94: UnknownInlinedFun (parser.cc:20326)
==2895333==by 0x1E29B94: cp_parser_decl_specifier_seq(cp_parser*, int,
cp_decl_specifier_seq*, int*) [clone .lto_priv.0] (parser.cc:16887)
==2895333==by 0x20D2582: cp_parser_single_declaration(cp_parser*,
vec*, bool, bool, bool*) [clone
.lto_priv.0] (parser.cc:33467)
==2895333==  Address 0xef17000 is in a rw- anonymous segment

==2895333==
==2895333== Invalid read of size 1
==2895333==at 0x27C0A0E: UnknownInlinedFun (tree.h:3778)
==2895333==by 0x27C0A0E: tree_decl_hash::hash(tree_node*) (tree.h:5914)
==2895333==by 0x1C94E6F: UnknownInlinedFun (hash-map-traits.h:50)
==2895333==by 0x1C94E6F: UnknownInlinedFun (hash-map.h:52)
==2895333==by 0x1C94E6F: hash_table >::hash_entry, false,
xcallocator>::verify(tree_node* const
&, unsigned int) [clone .isra.0] (hash-table.h:1116)
==2895333==by 0x12224B: UnknownInlinedFun (hash-table.h:1046)
==2895333==by 0x12224B: UnknownInlinedFun (hash-map.h:201)
==2895333==by 0x12224B: UnknownInlinedFun (hash-map.h:376)
==2895333==by 0x12224B: cp_adjust_diagnostic_info(diagnostic_context*,
diagnostic_info*) [clone .part.0] [clone .cold] (error.cc:242)
==2895333==by 0x1CBFC1B: UnknownInlinedFun (opts-common.cc:1861)
==2895333==by 0x1CBFC1B:
diagnostic_context::report_diagnostic(diagnostic_info*) (diagnostic.cc:1227)
==2895333==by 0x1CBF5B4:
diagnostic_context::diagnostic_impl(rich_location*, diagnostic_metadata const*,
diagnostic_option_id, char const*, __va_list_tag (*) [1], diagnostic_t) (diag
nostic.cc:1425)
==2895333==by 0x319875: error_at(rich_location*, char const*, ...)
(diagnostic-global-context.cc:439)
==2895333==by 0x3C2FA4: cp_parser_diagnose_invalid_type_name(cp_parser*,
tree_node*, unsigned int) [clone .lto_priv.0] [clone .cold] (parser.cc:3868)
==2895333==by 0x26CC34C:
cp_parser_parse_and_diagnose_invalid_type_name(cp_parser*) [clone .lto_priv.0]
(parser.cc:3975)
==2895333==by 0x1ED144E: cp_parser_member_declaration(cp_parser*) [clone
.lto_priv.0] (parser.cc:28344)
==2895333==by 0x1E818F2: UnknownInlinedFun (parser.cc:28187)
==2895333==by 0x1E818F2: cp_parser_class_specifier(cp_parser*) [clone
.lto_priv.0] (parser.cc:27166)
==2895333==by 0x1E29B94: UnknownInlinedFun (parser.cc:20326)
==2895333==by 0x1E29B94: cp_parser_decl_specifier_seq(cp_parser*, int,
cp_decl_specifier_seq*, int*) [clone .lto_priv.0] (parser.cc:16887)
==2895333==by 0x20D2582: cp_parser_single_declaration(cp_parser*,
vec*, bool, bool, bool*) [clone
.lto_priv.0] (parser.cc:33467)
==2895333==  Address 0x3ab65cb is not stack'd, malloc'd or (recently) free'd
==2895333==
In file included from /usr/include/CGAL/Interval_nt.h:41,
 from /usr/include/CGAL/long_double.h:27,
 from /usr/include/CGAL/number_type_basic.h:52:
/usr/include/CGAL/Interval_traits.h: At global scope:
/usr/include/CGAL/Interval_traits.h:60:17: internal compiler error:
Segmentation fault
   60 |   typedef CGAL::Tag_falseIs_interval;
  | ^

[Bug tree-optimization/109985] [14 Regression] __builtin_prefetch ignored by GCC 12/13

2024-10-14 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109985

Sam James  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
  Known to work||12.4.1

--- Comment #14 from Sam James  ---
All done, fixed for 12.5 as well.

[Bug tree-optimization/109985] [14 Regression] __builtin_prefetch ignored by GCC 12/13

2024-10-14 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109985

--- Comment #13 from GCC Commits  ---
The releases/gcc-14 branch has been updated by Sam James :

https://gcc.gnu.org/g:f0629e32278ef3966c00e889d0c6dce1de6115cc

commit r14-10787-gf0629e32278ef3966c00e889d0c6dce1de6115cc
Author: Jan Hubicka 
Date:   Mon Jul 22 23:01:50 2024 +0200

Fix handling of ICF_NOVOPS in ipa-modref

As shown in somewhat convoluted testcase, ipa-modref is mistreating
ECF_NOVOPS as "having no side effects".  This come from time when
modref cared only about memory accesses and thus it was possible to
shortcut on it.

This patch removes (hopefully) all those bad shortcuts.
Bootstrapped/regtested x86_64-linux, comitted.

gcc/ChangeLog:

PR ipa/109985

* ipa-modref.cc (modref_summary::useful_p): Fix handling of
ECF_NOVOPS.
(modref_access_analysis::process_fnspec): Likevise.
(modref_access_analysis::analyze_call): Likevise.
(propagate_unknown_call): Likevise.
(modref_propagate_in_scc): Likevise.
(modref_propagate_flags_in_scc): Likewise.
(ipa_merge_modref_summary_after_inlining): Likewise.

(cherry picked from commit efcbe7b985e24ac002a863afd609c44a67761195)

[Bug tree-optimization/117140] [15 regression] RISC-V: ICE in initialize_flags_in_bb for rv32gcv

2024-10-14 Thread ewlu at rivosinc dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117140

--- Comment #3 from Edwin Lu  ---
Created attachment 59349
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59349&action=edit
reduced testcase

(In reply to Andrew Pinski from comment #2)
> I suspect r15-4324-gaccb85345edb91 .

Confirmed to be the first bad commit.

In the reduced testcase, if the first code snippet is not included (commented
out), the following ice details appear:

ewlu@ewlu:/scratch/ewlu/ci/triage/baseline/build-ice$
./build-gcc-linux-stage1/gcc/xgcc -B./build-gcc-linux-stage1/gcc/ testcase.i
-march=rv32gcv -mabi=ilp32d -mcmodel=medlow -fdiagnostics-plain-output
-ftree-vectorize -O2 -mrvv-max-lmul=m8 -mrvv-vector-bits=zvl -lm -o
./multiple_rgroup_run-1.exe
during GIMPLE pass: vect
testcase.i: In function 'main':
testcase.i:64:5: internal compiler error: tree check: expected class 'type',
have 'exceptional' (error_mark) in element_mode, at tree.cc:13450
0x2f15805 internal_error(char const*, ...)
../../../gcc/gcc/diagnostic-global-context.cc:517
0xbad22d tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
../../../gcc/gcc/tree.cc:9053
0xbb3be6 tree_class_check(tree_node const*, tree_code_class, char const*, int,
char const*)
../../../gcc/gcc/tree.h:4076
0xbb3be6 element_mode(tree_node const*)
../../../gcc/gcc/tree.cc:13450
0x133e13c HONOR_NANS(tree_node const*)
../../../gcc/gcc/real.cc:5492
0x16107e3 process_bb
../../../gcc/gcc/tree-ssa-sccvn.cc:8101
0x161165e do_rpo_vn_1
../../../gcc/gcc/tree-ssa-sccvn.cc:8648
0x1612fd3 do_rpo_vn(function*, edge_def*, bitmap_head*, bool, bool, bool,
vn_lookup_kind)
../../../gcc/gcc/tree-ssa-sccvn.cc:8752
0x173d778 execute
../../../gcc/gcc/tree-vectorizer.cc:1396
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug other/116613] RFE: support outputting diagnostics in *multiple* formats

2024-10-14 Thread dmalcolm at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116613

--- Comment #23 from David Malcolm  ---
(In reply to David Malcolm from comment #21)
[...snip...]
> 
> FWIW SARIF has a distinction between a "result" and a "notification" where
> the former refer to the software under test, and the latter to the testing
> (e.g. a "tool configuration notification" could be "I can't read the config
> file to start this run").  Currently GCC doesn't make such a distinction;
> perhaps it should.

Specifically, SARIF tool components can have notifications, and SARIF
invocation objects can have:
 * 3.20.21 toolExecutionNotifications property
 * 3.20.22 toolConfigurationNotifications property

See e.g. "K.4 Comprehensive SARIF file"
https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/sarif-v2.1.0-errata01-os-complete.html#_Toc141791202
which has an examples of:
* various results about the software-under-test found by the tool
* a "toolConfigurationNotifications" entry for a problem seen in the tool's
config file
* various "toolExecutionNotifications" entries, including one for an exception
when running the tool (leading to the run being incomplete)

Currently GCC handles internal compiler errors as toolExecutionNotifications,
and everything else as results.

[Bug target/55212] [SH] Switch to LRA

2024-10-14 Thread olegendo at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55212

--- Comment #400 from Oleg Endo  ---
There was a latent issue that popped up as PR 113533 -- the cost estimation of
sh_rtx_costs for mem loads/stores were a bit distorted.

I've rebased the LRA devel branch

https://github.com/olegendo/gcc/tree/devel/sh-lra

from commit
  ccd7ede939ed108c3c1e164b461e6e0278bfe76e

to commit
  b717c462b96e7870f8081d2bc330e4749a4b0538

sh-sim tests show some new regressions look basically the same as in comment
#379.  I can't see any new failures.

[Bug target/117081] [15 Regression] FAIL: gcc.target/i386/pr91384.c since r15-1619-g3b9b8d6cfdf593

2024-10-14 Thread liuhongt at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117081

--- Comment #5 from Hongtao Liu  ---
*** Bug 117082 has been marked as a duplicate of this bug. ***

[Bug tree-optimization/117142] [13/14/15 Regression] ICE: verify_flow_info failed: error: returns_twice call is not first in basic block 2 at -O1 and above

2024-10-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117142

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2024-10-15
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1

--- Comment #1 from Andrew Pinski  ---
Better testcase:
```

struct a {
  int b;
};
void c(int, int);
void __attribute__((returns_twice))
bar1(struct a);
void bar(struct a) {
  struct a d;
  bar1(d);
  c(d.b, d.b);
}
```

[Bug target/117082] [15 Regression] FAIL: gcc.target/i386/stack-check-17.c since r15-1619-g3b9b8d6cfdf593

2024-10-14 Thread liuhongt at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117082

Hongtao Liu  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|NEW |RESOLVED

--- Comment #4 from Hongtao Liu  ---
.

*** This bug has been marked as a duplicate of bug 117081 ***

[Bug middle-end/117143] New: program crash under -O3 optimization or higher with function optimization flags assigned

2024-10-14 Thread bouncy12578 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117143

Bug ID: 117143
   Summary: program crash under -O3 optimization or higher with
function optimization flags assigned
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: bouncy12578 at gmail dot com
  Target Milestone: ---

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
13.2.0-23ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-13/README.Bugs
--enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr
--with-gcc-major-version-only --program-suffix=-13
--program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id
--libexecdir=/usr/libexec --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new
--enable-libstdcxx-backtrace --enable-gnu-unique-object --disable-vtable-verify
--enable-plugin --enable-default-pie --with-system-zlib
--enable-libphobos-checking=release --with-target-system-zlib=auto
--enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet
--with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32
--enable-multilib --with-tune=generic
--enable-offload-targets=nvptx-none=/build/gcc-13-uJ7kn6/gcc-13-13.2.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-13-uJ7kn6/gcc-13-13.2.0/debian/tmp-gcn/usr
--enable-offload-defaulted --without-cuda-driver --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.2.0 (Ubuntu 13.2.0-23ubuntu4) 

$ cat a.c
__attribute__((optimize("-ftree-pre")))
static void f(int)
{
unsigned l;
j:
for (l = 0; l <= 2; l++)
{
int x[] = {0};
if (l)
goto j;
}
}
int main() {
f(0);
}

$ gcc a.c -o case -O3 && ./case
Segmentation fault (core dumped)
$ gcc a.c -o case && ./case
(infinite loop, the program won't stop)

This bug can be reproduced on gcc 12, 13 (15 not tested).
Any further modification would eliminate bug.

The program is a designed inifinite loop. It would crash under -O3(or higher)
optimization. -O0, -O1, -O2 won't cause segmentation fault.

The __attribute__ in function f() cannot be moved, and can be substituted by
some of the optimization flags but cannot be substituted by optimization level
such as O1, O2, O3, etc.

[Bug tree-optimization/117142] [13/14/15 Regression] ICE: verify_flow_info failed: error: returns_twice call is not first in basic block 2 at -O1 and above

2024-10-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117142

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |13.4

[Bug middle-end/117143] program crash under -O3 optimization or higher with function optimization flags assigned

2024-10-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117143

--- Comment #1 from Andrew Pinski  ---
Created attachment 59350
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59350&action=edit
Better testcase

you can use the noinline attribute to get the same effect, this has been fixed
in GCC 14 ...

[Bug middle-end/117143] program crash under -O3 optimization or higher with function optimization flags assigned

2024-10-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117143

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|UNCONFIRMED |RESOLVED

--- Comment #2 from Andrew Pinski  ---
Dup.

*** This bug has been marked as a duplicate of bug 116749 ***

[Bug middle-end/116749] [12/13 Regression] program crash under -O3 optimization

2024-10-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116749

--- Comment #4 from Andrew Pinski  ---
*** Bug 117143 has been marked as a duplicate of this bug. ***

[Bug ada/114593] [12/13/14 regression] bogus error on type conversion in instantiation of child unit inside generic child unit

2024-10-14 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114593

--- Comment #11 from GCC Commits  ---
The releases/gcc-12 branch has been updated by Eric Botcazou
:

https://gcc.gnu.org/g:3bb9418811d2ce870bd1c1c98a2ddca1bdcce998

commit r12-10765-g3bb9418811d2ce870bd1c1c98a2ddca1bdcce998
Author: Eric Botcazou 
Date:   Mon Oct 14 11:57:57 2024 +0200

Add regression test

gcc/testsuite/
PR ada/114593
* gnat.dg/specs/generic_inst2-child2.ads: New test.
* gnat.dg/specs/generic_inst2.ads: New helper.
* gnat.dg/specs/generic_inst2-child1.ads: Likewise.

[Bug ada/114593] [12/13/14 regression] bogus error on type conversion in instantiation of child unit inside generic child unit

2024-10-14 Thread ebotcazou at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114593

Eric Botcazou  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #12 from Eric Botcazou  ---
Fixed on all active branches.

[Bug c++/117133] [15 regression] Undefined references when building stockfish-17 (incbin)

2024-10-14 Thread nshead at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117133

--- Comment #4 from Nathaniel Shead  ---
This is a bit of a strange case... strictly this (new) behaviour is correct, I
think, since gEmbeddedNNUEBigData has internal linkage (see
https://eel.is/c++draft/basic.link#4.9) and as such is not actually 'extern
"C"', by https://eel.is/c++draft/dcl.link#5:

> the specified language linkage applies to the function types of all
> function declarators and to all functions and variables whose names
> have external linkage.

I don't know how this should interact with the asm overriding though, but I
personally feel like this is just an issue in stockfish that should be resolved
by moving the declaration out of the anonymous namespace.  Thoughts?

Otherwise I'm not sure what the best way to approach fixing this would be.

[Bug ada/114593] [12/13/14 regression] bogus error on type conversion in instantiation of child unit inside generic child unit

2024-10-14 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114593

--- Comment #7 from GCC Commits  ---
The releases/gcc-14 branch has been updated by Eric Botcazou
:

https://gcc.gnu.org/g:b62c956f775408b9058a3c9b738462e5d67d8df7

commit r14-10785-gb62c956f775408b9058a3c9b738462e5d67d8df7
Author: Eric Botcazou 
Date:   Mon Oct 14 11:57:57 2024 +0200

Add regression test

gcc/testsuite/
PR ada/114593
* gnat.dg/specs/generic_inst2-child2.ads: New test.
* gnat.dg/specs/generic_inst2.ads: New helper.
* gnat.dg/specs/generic_inst2-child1.ads: Likewise.

[Bug ada/114593] [12/13/14 regression] bogus error on type conversion in instantiation of child unit inside generic child unit

2024-10-14 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114593

--- Comment #6 from GCC Commits  ---
The releases/gcc-14 branch has been updated by Eric Botcazou
:

https://gcc.gnu.org/g:aff061f0f51e2547b04c8d24c3b0dc713a6d62a3

commit r14-10784-gaff061f0f51e2547b04c8d24c3b0dc713a6d62a3
Author: Steve Baird 
Date:   Mon Jul 8 14:45:55 2024 -0700

ada: Type conversion in instance incorrectly rejected.

In some cases, a legal type conversion in a generic package is correctly
accepted but the corresponding type conversion in an instance of the
generic
is incorrectly rejected.

gcc/ada/
PR ada/114593
* sem_res.adb (Valid_Conversion): Test In_Instance instead of
In_Instance_Body.

[Bug ada/114593] [12/13/14 regression] bogus error on type conversion in instantiation of child unit inside generic child unit

2024-10-14 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114593

--- Comment #10 from GCC Commits  ---
The releases/gcc-12 branch has been updated by Eric Botcazou
:

https://gcc.gnu.org/g:fb61a7a203c5de3552e11bd633bc351463e51594

commit r12-10764-gfb61a7a203c5de3552e11bd633bc351463e51594
Author: Steve Baird 
Date:   Mon Jul 8 14:45:55 2024 -0700

ada: Type conversion in instance incorrectly rejected.

In some cases, a legal type conversion in a generic package is correctly
accepted but the corresponding type conversion in an instance of the
generic
is incorrectly rejected.

gcc/ada/
PR ada/114593
* sem_res.adb (Valid_Conversion): Test In_Instance instead of
In_Instance_Body.

[Bug target/117134] [15 regression] ICE when building mercury-22.01.1 with -march=znver2

2024-10-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117134

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #2 from Andrew Pinski  ---
Dup.

*** This bug has been marked as a duplicate of bug 117116 ***

[Bug target/117116] [15 regression] error: unrecognizable insn: with -march=znver3

2024-10-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117116

Andrew Pinski  changed:

   What|Removed |Added

 CC||sjames at gcc dot gnu.org

--- Comment #6 from Andrew Pinski  ---
*** Bug 117134 has been marked as a duplicate of this bug. ***

[Bug libstdc++/117135] 22_locale/time_get/get/wchar_t/5.cc fails on arm since gcc-15-4016-gc534e37facc

2024-10-14 Thread clyon at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117135

--- Comment #2 from Christophe Lyon  ---
The additional debug output with your patch is:
Wide D_T_FMT for C locale:
eofbit: 0 failbit: 0 badbit: 0
22_locale/time_get/get/wchar_t/5.cc:29: int main(): Assertion 'err ==
std::ios::eofbit' failed.

  1   2   3   >