[Bug gcov-profile/117090] gcov-tool ICE when merging two profiles

2024-10-12 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117090

Richard Biener  changed:

   What|Removed |Added

 CC||hubicka at gcc dot gnu.org

--- Comment #3 from Richard Biener  ---
This is

static void
write_topn_counters (const struct gcov_ctr_info *ci_ptr,
 unsigned t_ix,
 gcov_unsigned_t n_counts,
 void (*dump_fn) (const void *, unsigned, void *),
 void *(*allocate_fn)(unsigned, void *),
 void *arg)
{ 
  unsigned counters = n_counts / GCOV_TOPN_MEM_COUNTERS;
  gcc_assert (n_counts % GCOV_TOPN_MEM_COUNTERS == 0);


Are both profiles produced by the same executable?

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

2024-10-12 Thread glaubitz at physik dot fu-berlin.de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55212

--- Comment #398 from John Paul Adrian Glaubitz  ---
(In reply to Oleg Endo from comment #395)
> There was a recent commit in PR 116650, which looks related.
> I've updated (rebased) https://github.com/olegendo/gcc/tree/devel/sh-lra

Just to confirm: Oleg's tree currently bootstraps fine for me for all tested
languages (didn't test D and Rust).

I have not tested against WebKit yet. Will do that next week. Maybe there will
be a tree update in the mean time.

[Bug target/117095] [13/14/15 Regression] Wrong code since r13-5103-g7c9f20fcfdc2d8

2024-10-12 Thread stefansf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117095

--- Comment #1 from Stefan Schulze Frielinghaus  
---
For the outcome basically only

  b = fn3(q == &l);
  *h = b;
  if (c != 1)
__builtin_abort();

matters.  The optimized tree output for that part looks good to me (using -O2
of course):

a.1_34 = a;
a.2_35 = (unsigned short) a.1_34;
_36 = 1 - a.2_35;
_37 = (short int) _36;
b = _37;
h.13_15 = h;
_16 = (int) _37;
*h.13_15 = _16;
c.14_17 = c;
if (c.14_17 != 1)
  goto ; [0.00%]
else
  goto ; [100.00%]

 [count: 0]:
__builtin_abort ();

 [local count: 14598063]:
return 0;

[Bug c++/117108] New: internal compiler error: error reporting routines re-entered at build_c_cast(unsigned int, tree_node*, cp_expr)

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

Bug ID: 117108
   Summary: internal compiler error: error reporting routines
re-entered at build_c_cast(unsigned int, tree_node*,
cp_expr)
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yihan4845 at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/G3rT9aaGW

The following program:
```cpp
typedef char __attribute__((aligned(2))) AlignedChar;
typedef AlignedChar arrayType0[4];
void test(char *p) {
  auto r0 = (AlignedChar(&)[1])(*p & 1); 
}
```

will trigger segmentation fault for gcc trunk.

The stack dump:
```
internal compiler error: error reporting routines re-entered.
0x285c0cf diagnostic_context::report_diagnostic(diagnostic_info*)
???:0
0x285c505 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x286f955 error(char const*, ...)
???:0
0x28930d3 pretty_printer::format(text_info&)
???:0
0x285c222 diagnostic_context::report_diagnostic(diagnostic_info*)
???:0
0x285c505 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x286fbcf error_at(unsigned int, char const*, ...)
???:0
0xd70f1e build_c_cast(unsigned int, tree_node*, cp_expr)
???:0
0xc989da c_parse_file()
???:0
0xdf0599 c_common_parse_file()
???: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.
Compiler returned: 1
```

[Bug ipa/112601] [12/13/14/15 Regression] ICE in cgraph_node::verify_node(): error: invalid calls_comdat_local flag

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

--- Comment #3 from Sergei Trofimovich  ---
Slightly shorter reproducer:

static void printChar(int &, char) {}
int emit_OS;
char emit___trans_tmp_1;
static void emit(void Print(int &, char)) {
  Print(emit_OS, emit___trans_tmp_1);
}
struct SequenceToOffsetTable {
  __attribute__((noinline)) static void emitStringLiteralDef() {
emit(printChar);
  }
};
void run() { SequenceToOffsetTable::emitStringLiteralDef(); }

[Bug c++/117107] New: internal compiler error: Segmentation fault at lookup_decomp_type(tree_node*)

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

Bug ID: 117107
   Summary: internal compiler error: Segmentation fault at
lookup_decomp_type(tree_node*)
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yihan4845 at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/dMP9rdf1M

The following program:
```cpp
template 
constexpr bool is_same = false;
template 
constexpr bool is_same = true;

struct tuple {
  template 
  void check_tuple_like() {
tuple t;
auto [v, r] = t;
(void)[v, r] {
decltype(v);
};
  }
  int a = 0;
  int &b = a;
};
```

will trigger segmentation fault for gcc trunk.

The stack dump:
```
0x285c505 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x28702e5 internal_error(char const*, ...)
???:0
0xb796f5 lookup_decomp_type(tree_node*)
???:0
0xd1e956 finish_decltype_type(tree_node*, bool, int)
???:0
0xc989da c_parse_file()
???:0
0xdf0599 c_common_parse_file()
???: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.
Compiler returned: 1
```

[Bug tree-optimization/117093] Missing detection of REV64 vector permute

2024-10-12 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117093

Richard Biener  changed:

   What|Removed |Added

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

--- Comment #2 from Richard Biener  ---
Indeed.  This probably best fits the bswap pass which could be enhanced to
discover vector permutes.

There are some match.pd patterns doing that for very simple cases:

/* Simplify vector inserts of other vector extracts to a permute.  */
(simplify
 (bit_insert @0 (BIT_FIELD_REF@2 @1 @rsize @rpos) @ipos)

but here it doesn't work out greedily (also bit_insert into vec_perm
folding is missing).

I think attacking this from bswap is better (but the pass only runs late).

[Bug tree-optimization/117100] [12/13 regression] ImageMagick miscompiled with -O1 -funswitch-loops

2024-10-12 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117100

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|13.4|12.5
Summary|[13 regression] ImageMagick |[12/13 regression]
   |miscompiled with -O1|ImageMagick miscompiled
   |-funswitch-loops|with -O1 -funswitch-loops

--- Comment #12 from Richard Biener  ---
The same code is present on the 12 branch, so better fix it there as well than
waiting for somebody to run into another miscompile.

[Bug tree-optimization/117100] [13 regression] ImageMagick miscompiled with -O1 -funswitch-loops

2024-10-12 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117100

Richard Biener  changed:

   What|Removed |Added

   Priority|P1  |P2

[Bug middle-end/117091] switch clustering takes extensive time with large switches even at -O0

2024-10-12 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117091

Richard Biener  changed:

   What|Removed |Added

 CC||pheeck at gcc dot gnu.org

--- Comment #5 from Richard Biener  ---
The issue is a bad data-structure:

  auto_vec dest_bbs;

  for (unsigned i = start; i <= end; i++)
{
  simple_cluster *sc = static_cast (clusters[i]);
  /* m_max_case_bit_tests is very small integer, thus the operation
 is constant. */
  if (!dest_bbs.contains (sc->m_case_bb->index))

it uses vec::contains which is a linear search.  Pushing all BBs,
sorting and then counting non-dups would be one speedup, another
would be to use a bitmap (with tree view) and a counter.

I wouldn't start with disabling this at -O0 and -O1 ;)

[Bug target/117092] [15 regression] gcc.target/aarch64/pr109072_1.c check-function-bodies s16x4_2 fail since r15-4235-gbcccc3221b838e

2024-10-12 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117092

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |15.0
 Target||aarch64

[Bug target/117095] [13/14/15 Regression] Wrong code since r13-5103-g7c9f20fcfdc2d8

2024-10-12 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117095

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
Version|unknown |14.2.1

[Bug c++/117101] [12/13/14/15 Regression] internal compiler error: Segmentation fault for operator new

2024-10-12 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117101

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P5

[Bug c++/117102] internal compiler error: tree check: accessed elt 2 of 'tree_vec' with 1 elts in unify, at cp/pt.cc:24866

2024-10-12 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117102

Richard Biener  changed:

   What|Removed |Added

Version|unknown |15.0
   Last reconfirmed||2024-10-12
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
  Known to fail||11.5.0, 15.0, 7.5.0
   Keywords||ice-on-invalid-code

--- Comment #1 from Richard Biener  ---
Confirmed.

[Bug tree-optimization/117104] [15 regression] ICE when building python-3.12.7 (prepare_cmp_insn, at optabs.cc:4622) with -O2 -march=x86-64-v4 -fno-vect-cost-model -fwrapv

2024-10-12 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117104

Richard Biener  changed:

   What|Removed |Added

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

--- Comment #7 from Richard Biener  ---
I have a patch.

[Bug middle-end/116814] [15 Regression] ICE on libjack2-1.9.22: in expand_fn_using_insn, at internal-fn.cc:263 since r15-1671-gf2476a2649e997

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

Sergei Trofimovich  changed:

   What|Removed |Added

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

--- Comment #5 from Sergei Trofimovich  ---
Declaring it fixed.

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

2024-10-12 Thread kargls at comcast dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117110

--- Comment #3 from kargls at comcast dot net ---
I con no longer audit metadata of a PR.  This should be a P1 bug.

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

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

Oleg Endo  changed:

   What|Removed |Added

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

DeepLearn 2025: early registration October 28

2024-10-12 Thread IRDTA via Gcc-bugs

*To be removed from our mailing list, please respond to this message with 
UNSUBSCRIBE in the subject line*

--

**

12th INTERNATIONAL SCHOOL ON DEEP LEARNING
(with a special focus on Large Language Models, Foundation Models and 
Generative AI)

DeepLearn 2025

Porto – Maia, Portugal

July 21-25, 2025

https://deeplearn.irdta.eu/2025/

**

Co-organized by:

University of Maia

Institute for Research Development, Training and Advice – IRDTA
Brussels/London

**

Early registration: October 28, 2024

**

SCOPE:

DeepLearn 2025 will be a research training event with a global scope aiming at 
updating participants on the most recent advances in the critical and fast 
developing area of deep learning. Previous events were held in Bilbao, Genova, 
Warsaw, Las Palmas de Gran Canaria, Guimarães, Las Palmas de Gran Canaria, 
Luleå, Bournemouth, Bari, Las Palmas de Gran Canaria and Porto.

Deep learning is a branch of artificial intelligence covering a spectrum of 
current frontier research and industrial innovation that provides more 
efficient algorithms to deal with large-scale data in a huge variety of 
environments: computer vision, neurosciences, speech recognition, language 
processing, human-computer interaction, drug discovery, biomedicine and health 
informatics, medical image analysis, recommender systems, advertising, fraud 
detection, robotics, games, business and finance, biotechnology, physics 
experiments, biometrics, communications, climate sciences, geographic 
information systems, signal processing, genomics, materials design, video 
technology, social systems, earth and sustainability, etc. etc.

The field is also raising a number of relevant questions about robustness of 
the algorithms, explainability, transparency, interpretability, as well as 
important ethical concerns at the frontier of current knowledge that deserve 
careful multidisciplinary discussion.

Most deep learning subareas will be displayed, and main challenges identified 
through 18 four-hour and a half courses, 2 keynote lectures, 1 round table and 
a hackathon competition among participants. Renowned academics and industry 
pioneers will lecture and share their views with the audience. The organizers 
are convinced that outstanding speakers will attract the brightest and most 
motivated students. Face to face interaction and networking will be main 
ingredients of the event. It will be also possible to fully participate in vivo 
remotely.

DeepLearn 2025 will place special emphasis on large language models, foundation 
models and generative artificial intelligence.

ADDRESSED TO:

Graduate students, postgraduate students and industry practitioners will be 
typical profiles of participants. However, there are no formal pre-requisites 
for attendance in terms of academic degrees, so people less or more advanced in 
their career will be welcome as well.

Since there will be a variety of levels, specific knowledge background may be 
assumed for some of the courses.

Overall, DeepLearn 2025 is addressed to students, researchers and practitioners 
who want to keep themselves updated about recent developments and future 
trends. All will surely find it fruitful to listen to and discuss with major 
researchers, industry leaders and innovators.

VENUE:

DeepLearn 2025 will take place in Porto, the second largest city in Portugal, 
recognized by UNESCO in 1996 as a World Heritage Site. The venue will be:

University of Maia
Avenida Carlos de Oliveira Campos - Castlo da Maia
4475-690 Maia
Porto, Portugal

https://www.umaia.pt/en

STRUCTURE:

3 courses will run in parallel during the whole event. Participants will be 
able to freely choose the courses they wish to attend as well as to move from 
one to another.

All lectures will be videorecorded. Participants will be able to watch them 
again for 45 days after the event.

An open session will give participants the opportunity to present their own 
work in progress in 5 minutes. Also companies will be able to present their 
technical developments for 10 minutes.

The school will include a hackathon, where participants will be able to work in 
teams to tackle several machine learning challenges.

Full live online participation will be possible. The organizers highlight, 
however, the importance of face to face interaction and networking in this kind 
of research training event.

KEYNOTE SPEAKERS:

Yonina Eldar (Weizmann institute of Science), Model Based AI and Applications

Manuela Veloso (JPMorganChase), AI, Humans, and Robots for Task Solving

PROFESSORS AND COURSES: (to be completed)

Pierre Baldi (University of California Irvine), [intermediate/advanced] From 
Deep Learning and Transformers to AI Risks and Safety

Sean Benson (Amsterdam University Medical Center), [interm

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

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

--- Comment #397 from Kazumoto Kojima  ---
(In reply to Oleg Endo from comment #379)
> sh-sim/-m2a/-mb:
> FAIL: gcc.c-torture/execute/ieee/fp-cmp-5.c execution,  -O2 
> FAIL: gcc.c-torture/execute/ieee/fp-cmp-5.c execution,  -O2 -flto
> -fno-use-linker-plugin -flto-partition=none 
> FAIL: gcc.c-torture/execute/ieee/fp-cmp-5.c execution,  -O2 -flto
> -fuse-linker-plugin -fno-fat-lto-objects 
> FAIL: gcc.c-torture/execute/ieee/fp-cmp-5.c execution,  -O3
> -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions 
> FAIL: gcc.c-torture/execute/ieee/fp-cmp-5.c execution,  -O3 -g 

It seems to be the problem that HP predicted in comment #260.
These FAILs went away with -fno-delayed-branch.  FYI, I've opened PR 117111.

[Bug ipa/112601] [12/13/14/15 Regression] ICE in cgraph_node::verify_node(): error: invalid calls_comdat_local flag

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

--- Comment #7 from Sergei Trofimovich  ---
Here is my understanding of the issue:

The problem appears when ipa-inline (at `a.cpp.089i.inline` pass) tries to
inline:

a.cpp:5:9: note: Inlining void emit(void (*)())/1 to static void S::sm()/2
with frequency 1.00

Before the inline `S::sm` belonged to `comdat_group:_ZN1S2smEv` and did not
call any other comdat groups directly (`printChar()` was an indirect call).

After the inline `emit(printChar)` caused `S::sm()` to call `printChat()`
directly and now both are part of one `comdat_group`.

The discrepancy between calls_comdat_local=0 / check_calls_comdat_local_p ()=1
probably comes from a missing step to update the function summary after
resolving the indirection.

[Bug c++/117107] [14/15 Regression] ICE with structured binding and decltype inside a template

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

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
  Known to work||13.1.0, 13.3.0
  Known to fail||14.1.0, 14.2.0
Summary|internal compiler error:|[14/15 Regression] ICE with
   |Segmentation fault at   |structured binding and
   |lookup_decomp_type(tree_nod |decltype inside a template
   |e*) |
   Last reconfirmed||2024-10-13
   Keywords||ice-on-valid-code,
   ||needs-bisection
   Target Milestone|--- |14.3

--- Comment #1 from Andrew Pinski  ---
Simplified testcase:
```
struct tuple {
  int a;
};
template 
void check_tuple_like() {
  tuple t;
  auto [v] = t;
  decltype(v) b;
}
```

Confirmed.

[Bug c++/117107] [14/15 Regression] ICE with structured binding (not with std::tuple_size/tuple_element) and decltype inside a template

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

Andrew Pinski  changed:

   What|Removed |Added

   Keywords|needs-bisection |
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=92687
Summary|[14/15 Regression] ICE with |[14/15 Regression] ICE with
   |structured binding and  |structured binding (not
   |decltype inside a template  |with
   ||std::tuple_size/tuple_eleme
   ||nt) and decltype inside a
   ||template

--- Comment #2 from Andrew Pinski  ---
I suspect r14-9258 caused this.

[Bug c++/117108] [12/13/14/15 Regression] internal compiler error: error reporting routines re-entered at build_c_cast(unsigned int, tree_node*, cp_expr)

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

Andrew Pinski  changed:

   What|Removed |Added

  Known to work||5.5.0
   Keywords||error-recovery,
   ||ice-on-invalid-code
  Known to fail||6.1.0
Summary|internal compiler error:|[12/13/14/15 Regression]
   |error reporting routines|internal compiler error:
   |re-entered at   |error reporting routines
   |build_c_cast(unsigned int,  |re-entered at
   |tree_node*, cp_expr)|build_c_cast(unsigned int,
   ||tree_node*, cp_expr)
   Target Milestone|--- |12.5

[Bug c++/117108] [12/13/14/15 Regression] internal compiler error: error reporting routines re-entered at build_c_cast(unsigned int, tree_node*, cp_expr)

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

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
  Known to fail||4.7.1
   Target Milestone|--- |12.5
 Ever confirmed|0   |1
Summary|internal compiler error:|[12/13/14/15 Regression]
   |error reporting routines|internal compiler error:
   |re-entered at   |error reporting routines
   |build_c_cast(unsigned int,  |re-entered at
   |tree_node*, cp_expr)|build_c_cast(unsigned int,
   ||tree_node*, cp_expr)
   Last reconfirmed||2024-10-13
  Known to work||4.6.4

--- Comment #1 from Andrew Pinski  ---
It has ICEd since at least 4.7.1 with -std=c++0x

[Bug c++/117108] internal compiler error: error reporting routines re-entered at build_c_cast(unsigned int, tree_node*, cp_expr)

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

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|12.5|---

[Bug tree-optimization/117104] [15 regression] ICE when building python-3.12.7 (prepare_cmp_insn, at optabs.cc:4622) with -O2 -march=x86-64-v4 -fno-vect-cost-model -fwrapv

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

--- Comment #8 from GCC Commits  ---
The master branch has been updated by Richard Biener :

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

commit r15-4293-gf54d42e7e7a558b273d87f95b3e5b1938f5a
Author: Richard Biener 
Date:   Sat Oct 12 14:51:37 2024 +0200

tree-optimization/117104 - add missed guards to max(a,b) != a
simplification

For vector types we have to make sure the comparison result is a vector
type and the resulting compare operation is supported.  As the resulting
compare is never an equality compare I didn't bother to check for the
cbranch case.

PR tree-optimization/117104
* match.pd ((cmp:c (minmax:c @0 @1) @0) -> (out @0 @1)): Properly
guard the vector case.

* gcc.dg/pr117104.c: New testcase.

[Bug tree-optimization/116985] [15 Regression] ICE in vectorizer with --param=vect-partial-vector-usage=2 -mavx512vbmi2 since r15-2097-gdb3c8c9726d0ba

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

--- Comment #3 from GCC Commits  ---
The master branch has been updated by Feng Xue :

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

commit r15-4294-ga9173a50e7e346a218323916e4d3add8552529ae
Author: Feng Xue 
Date:   Fri Oct 11 14:55:05 2024 +0800

vect: Fix inconsistency in fully-masked lane-reducing op generation
[PR116985]

To align vectorized def/use when lane-reducing op is present in loop
reduction,
we may need to insert extra trivial pass-through copies, which would cause
mismatch between lane-reducing vector copy and loop mask index. This could
be
fixed by computing the right index around a new counter on effective lane-
reducing vector copies.

2024-10-11 Feng Xue 

gcc/
PR tree-optimization/116985
* tree-vect-loop.cc (vect_transform_reduction): Compute loop mask
index based on effective vector copies for reduction op.

gcc/testsuite/
PR tree-optimization/116985
* gcc.dg/vect/pr116985.c: New testcase.

[Bug tree-optimization/117104] [12/13/14 regression] ICE when building python-3.12.7 (prepare_cmp_insn, at optabs.cc:4622) with -O2 -march=x86-64-v4 -fno-vect-cost-model -fwrapv

2024-10-12 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117104

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|15.0|12.5
  Known to work||15.0
Summary|[15 regression] ICE when|[12/13/14 regression] ICE
   |building python-3.12.7  |when building python-3.12.7
   |(prepare_cmp_insn, at   |(prepare_cmp_insn, at
   |optabs.cc:4622) with -O2|optabs.cc:4622) with -O2
   |-march=x86-64-v4|-march=x86-64-v4
   |-fno-vect-cost-model|-fno-vect-cost-model
   |-fwrapv |-fwrapv

--- Comment #9 from Richard Biener  ---
Bogus pattern exists on branches as well.

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

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

--- Comment #2 from Kazumoto Kojima  ---
dbr_schedule is trying to fill the delay slot of

(jump_insn 17 16 42 (set (pc)
(if_then_else (eq (reg:SI 147 t)
(const_int 0 [0]))
(label_ref:SI 94)
(pc))) "fpone.c":7:11 232 {*cbranch_t}
 (int_list:REG_BR_PROB 536870916 (nil))
 -> 94)

by fill_slots_from_thread function.  It takes the insn for the slot from the
thread

(insn 46 39 79 (set (reg:SI 8 r8 [orig:167 _1 ] [167])
(reg:SI 147 t)) "fpone.c":7:11 303 {movt}
 (expr_list:REG_DEAD (reg:SI 147 t)
(nil)))
(insn 79 46 80 (set (reg/i:SI 0 r0)
(reg:SI 8 r8 [orig:167 _1 ] [167])) "fpone.c":8:1 191 {movsi_ie}
 (expr_list:REG_DEAD (reg:SI 8 r8 [orig:167 _1 ] [167])
(nil)))

and makes a candidate insn

(insn 79 46 80 (set (reg/i:SI 0 r0)
(reg:SI 147 t)) "fpone.c":8:1 303 {movt}
 (expr_list:REG_DEAD (reg:SI 8 r8 [orig:167 _1 ] [167])
(nil)))

for trial.  fill_slots_from_thread calls try_split for this candidate first.
Here is a gdb backtrace where trial is the insn 79 above.

#0  try_split (pat=pat@entry=0x76f5ec48, trial=trial@entry=0x76f5d400, 
last=last@entry=0) at /git/gcc/gcc/emit-rtl.cc:3932
#1  0x00f5a748 in fill_slots_from_thread (insn=0x76e0cd38, 
condition=0x76f5f0d8, thread_or_return=, 
opposite_thread=, likely=false, 
thread_if_true=, own_thread=true, 
slots_to_fill=, pslots_filled=0x7fffd7ac, 
delay_list=0x7fffd7d0) at /git/gcc/gcc/reorg.cc:2430
#2  0x00f5d381 in fill_eager_delay_slots ()
at /git/gcc/gcc/reorg.cc:2843
#3  dbr_schedule (first=) at /git/gcc/gcc/reorg.cc:3705

and try_split applies the splitter

sh.md: 11147
;; This is not a peephole, but it's here because it's actually supposed
;; to be one.  It tries to convert a sequence such as
;;  movtr2  ->  movtr2
;;  movtr13 mov r2,r13
;; This gives the schduler a bit more freedom to hoist a following
;; comparison insn.  Moreover, it the reg-reg mov insn is MT group which has
;; better chances for parallel execution.
;; We can do this with a peephole2 pattern, but then the cprop_hardreg
;; pass will revert the change.  See also PR 64331.
;; Thus do it manually in one of the split passes after register allocation.
;; Sometimes the cprop_hardreg pass might also eliminate the reg-reg copy.
(define_split
  [(set (match_operand:SI 0 "arith_reg_dest")
(match_operand:SI 1 "t_reg_operand"))]
...

and  returns

(insn 113 46 80 (set (reg/i:SI 0 r0)
(reg:SI 8 r8 [orig:167 _1 ] [167])) "fpone.c":8:1 -1
 (nil))

Thus fill_slots_from_thread fills the slot with it.  This situation would be
unexpected with both fill_slots_from_thread and the above splitter.

BTW, old RA makes a bit worse code for the thread:

.L6:
movtr1
mov.l   r1,@r15
mov.l   @r15,r0
add #4,r15
lds.l   @r15+,pr

and the splitter cloudn't be applied.

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

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

Bug ID: 117111
   Summary: [SH] delay slot is filled with wrong instruction
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: minor
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: kkojima at gcc dot gnu.org
CC: olegendo at gcc dot gnu.org
  Target Milestone: ---

There are new execution failures reported on PR 55212 with enabling LRA.

 FAIL: gcc.c-torture/execute/ieee/fp-cmp-5.c execution,  -O2 
 FAIL: gcc.c-torture/execute/ieee/fp-cmp-5.c execution,  -O2 -flto
-fno-use-linker-plugin -flto-partition=none 
 FAIL: gcc.c-torture/execute/ieee/fp-cmp-5.c execution,  -O2 -flto
-fuse-linker-plugin -fno-fat-lto-objects 
 FAIL: gcc.c-torture/execute/ieee/fp-cmp-5.c execution,  -O3
-fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions 
 FAIL: gcc.c-torture/execute/ieee/fp-cmp-5.c execution,  -O3 -g 

These FAILs went away with -fno-delayed-branch.

--- Comment #1 from Kazumoto Kojima  ---
Created attachment 59329
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59329&action=edit
a reduced test case (-m4 -mlra -O2 -fno-inline -mieee)

.s looks like

test_not_isless:
mov.l   r8,@-r15
mov #1,r8
fmov.s  fr12,@-r15
fmov.s  fr13,@-r15
mov.l   .L7,r0
fmov.s  fr14,@-r15
fmov.s  fr15,@-r15
sts.l   pr,@-r15
fmovfr4,fr14
fmovfr5,fr15
fmovfr6,fr12
jsr @r0
fmovfr7,fr13
tst r0,r0
bf  .L3
fcmp/gt dr12,dr14
bt  .L9
fcmp/eq dr12,dr14
.L9:
bf/s.L6
mov r8,r0  <
.L3:
mov r8,r0
lds.l   @r15+,pr
fmov.s  @r15+,fr15
fmov.s  @r15+,fr14
fmov.s  @r15+,fr13
fmov.s  @r15+,fr12
rts 
mov.l   @r15+,r8
.align 1
.L6:
movtr8
lds.l   @r15+,pr
fmov.s  @r15+,fr15
fmov.s  @r15+,fr14
fmov.s  @r15+,fr13
fmov.s  @r15+,fr12
rts 
mov.l   @r15+,r8

With adding -fno-delayed-branch, it looks

...
fcmp/eq dr12,dr14
bf  .L6
.L9:
.L3:
mov r8,r0
lds.l   @r15+,pr
fmov.s  @r15+,fr15
fmov.s  @r15+,fr14
fmov.s  @r15+,fr13
fmov.s  @r15+,fr12
mov.l   @r15+,r8
rts 
nop
.align 1
.L6:
movtr8
mov r8,r0
lds.l   @r15+,pr
...

i.e. the delay slot is filled with a wrong insn.

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

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

--- Comment #3 from Kazumoto Kojima  ---
Created attachment 59330
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59330&action=edit
a trial patch

This patch disables the above splitter after machine reorg pass so to hide it
from dbr_schedule.  I thought about something like dbr_schedule_in_progress
first, but it seemed a bit overkill for this specific issue.
Tested devel/sh-lra branch with c/c++ testsuite only.

[Bug middle-end/117098] Tail call doesn't work in some cases

2024-10-12 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117098

--- Comment #3 from H.J. Lu  ---
Created attachment 59328
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59328&action=edit
A patch

I am testing this.

[Bug jit/102824] building pdf/dvi documentation for libgccjit fails

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

Eric Gallager  changed:

   What|Removed |Added

 Status|WAITING |NEW

--- Comment #14 from Eric Gallager  ---
(In reply to Eric Gallager from comment #13)
> (In reply to Iain Sandoe from comment #12)
> > what input is this waiting for at the moment?
> 
> From checking the bug history, it looks like Martin Liška was the one to put
> this in the WAITING status, which came along with this comment:
> 
> (In reply to Martin Liška from comment #7)
> > Well, running 'make latexpdf' works if you jump into gcc/jit/docs folder. Do
> > I miss something?
> 
> ...which I thought we'd answered, but to make it a bit more clear: we
> shouldn't have to do that to get the jit docs to build properly. They should
> build properly when doing `make dvi` and/or `make pdf` from the top-level,
> rather than requiring their own special procedures.

...thus, moving from WAITING back to NEW.

[Bug c/108310] Some warnings that -Wtraditional-conversion causes to be emitted aren't actually controlled by it

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

Eric Gallager  changed:

   What|Removed |Added

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

--- Comment #7 from Eric Gallager  ---
(In reply to Eric Gallager from comment #6)
> I think I might be able to figure this out myself

Actually never mind, I forgot what I was thinking here; unassigning...

[Bug bootstrap/43301] top-level configure script ignores ---with-build-time-tools

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

--- Comment #9 from Eric Gallager  ---
(In reply to Eric Gallager from comment #8)
> we've got an idea that I just need to test

(well, either I, or someone else, I guess...)

[Bug bootstrap/117110] New: Bootstrap broken on FreeBSD with build/genmatch

2024-10-12 Thread kargls at comcast dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117110

Bug ID: 117110
   Summary: Bootstrap broken on FreeBSD with build/genmatch
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
  Assignee: unassigned at gcc dot gnu.org
  Reporter: kargls at comcast dot net
  Target Milestone: ---

% pwd
/usr/home/kargl/gcc/obj
% ../gcc/configure --prefix=$HOME/work --enable-languages=c,c++,fortran,lto \
   --enable-bootstrap --disable-libssp --disable-multilib
% gmake bootstrap |& tee sgk.log





gmake[3]: Entering directory '/usr/home/kargl/gcc/obj/gcc'
/home/kargl/work/bin/g++ -std=c++11 -no-pie   -g -DIN_GCC-fno-exceptions
-fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-error=narrowing
-Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute
-Wconditionally-supported -Woverloaded-virtual -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings  -DHAVE_CONFIG_H  -DGENERATOR_FILE
-static-libstdc++ -static-libgcc  -o build/genmatch \
build/genmatch.o ../build-x86_64-unknown-freebsd15.0/libcpp/libcpp.a
build/vec.o build/hash-table.o build/sort.o libcommon.a
../libbacktrace/.libs/libbacktrace.a
../build-x86_64-unknown-freebsd15.0/libiberty/libiberty.a
/usr/local/bin/ld: libcommon.a(diagnostic.o): in function
`diagnostic_set_info(diagnostic_info*, char const*, __va_list_tag (*) [1],
rich_location*, diagnostic_t)':
/home/kargl/gcc/obj/gcc/../../gcc/gcc/diagnostic.cc:515: undefined reference to
`libintl_gettext'
/usr/local/bin/ld: libcommon.a(diagnostic.o): in function
`diagnostic_context::diagnostic_n_impl(rich_location*, diagnostic_metadata
const*, diagnostic_option_id, unsigned long, char const*, char const*,
__va_list_tag (*) [1], diagnostic_t)':
/home/kargl/gcc/obj/gcc/../../gcc/gcc/diagnostic.cc:1450: undefined reference
to `libintl_ngettext'
/usr/local/bin/ld: libcommon.a(diagnostic-format-text.o): in function
`diagnostic_text_output_format::~diagnostic_text_output_format()':
/home/kargl/gcc/obj/gcc/../../gcc/gcc/diagnostic-format-text.cc:55: undefined
reference to `libintl_gettext'
/usr/local/bin/ld:
/home/kargl/gcc/obj/gcc/../../gcc/gcc/diagnostic-format-text.cc:60: undefined
reference to `libintl_gettext'
/usr/local/bin/ld: libcommon.a(diagnostic-format-text.o): in function
`diagnostic_text_output_format::build_prefix(diagnostic_info const&) const':
/home/kargl/gcc/obj/gcc/../../gcc/gcc/diagnostic-format-text.cc:133: undefined
reference to `libintl_gettext'
/usr/local/bin/ld: libcommon.a(diagnostic-format-text.o): in function
`diagnostic_text_output_format::report_current_module(unsigned int)':
/home/kargl/gcc/obj/gcc/../../gcc/gcc/diagnostic-format-text.cc:421: undefined
reference to `libintl_gettext'
/usr/local/bin/ld: libcommon.a(diagnostic-global-context.o): in function
`verbatim(char const*, ...)':
/home/kargl/gcc/obj/gcc/../../gcc/gcc/diagnostic-global-context.cc:46:
undefined reference to `libintl_gettext'
/usr/local/bin/ld:
libcommon.a(diagnostic-global-context.o):/home/kargl/gcc/obj/gcc/../../gcc/gcc/diagnostic-global-context.cc:561:
more undefined references to `libintl_gettext' follow
/usr/local/bin/ld: libcommon.a(pretty-print.o): in function
`identifier_to_locale(char const*)':
/home/kargl/gcc/obj/gcc/../../gcc/gcc/pretty-print.cc:2853: undefined reference
to `libiconv_open'
/usr/local/bin/ld: /home/kargl/gcc/obj/gcc/../../gcc/gcc/pretty-print.cc:2873:
undefined reference to `libiconv'
/usr/local/bin/ld: /home/kargl/gcc/obj/gcc/../../gcc/gcc/pretty-print.cc:2879:
undefined reference to `libiconv'
/usr/local/bin/ld: /home/kargl/gcc/obj/gcc/../../gcc/gcc/pretty-print.cc:2902:
undefined reference to `libiconv'
/usr/local/bin/ld: /home/kargl/gcc/obj/gcc/../../gcc/gcc/pretty-print.cc:2920:
undefined reference to `libiconv_close'
/usr/local/bin/ld: libcommon.a(intl.o): in function `gcc_init_libintl()':
/home/kargl/gcc/obj/gcc/../../gcc/gcc/intl.cc:58: undefined reference to
`libintl_bindtextdomain'
/usr/local/bin/ld: /home/kargl/gcc/obj/gcc/../../gcc/gcc/intl.cc:59: undefined
reference to `libintl_textdomain'
/usr/local/bin/ld: /home/kargl/gcc/obj/gcc/../../gcc/gcc/intl.cc:62: undefined
reference to `libintl_gettext'
/usr/local/bin/ld: /home/kargl/gcc/obj/gcc/../../gcc/gcc/intl.cc:65: undefined
reference to `libintl_gettext'
/usr/local/bin/ld: libcommon.a(input.o): in function `special_fname_builtin()':
/home/kargl/gcc/obj/gcc/../../gcc/gcc/input.cc:35: undefined reference to
`libintl_gettext'
/usr/local/bin/ld: libcommon.a(input.o): in function
`selftest::ebcdic_execution_charset::on_diagnostic(cpp_reader*,
cpp_diagnostic_level, cpp_warning_reason, rich_location*, char const*,
__va_list_tag (*) [1])':
/home/kargl/gcc/obj/gcc/../../gcc/gcc/input.cc:2496: undefined reference to
`libintl_dgettext'
collect2: error: ld returned 1 exit status
gmake[3]: *** [Makefile:3204: build/genmatch] Error 1
gmake[3]: Leaving directory '/usr/home/

[Bug c++/117106] ICE when a "deducing this" function with noexcept specification is used before the class is complete

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

--- Comment #1 from Fedor Chelnokov  ---
This crash is reproducible in C++20 mode as well without deducing this:
```
struct A {
int x;
void foo(this auto &&self) noexcept(noexcept(self.x)) {}
auto bar() -> decltype(foo()) {}
};
```
In instantiation of 'void A::foo() [with  = int]':
:5:36:   required from here
5 | auto bar() -> decltype(foo()) {}
  |^~
:4:10: internal compiler error: Segmentation fault
4 | void foo() noexcept(noexcept(x)) {}
  |  ^~~
0x2031cbc internal_error(char const*, ...)
???:0
0x11fb4f4 check_qualified_type(tree_node const*, tree_node const*, int)
???:0
0x11fb5f3 get_qualified_type(tree_node*, int)
???:0
0x1206345 build_qualified_type(tree_node*, int)
???:0
0x843cba build_noexcept_spec(tree_node*, int)
???:0
0x9301e1 maybe_instantiate_noexcept(tree_node*, int)
???:0
0x83311a mark_used(tree_node*, int)
???:0
0x79d629 build_new_method_call(tree_node*, tree_node*, vec**, tree_node*, int, tree_node**, int)
???:0
0x960c3c finish_call_expr(tree_node*, vec**, bool,
bool, int)
???:0
0x90ee14 c_parse_file()
???:0
0xa0d1b9 c_common_parse_file()
???:0

Online demo: https://gcc.godbolt.org/z/PW6sn8Tjq

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

2024-10-12 Thread kargls at comcast dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117110

--- Comment #1 from kargls at comcast dot net ---
Bootstrapped worked on at least 

% hotrats:kargl[264] gfcx --version
GNU Fortran (GCC) 15.0.0 20240919 (experimental)

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

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

Iain Sandoe  changed:

   What|Removed |Added

   Keywords||build
   Target Milestone|--- |15.0
 CC||iains at gcc dot gnu.org
 Target||x86_64-unknown-freebsd,
   ||*-darwin*
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
   Last reconfirmed||2024-10-12

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

2024-10-12 Thread kargls at comcast dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117110

--- Comment #2 from kargls at comcast dot net ---
Likely broken with 

commit c397a8c12296b75a91ae51e4889debf023e6c338
Author: Jakub Jelinek 
Date:   Sat Oct 12 10:44:17 2024 +0200

[Bug tree-optimization/117096] Clobbers sometimes gets in the way of phiopt

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #4 from Andrew Pinski  ---
https://gcc.gnu.org/pipermail/gcc-patches/2021-April/567744.html

I have decided now to go down the "maybe we should unconditionally do so" route
and add TODO_remove_unused_locals to pass_dse. This will definitely show up
more and more with many C++ code which GCC was not worried about before.

[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-12 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117109

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |15.0
   Assignee|dmalcolm at gcc dot gnu.org|unassigned at gcc dot 
gnu.org
  Component|analyzer|bootstrap

[Bug rtl-optimization/117105] New: ICE on valid code at -O3 with "-fno-code-hoisting -fno-tree-fre -fno-tree-dominator-opts -fno-tree-pre -fno-tree-sra" on x86_64-linux-gnu: in extract_constrain_insn,

2024-10-12 Thread zhendong.su at inf dot ethz.ch via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117105

Bug ID: 117105
   Summary: ICE on valid code at -O3 with "-fno-code-hoisting
-fno-tree-fre -fno-tree-dominator-opts -fno-tree-pre
-fno-tree-sra" on x86_64-linux-gnu: in
extract_constrain_insn, at recog.cc:2783
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zhendong.su at inf dot ethz.ch
  Target Milestone: ---

It appears to be a recent regression as it doesn't reproduce with 14.2 and
earlier.  

It might be related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115521.

Compiler Explorer: https://godbolt.org/z/bzcv7sdYd


[576] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--enable-checking=yes --prefix=/local/suz-local/software/local/gcc-trunk
--enable-sanitizers --enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20241012 (experimental) (GCC)
[577] %
[577] % gcctk -O3 -fno-code-hoisting -fno-tree-fre -fno-tree-dominator-opts
-fno-tree-pre -fno-tree-sra small.c
small.c: In function ‘main’:
small.c:13:1: error: insn does not satisfy its constraints:
   13 | }
  | ^
(insn 24 55 54 4 (parallel [
(set (strict_low_part (reg:QI 2 cx [orig:109 e ] [109]))
(and:QI (subreg:QI (zero_extract:HI (reg/v:HI 2 cx [orig:109 e
] [109])
(const_int 8 [0x8])
(const_int 8 [0x8])) 0)
(reg:QI 1 dx [orig:115 _6 ] [115])))
(clobber (reg:CC 17 flags))
]) "small.c":11:15 728 {*andqi_exthi_1_slp}
 (nil))
during RTL pass: reload
small.c:13:1: internal compiler error: in extract_constrain_insn, at
recog.cc:2783
0x2627345 internal_error(char const*, ...)
../../gcc-trunk/gcc/diagnostic-global-context.cc:517
0xa80f6e fancy_abort(char const*, int, char const*)
../../gcc-trunk/gcc/diagnostic.cc:1533
0x86bdf4 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
../../gcc-trunk/gcc/rtl-error.cc:108
0x86be20 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
../../gcc-trunk/gcc/rtl-error.cc:118
0x86a05a extract_constrain_insn(rtx_insn*)
../../gcc-trunk/gcc/recog.cc:2783
0xfaccf7 check_rtl
../../gcc-trunk/gcc/lra.cc:2192
0xfb2191 lra(_IO_FILE*, int)
../../gcc-trunk/gcc/lra.cc:2613
0xf622ff do_reload
../../gcc-trunk/gcc/ira.cc:5977
0xf622ff execute
../../gcc-trunk/gcc/ira.cc:6165
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
[578] %
[578] % cat small.c
int a;
struct b {
  char c;
  char d;
};
int main() {
  struct b e;
  int f;
  while (a)
if (f == e.d)
  f = e.c = e.d & 1 >> e.d;
  return 0;
}

[Bug c++/117106] New: ICE when a "deducing this" function with noexcept specification is used before the class is complete

2024-10-12 Thread iamsupermouse at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117106

Bug ID: 117106
   Summary: ICE when a "deducing this" function with noexcept
specification is used before the class is complete
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamsupermouse at mail dot ru
  Target Milestone: ---

The following code causes an internal compiler error in GCC 14 and trunk:
https://gcc.godbolt.org/z/j5Y945fMq

struct A
{
int x;
void foo(this auto &&self) noexcept(noexcept(self.x)) {}
auto bar() -> decltype(foo()) {}
};

This results in the following error:

: In instantiation of 'void A::foo(this auto:1&&) [with auto:1 =
A&]':
:5:35:   required from here
5 | auto bar() -> decltype(foo()) {}
|~~~^~
:4:14: internal compiler error: in tsubst_expr, at cp/pt.cc:21978
4 | void foo(this auto &&self) noexcept(noexcept(self.x)) {}
|  ^~~
0x285c505 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x28702e5 internal_error(char const*, ...)
???:0
0xa8b484 fancy_abort(char const*, int, char const*)
???:0
0xccfed2 maybe_instantiate_noexcept(tree_node*, int)
???:0
0xb8c2ea mark_used(tree_node*, int)
???:0
0xab6458 build_new_method_call(tree_node*, tree_node*, vec**, tree_node*, int, tree_node**, int)
???:0
0xd17106 finish_call_expr(tree_node*, vec**,
bool, bool, int)
???:0
0xc989da c_parse_file()
???:0
0xdf0599 c_common_parse_file()
???:0

Worth noting that Clang emits a weird error on this code:
https://stackoverflow.com/q/79081096/2752075

error: exception specification is not available until end of class
definition

[Bug ipa/112601] [12/13/14/15 Regression] ICE in cgraph_node::verify_node(): error: invalid calls_comdat_local flag

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

--- Comment #4 from Sergei Trofimovich  ---
Cloud also get rid of all the globals:

static void printChar() {}
static void emit(void Print()) { Print(); }
struct S {
  __attribute__((noinline)) static void sm() {
emit(printChar);
  }
};
void run() { S::sm(); }

[Bug ipa/112601] [12/13/14/15 Regression] ICE in cgraph_node::verify_node(): error: invalid calls_comdat_local flag

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

--- Comment #5 from Sergei Trofimovich  ---
(In reply to Sergei Trofimovich from comment #4)
> Cloud also get rid of all the globals:
> 
> static void printChar() {}
> static void emit(void Print()) { Print(); }
> struct S {
>   __attribute__((noinline)) static void sm() {
> emit(printChar);
>   }
> };
> void run() { S::sm(); }

The crash looks this way:

$ gcc/xg++ -Bgcc -O1 -fchecking=1 -c a.cpp -o a.o -fopt-info-all
a.cpp:8:19: missed:   not inlinable: void run()/3 -> static void S::sm()/2,
function not inlinable
a.cpp:5:9: missed:   not inlinable: static void S::sm()/2 -> void emit(void
(*)())/1, function not inline candidate
Unit growth for small function inlining: 18->18 (0%)

Inlined 1 calls, eliminated 1 functions

a.cpp: In static member function ‘static void S::sm()’:
a.cpp:4:41: error: invalid calls_comdat_local flag calls_comdat_local=0
check_calls_comdat_local_p ()=1
4 |   __attribute__((noinline)) static void sm() {
  | ^~
_ZN1S2smEv/2 (static void S::sm())
  Type: function definition analyzed
  Visibility: externally_visible semantic_interposition public weak comdat
comdat_group:_ZN1S2smEv one_only
  Same comdat group as: _ZL9printCharv/0
  References:
  Referring:
  Availability: available
  Function flags: count:1073741824 (estimated locally) body
  Called by: _Z3runv/3 (1073741824 (estimated locally),1.00 per call) (can
throw external)
  Calls: _ZL9printCharv/0 (1073741824 (estimated locally),1.00 per call) (can
throw external)
during IPA pass: inline
a.cpp:4:41: internal compiler error: verify_cgraph_node failed

It looks like `ipa-inline` was able to optimize `S::sm()` into `{ printChar();
}` (I'm assuming `Calls:` are all direct callees). But `ipa-inline` did not
update `calls_comdat_local` (yet?).

[Bug ipa/116908] [12/13/14/15 Regression] ICE (invalid calls_comdat_local flag) with -O1 compiling webkit

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

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #7 from Andrew Pinski  ---
Yes this is a dup of bug 112601 in the end.

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

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

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

Bug ID: 117109
   Summary: [15 Regression] "make gcc.pot" fails with
"emit_diagnostic used incompatibly" since
r15-4081-g385a232229a5b4 (diagnostics: bulletproof
opening of SARIF output)
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Keywords: translation
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: burnus at gcc dot gnu.org
  Target Milestone: ---

cd $BUILD/gcc; make gcc.pot fails with:

which invokes:
  AWK=$(AWK) $(SHELL) $(srcdir)/po/exgettext $(XGETTEXT) gcc $(srcdir)

and fails with

scanning for keywords, %e and %n strings...
emit_diagnostic used incompatibly as both --keyword=emit_diagnostic:4
--flag=emit_diagnostic:4:gcc-internal-format and --keyword=emit_diagnostic:5
--flag=emit_diagnostic:5:gcc-internal-format


Bisecting points to
  r15-4081-g385a232229a5b4 diagnostics: bulletproof opening of SARIF output
[PR116978]

* * *

The scanning part of the exgettext is the following:

while (getline < file) {
if (/^(#[   ]*define[   ]*)?[A-Za-z_].*\(.*msgid[,\)]/) {
keyword_option($0)
} else if (/^(#[   ]*define[   ]*)?[A-Za-z_].*(\(|\(.*,)$/) {
name_line = $0
while (getline < file) {
  lineno++
  if (/msgid[,\)]/){
keyword_option(name_line $0)
break
  } else if (/,$/) {
  name_line = name_line $0

* * *

Debugging shows that  diagnostic-global-context.cc  has:

emit_diagnostic (diagnostic_t kind,location_t location,   
diagnostic_option_id option_id,const char *gmsgid, ...)

emit_diagnostic (diagnostic_t kind,rich_location *richloc, 
   diagnostic_option_id option_id,   const char *gmsgid, ...)

That is both have "gmsgid" as 4th argument.


But  diagnostic.cc  has:

diagnostic_context::emit_diagnostic (diagnostic_t kind,
   rich_location &richloc, const
diagnostic_metadata *metadata,diagnostic_
option_id option_id,const char *gmsgid, ...)


That is "gmsgid" is the 5th argument.

[Bug ipa/112601] [12/13/14/15 Regression] ICE in cgraph_node::verify_node(): error: invalid calls_comdat_local flag

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||pinskia at gcc dot gnu.org

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

[Bug c++/77502] -Wzero-as-null-pointer-constant : misleading/imprecise messages

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

Eric Gallager  changed:

   What|Removed |Added

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

--- Comment #5 from Eric Gallager  ---
See bug 91187 for another -Wzero-as-null-pointer-constant bug

[Bug c/117059] Make -Wzero-as-null-pointer-constant available in C

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

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=77502

--- Comment #1 from Eric Gallager  ---
If making it available for C, too, it would be worthwhile to fix bug 77502
while at it, too

[Bug ada/81114] GNAT mishandles filenames with UTF8 chars on case-insensitive filesystems

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

--- Comment #10 from Eric Gallager  ---
(In reply to simon from comment #9)
> Created attachment 56140 [details]
> C demonstrator
> 
> As noted in comment 8, the C compiler doesn’t have a problem with 
> finding a file with a combining filename when the #include
> directice uses a composed filename.

clang has -Wnonportable-include-path, which judging by the text looks like it's
for case differences only, but if adding it for GCC, too, we'd probably want to
extend it to handle this sort of thing as well:
https://clang.llvm.org/docs/DiagnosticsReference.html#wnonportable-include-path

[Bug d/116961] Valgrind reports uninitialized memory use in dstruct.d (dmd.dstruct._isZeroInit(dmd.expression.Expression))

2024-10-12 Thread a.horodniceanu at proton dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116961

--- Comment #4 from Andrei Horodniceanu  ---
Sorry for the wait:
-
$ cat repro.d
module object;
struct Gcx
{
float thing = 0.0;
}
$ /root/build/./gcc/gdc -B/root/build/./gcc/
-B/tmp/gcc/x86_64-pc-linux-gnu/bin/ -B/tmp/gcc/x86_64-pc-linux-gnu/lib/
-fsyntax-only repro.d
==112865== Conditional jump or move depends on uninitialised value(s)
==112865==at 0x8B41E1: dmd.dstruct._isZeroInit(dmd.expression.Expression)
(in /root/build/gcc/d21)
==112865==by 0x8B464E: StructDeclaration::finalizeSize() (in
/root/build/gcc/d21)
==112865==by 0x81202C: dmd.aggregate.AggregateDeclaration.determineSize(ref
const(dmd.location.Loc)) (in /root/build/gcc/d21)
==112865==by 0x9C532C: Semantic2Visitor::visit(AggregateDeclaration*) (in
/root/build/gcc/d21)
==112865==by 0x9C55B4: Semantic2Visitor::visit(Module*) (in
/root/build/gcc/d21)
==112865==by 0x9C5A89: dmd.semantic2.semantic2(dmd.dsymbol.Dsymbol,
dmd.dscope.Scope*) (in /root/build/gcc/d21)
==112865==by 0xA7092D: d_parse_file() (in /root/build/gcc/d21)
==112865==by 0xFD35AE: compile_file() (in /root/build/gcc/d21)
==112865==by 0x80D056: toplev::main(int, char**) (in /root/build/gcc/d21)
==112865==by 0x80E94F: main (in /root/build/gcc/d21)
==112865==
-
I hope it is the same bug.

Also note that:
---
$ cat repro.d
module object;
struct Gcx
{
float thing = 0/*instead of 0.0*/;
}
$ /root/build/./gcc/gdc -B/root/build/./gcc/
-B/tmp/gcc/x86_64-pc-linux-gnu/bin/ -B/tmp/gcc/x86_64-pc-linux-gnu/lib/
-fsyntax-only repro.d ; echo $?
0
---

[Bug c++/109918] [12/13/14/15 Regression] Unexpected -Woverloaded-virtual with virtual conversion operators

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

--- Comment #6 from GCC Commits  ---
The master branch has been updated by Simon Martin :

https://gcc.gnu.org/g:60163c85730e6b7c566e219222403ac87ddbbddd

commit r15-4282-g60163c85730e6b7c566e219222403ac87ddbbddd
Author: Simon Martin 
Date:   Fri Oct 11 10:16:26 2024 +0200

c++: Fix overeager Woverloaded-virtual with conversion operators [PR109918]

We currently emit an incorrect -Woverloaded-virtual warning upon the
following test case

=== cut here ===
struct A {
  virtual operator int() { return 42; }
  virtual operator char() = 0;
};
struct B : public A {
  operator char() { return 'A'; }
};
=== cut here ===

The problem is that when iterating over ovl_range (fns), warn_hidden
gets confused by the conversion operator marker, concludes that
seen_non_override is true and therefore emits a warning for all
conversion operators in A that do not convert to char, even if
-Woverloaded-virtual is 1 (e.g. with -Wall, the case reported).

A second set of problems is highlighted when -Woverloaded-virtual is 2.

First, with the same test case, since base_fndecls contains all
conversion operators in A (except the one to char, that's been removed
when iterating over ovl_range (fns)), we emit a spurious warning for
the conversion operator to int, even though it's unrelated.

Second, in case there are several conversion operators with different
cv-qualifiers to the same type in A, we rightfully emit a warning,
however the note uses the location of the conversion operator marker
instead of the right one; location_of should go over conv_op_marker.

This patch fixes all these by explicitly keeping track of (1) base
methods that are overriden, as well as (2) base methods that are hidden
but not overriden (and by what), and warning about methods that are in
(2) but not (1). It also ignores non virtual base methods, per
"definition" of -Woverloaded-virtual.

PR c++/109918

gcc/cp/ChangeLog:

* class.cc (warn_hidden): Keep track of overloaded and of hidden
base methods. Mention the actual hiding function in the warning,
not the first overload.
* error.cc (location_of): Skip over conv_op_marker.

gcc/testsuite/ChangeLog:

* g++.dg/warn/Woverloaded-virt1.C: Check that no warning is
emitted for non virtual base methods.
* g++.dg/warn/Woverloaded-virt5.C: New test.
* g++.dg/warn/Woverloaded-virt6.C: New test.
* g++.dg/warn/Woverloaded-virt7.C: New test.
* g++.dg/warn/Woverloaded-virt8.C: New test.
* g++.dg/warn/Woverloaded-virt9.C: New test.

[Bug c++/109918] [12/13/14/15 Regression] Unexpected -Woverloaded-virtual with virtual conversion operators

2024-10-12 Thread simartin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109918

Simon Martin  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED
   Target Milestone|12.5|15.0

--- Comment #7 from Simon Martin  ---
Fixed on trunk.

[Bug middle-end/112600] Failed to optimize saturating addition using __builtin_add_overflow

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

Uroš Bizjak  changed:

   What|Removed |Added

 CC||pan2.li at intel dot com
   Target Milestone|--- |15.0

--- Comment #18 from Uroš Bizjak  ---
Implemented in gcc-15.(In reply to Tamar Christina from comment #5)
> Yeah, this is hurting us a lot on vectors as well:
> 
> https://godbolt.org/z/ecnGadxcG

Similar testcase:

--cut here--
unsigned short
add_sat(unsigned short x, unsigned short y)
{
unsigned short z;
if (!__builtin_add_overflow(x, y, &z))
return z;
return -1u;
}

unsigned short
add_sat2(unsigned short x, unsigned short y)
{
unsigned short res;
res = x + y;
res |= -(res < x);
return res;
}

void f(unsigned short * restrict a, unsigned short * restrict b)
{
for (int i = 0; i < 8; i++)
  {
b[i] = add_sat (a[i], b[i]);
  }
}

void f2(unsigned short * restrict a, unsigned short * restrict b)
{
for (int i = 0; i < 8; i++)
  {
b[i] = add_sat2 (a[i], b[i]);
  }
}
--cut here--

now generates optimal code on x86 (-O2 -ftree-vectorize) for all functions but
f2.

add_sat:
addw%di, %si
movl$-1, %eax
cmovnc  %esi, %eax
ret

add_sat2:
addw%di, %si
movl$-1, %eax
cmovnc  %esi, %eax
ret

f:
movdqu  (%rsi), %xmm1
movdqu  (%rdi), %xmm0
paddusw %xmm1, %xmm0
movups  %xmm0, (%rsi)
ret

f2:
movdqu  (%rdi), %xmm0
movdqu  (%rsi), %xmm1
pxor%xmm2, %xmm2
paddw   %xmm0, %xmm1
psubusw %xmm1, %xmm0
pcmpeqw %xmm2, %xmm0
pcmpeqw %xmm2, %xmm0
por %xmm1, %xmm0
movups  %xmm0, (%rsi)

Adding CC for the missing vectorization problem. clang is able to produce the
same assembly for f2 as for f.

[Bug target/117098] Tail call doesn't work in some cases

2024-10-12 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117098

H.J. Lu  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 CC||liuhongt at gcc dot gnu.org
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2024-10-12
Summary|Tail call doesn't work for  |Tail call doesn't work in
   |x32 |some cases

--- Comment #1 from H.J. Lu  ---
It also happens with x86-64:

[hjl@gnu-tgl-3 pr17098]$ cat x.c
struct A { int a[13]; };

int baz (int a, int b, int c, void *p, struct A s);

int
foo (int a, int b, int c, void *p, struct A s)
{
  return baz (a, b, c, p, s);
}
[hjl@gnu-tgl-3 pr17098]$ make CC=gcc
gcc -O2  -S x.c
[hjl@gnu-tgl-3 pr17098]$ cat x.s
.file   "x.c"
.text
.p2align 4
.globl  foo
.type   foo, @function
foo:
.LFB0:
.cfi_startproc
subq$72, %rsp
.cfi_def_cfa_offset 80
movdqu  80(%rsp), %xmm0
movl128(%rsp), %eax
movups  %xmm0, (%rsp)
movdqu  96(%rsp), %xmm0
movl%eax, 48(%rsp)
movups  %xmm0, 16(%rsp)
movdqu  112(%rsp), %xmm0
movups  %xmm0, 32(%rsp)
callbaz
addq$72, %rsp
.cfi_def_cfa_offset 8
ret
.cfi_endproc
.LFE0:
.size   foo, .-foo
.ident  "GCC: (GNU) 14.2.1 20240912 (Red Hat 14.2.1-3)"
.section.note.GNU-stack,"",@progbits
[hjl@gnu-tgl-3 pr17098]$

[Bug target/117095] [13/14/15 Regression] Wrong code since r13-5103-g7c9f20fcfdc2d8

2024-10-12 Thread stefansf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117095

--- Comment #2 from Stefan Schulze Frielinghaus  
---
Prior cse2 we have

(jump_insn 217 78 216 10 (parallel [
(set (pc)
(if_then_else (ne (reg:SI 165)
(const_int 1 [0x1]))
(label_ref 216)
(pc)))
(set (reg:SI 165)
(plus:SI (reg:SI 165)
(const_int -1 [0x])))
(clobber (scratch:SI))
(clobber (reg:CC 33 %cc))
]) "t.c":14:17 discrim 1 2192 {doloop_si64}
 (int_list:REG_BR_PROB 955630228 (nil))
 -> 216)
...
(insn 99 98 100 12 (set (reg:SI 138)
(const_int 1 [0x1])) "t.c":9:31 1507 {*movsi_zarch}
 (nil))
(insn 100 99 103 12 (parallel [
(set (reg:SI 137)
(minus:SI (reg:SI 138)
(subreg:SI (reg:HI 135 [ a ]) 0)))
(clobber (reg:CC 33 %cc))
]) "t.c":9:31 1904 {*subsi3}
 (expr_list:REG_DEAD (reg:SI 138)
(expr_list:REG_DEAD (reg:HI 135 [ a ])
(expr_list:REG_UNUSED (reg:CC 33 %cc)
(nil)

where insn 100 computes 1-a. After cse2 insn 99 is removed and pseudo 138 is
replaced with the branch-on-count pseudo 165 from jump_insn 217:

(insn 100 98 103 12 (parallel [
(set (reg:SI 137)
(minus:SI (reg:SI 165)
(subreg:SI (reg:HI 135 [ a ]) 0)))
(clobber (reg:CC 33 %cc))
]) "t.c":9:31 1904 {*subsi3}
 (expr_list:REG_DEAD (reg:SI 138)
(expr_list:REG_DEAD (reg:HI 135 [ a ])
(expr_list:REG_UNUSED (reg:CC 33 %cc)
(nil)

However, pseudo 165 is always 0 which means the result of the subtraction is
also always 0 since variable `a` is always 0.  Looks like cse2 missed that in
the parallel pseudo 165 is decreased.

[Bug middle-end/112600] Failed to optimize saturating addition using __builtin_add_overflow

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

--- Comment #17 from GCC Commits  ---
The master branch has been updated by Uros Bizjak :

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

commit r15-4284-ga564261245ad3002d53916e017b85939ace816a6
Author: Uros Bizjak 
Date:   Sat Oct 12 10:04:03 2024 +0200

testsuite/i386: Add vector sat_sub testcases [PR112600]

PR middle-end/112600

gcc/testsuite/ChangeLog:

* gcc.target/i386/pr112600-4a.c: New test.
* gcc.target/i386/pr112600-4b.c: New test.

[Bug middle-end/117098] Tail call doesn't work in some cases

2024-10-12 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117098

H.J. Lu  changed:

   What|Removed |Added

  Component|target  |middle-end

--- Comment #2 from H.J. Lu  ---
sibcall is disabled by

  if (known_eq (arg->locate.offset.constant, i))
{
  /* Even though they appear to be at the same location,
 if part of the outgoing argument is in registers,
 they aren't really at the same location.  Check for
 this by making sure that the incoming size is the
 same as the outgoing size.  */
  if (maybe_ne (arg->locate.size.constant, size_val))
sibcall_failure_1 = true;
}

(gdb) p size_val
$1 = {coeffs = {52}}
(gdb) p arg->locate.size.constant
$2 = {coeffs = {56}}

[Bug c++/109918] [12/13/14 Regression] Unexpected -Woverloaded-virtual with virtual conversion operators

2024-10-12 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109918

Jonathan Wakely  changed:

   What|Removed |Added

Summary|[12/13/14/15 Regression]|[12/13/14 Regression]
   |Unexpected  |Unexpected
   |-Woverloaded-virtual with   |-Woverloaded-virtual with
   |virtual conversion  |virtual conversion
   |operators   |operators

--- Comment #8 from Jonathan Wakely  ---
As this is a regression, it would usually be fixed on all open branches. Was
closing it without backports intentional?

[Bug middle-end/112600] Failed to optimize saturating addition using __builtin_add_overflow

2024-10-12 Thread pan2.li at intel dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112600

--- Comment #19 from Li Pan  ---
interesting, I will take a look for f2 after some more sat_* supported.