[Bug c++/118763] [12/13/14/15 regression] memory leak involving early return from statement expressions

2025-02-06 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118763

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |12.5
   Keywords||wrong-code

[Bug tree-optimization/88443] [meta-bug] bogus/missing -Wstringop-overflow warnings

2025-02-06 Thread aoliva at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88443
Bug 88443 depends on bug 118504, which changed state.

Bug 118504 Summary: Bogus -Wstringop-overflow warning on simple memcpy type loop
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118504

   What|Removed |Added

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

[Bug tree-optimization/113524] FAIL: gcc.dg/torture/pr113026-1.c -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (test for bogus messages, line 10)

2025-02-06 Thread aoliva at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113524

Alexandre Oliva  changed:

   What|Removed |Added

 CC||aoliva at gcc dot gnu.org

--- Comment #5 from Alexandre Oliva  ---
*** Bug 118504 has been marked as a duplicate of this bug. ***

[Bug tree-optimization/118504] Bogus -Wstringop-overflow warning on simple memcpy type loop

2025-02-06 Thread aoliva at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118504

Alexandre Oliva  changed:

   What|Removed |Added

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

--- Comment #2 from Alexandre Oliva  ---
Also on sparc-leon3-elf.

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

[Bug tree-optimization/113524] FAIL: gcc.dg/torture/pr113026-1.c -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (test for bogus messages, line 10)

2025-02-06 Thread aoliva at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113524

--- Comment #6 from Alexandre Oliva  ---
Also on arm-eabi, loongarch64-linux-gnu, and sparc-leon3-elf, from bug 118504.

[Bug target/118561] ICE calling __builtin_lasx_xvpickve2gr_w with lasx disabled

2025-02-06 Thread xry111 at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118561

Xi Ruoyao  changed:

   What|Removed |Added

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

--- Comment #7 from Xi Ruoyao  ---
So fixed.

[Bug preprocessor/118770] New: Random Segmentation fault in preprocessor from _Pragma push pop within _Pragma

2025-02-06 Thread ymity.me at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118770

Bug ID: 118770
   Summary: Random Segmentation fault in preprocessor from _Pragma
push pop within _Pragma
   Product: gcc
   Version: 14.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: preprocessor
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ymity.me at gmail dot com
  Target Milestone: ---

Created attachment 60394
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60394&action=edit
Crash log, gcc -v, file which caused crash from 2 diffrent devices.

"Random" Segmentation fault caused by calling _Pragma push_macro & _Pragma
pop_macro within _Pragma. Tested on two different devices and was able to
recreate it iff: 3 more push pop occurred within _Pragma - I did worry it was a
hardware problem. 

Only occurred when calling gcc with -E flag

// Some function like macro
#define X() X

// Needs to call _Pragma from within _Pragma
// Needs to be done in another function.
#define POP()\
_Pragma(   \
_Pragma("push_macro(\"X\")") \
_Pragma("pop_macro(\"X\")")  \
"pop_macro(\"CRASH\")"   \
)

// Have a infinite loop - Normal usecase Recursion.
#define CRASH()\
_Pragma("push_macro(\"CRASH\")")   \
POP()  \
CRASH()

CRASH()

[Bug c++/118763] [12/13/14/15 regression] memory leak involving early return from statement expressions since r12-6325

2025-02-06 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118763

Jakub Jelinek  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
 Ever confirmed|0   |1
 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2025-02-06

--- Comment #3 from Jakub Jelinek  ---
Created attachment 60395
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60395&action=edit
gcc15-pr118763.patch

Untested fix.  Wonder what other CLEANUP_EH_ONLY cleanups are affected.

[Bug c++/118766] `'type_pack_expansion' not supported by simple_type_specifier` comes with variadic requires

2025-02-06 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118766

Jonathan Wakely  changed:

   What|Removed |Added

Summary|`'type_pack_expansion' not  |`'type_pack_expansion' not
   |supported by|supported by
   |simple_type_specifier`  |simple_type_specifier`
   |comes with vararg requires  |comes with variadic
   ||requires

--- Comment #2 from Jonathan Wakely  ---
I've changed the summary because this has nothing to do with "vararg" (i.e. a
C-style  ellipsis), this is a variadic template.

[Bug target/118241] RISC-V ICE: internal compiler error: in int_mode_for_mode, at stor-layout.cc:407 caused by prefetch instructions

2025-02-06 Thread wangpengcheng.pp at bytedance dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118241

--- Comment #4 from Pengcheng Wang  ---
Ping. Is it possible to apply the patch and backport it to GCC 14?

[Bug rtl-optimization/117922] [15/16 Regression] fold-mem-offsets pass is slow and memory hungry because UD/UD chain usage and the RD df problem

2025-02-06 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117922

Richard Biener  changed:

   What|Removed |Added

   Keywords||deferred
   Target Milestone|15.0|16.0
   Priority|P1  |P2
Summary|[15 Regression] 1000%   |[15/16 Regression]
   |compilation time slow down  |fold-mem-offsets pass is
   |on the testcase from|slow and memory hungry
   |pr26854 |because UD/UD chain usage
   ||and the RD df problem

--- Comment #26 from Richard Biener  ---
So this should be mitigated for the PR26854 testcase - the heuristic of course
might not trigger for another one, showing a regression there.

The pass should be moved over to RTL-SSA as suggested, but that's a stage1
thing, so defering and re-wording the summary.

[Bug tree-optimization/118749] [15 regression] fontconfig miscompiled with -O3 -march=pentium4 on x86 since r15-1238

2025-02-06 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118749

Richard Biener  changed:

   What|Removed |Added

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

--- Comment #8 from Richard Biener  ---
Fixed (but the underlying issue is latent, possibly without a way to exploit it
to wrong-code).

[Bug c++/118661] [12/13/14/15 regression] Reading volatile qualified std::nullptr_t should be valid in a constant expression

2025-02-06 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118661

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #5 from Jakub Jelinek  ---
Created attachment 60392
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60392&action=edit
gcc15-pr118661.patch

Untested fix.

[Bug target/118561] ICE calling __builtin_lasx_xvpickve2gr_w with lasx disabled

2025-02-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118561

--- Comment #5 from GCC Commits  ---
The master branch has been updated by LuluCheng :

https://gcc.gnu.org/g:50d2bde68a097c2e9fb3bdd7e6664c899828

commit r15-7386-g50d2bde68a097c2e9fb3bdd7e6664c899828
Author: Lulu Cheng 
Date:   Wed Jan 22 17:57:21 2025 +0800

LoongArch: Fix ICE caused by illegal calls to builtin functions [PR118561].

PR target/118561

gcc/ChangeLog:

* config/loongarch/loongarch-builtins.cc
(loongarch_expand_builtin_lsx_test_branch):
NULL_RTX will not be returned when an error is detected.
(loongarch_expand_builtin): Likewise.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/pr118561.c: New test.

[Bug target/118561] ICE calling __builtin_lasx_xvpickve2gr_w with lasx disabled

2025-02-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118561

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

https://gcc.gnu.org/g:9a09fc9b8495f6cfa7b848b0064a96112dcb4a7f

commit r14-11275-g9a09fc9b8495f6cfa7b848b0064a96112dcb4a7f
Author: Lulu Cheng 
Date:   Wed Jan 22 17:57:21 2025 +0800

LoongArch: Fix ICE caused by illegal calls to builtin functions [PR118561].

PR target/118561

gcc/ChangeLog:

* config/loongarch/loongarch-builtins.cc
(loongarch_expand_builtin_lsx_test_branch):
NULL_RTX will not be returned when an error is detected.
(loongarch_expand_builtin): Likewise.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/pr118561.c: New test.

(cherry picked from commit 50d2bde68a097c2e9fb3bdd7e6664c899828)

[Bug c++/118763] [12/13/14/15 regression] memory leak involving early return from statement expressions since r12-6325

2025-02-06 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118763

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org
Summary|[12/13/14/15 regression]|[12/13/14/15 regression]
   |memory leak involving early |memory leak involving early
   |return from statement   |return from statement
   |expressions |expressions since r12-6325

--- Comment #2 from Jakub Jelinek  ---
Started with r12-6325-gad64a821970ef5547d77ece22d302b0e599ae0d2
  D.2863 = operator new (4);
  D.2864 = 1;
  try
{
  if (x != 0) goto ; else goto ;
  :
  D.2869 = 0B;
  // predicted unlikely by early return (on trees) predictor.
  return D.2869;
  :
  MEM[(int *)D.2863] = 1;
  D.2864 = 0;
  D.2869 = D.2863;
  return D.2869;
}
  catch
{
  if (D.2864 != 0) goto ; else goto ;
  :
  operator delete (D.2863, 4);
  goto ;
  :
  :
}
I think the problem is in using CLEANUP_EH_ONLY cleanup here which is turned
into try/catch, rather than one that is turned into try/finally.  Because that
one would DTRT here already, the D.2864 guard variable is already cleared if
new int succeeded.

[Bug libgdiagnostics/118769] New: Provide better location information for diagnostics with -Wattributes

2025-02-06 Thread gjl at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118769

Bug ID: 118769
   Summary: Provide better location information for diagnostics
with -Wattributes
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libgdiagnostics
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: gjl at gcc dot gnu.org
  Target Milestone: ---

Compiling the following code with v15

__attribute__((xxx))
void my4 () {}

I am getting the following diagnostic:

file.c:2:1: warning: 'xxx' attribute directive ignored [-Wattributes]
2 | void my4 () {}
  | ^~~~

There in nothing wrong with "void".  IMHO the diagnostic should point to the
unrecognized attribute. Or with:

__attribute__((used(10)))
void my5 () {}

file.c:2:1: error: wrong number of arguments specified for 'used' attribute
2 | void my5 () {}
  | ^~~~
file.c:2:1: note: expected 0, found 1

[Bug rtl-optimization/115568] [12/13/14 Regression] wrong code at -O2 with "-fno-tree-sink -fno-tree-ter -fschedule-insns" on x86_64-linux-gnu since r12-6122-g9407058a430316

2025-02-06 Thread ubizjak at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115568

--- Comment #9 from Uroš Bizjak  ---
The asm dump from Comment #6 now looks correct:

movl%edi, %r14d # 122   [c=4 l=3]  *movsi_internal/0
movl%r14d, -44(%rsp)# 476   [c=4 l=5]  *movsi_internal/1
->  movl-52(%rsp), %eax # 482   [c=6 l=4]  *movsi_internal/0
->  movl%eax, -36(%rsp) # 16[c=4 l=4]  *movsi_internal/1
movl%r11d, -28(%rsp)# 18[c=4 l=5]  *movsi_internal/1
notl%edi# 121   [c=4 l=2]  *one_cmplsi2_1/0
movl%edi, %r9d  # 413   [c=4 l=3]  *movsi_internal/0
movl%r13d, %r8d # 414   [c=4 l=3]  *movsi_internal/0
notl%r8d# 123   [c=4 l=3]  *one_cmplsi2_1/0
movb$1, -1(%rsp)# 312   [c=4 l=5]  *movqi_internal/8
movl%r13d, %edi # 124   [c=4 l=3]  *movsi_internal/0
movl%r14d, -52(%rsp)# 17[c=4 l=5]  *movsi_internal/1
movl%ecx, %r11d # 19[c=4 l=3]  *movsi_internal/0

[Bug rtl-optimization/117922] [15 Regression] 1000% compilation time slow down on the testcase from pr26854

2025-02-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117922

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

https://gcc.gnu.org/g:677122c9df1b55a791a54426269f7a8ce794f947

commit r15-7384-g677122c9df1b55a791a54426269f7a8ce794f947
Author: Richard Biener 
Date:   Wed Feb 5 13:17:47 2025 +0100

rtl-optimization/117922 - disable fold-mem-offsets for highly connected CFG

The PR shows fold-mem-offsets taking ages and a lot of memory computing
DU/UD chains as that requires the RD problem.  The issue is not so much
the memory required for the pruned sets but the high CFG connectivity
(and that the CFG is cyclic) which makes solving the dataflow problem
expensive.

The following adds the same limit as the one imposed by GCSE and CPROP.

PR rtl-optimization/117922
* fold-mem-offsets.cc (pass_fold_mem_offsets::execute):
Do nothing for a highly connected CFG.

[Bug tree-optimization/118749] [15 regression] fontconfig miscompiled with -O3 -march=pentium4 on x86 since r15-1238

2025-02-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118749

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

https://gcc.gnu.org/g:927e10bfce569947354cdd6b35c29b74e25c7816

commit r15-7383-g927e10bfce569947354cdd6b35c29b74e25c7816
Author: Richard Biener 
Date:   Wed Feb 5 10:28:25 2025 +0100

tree-optimization/118749 - bogus alignment peeling causes misaligned access

The vectorizer thinks it can align a vector access to 16 bytes when
using a vectorization factor of 8 and 1 byte elements.  That of
course does not work for the 2nd vector iteration.  Apparently we
lack a guard against such nonsense.

PR tree-optimization/118749
* tree-vect-data-refs.cc (vector_alignment_reachable_p): Pass
in the vectorization factor, when that cannot maintain
the DRs target alignment do not claim we can reach that
by peeling.

* gcc.dg/vect/pr118749.c: New testcase.

[Bug c++/115586] c++26: with 2 or more name-independent declarations (anonymous/placeholder structure bindings) with for loop

2025-02-06 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115586

--- Comment #7 from Jakub Jelinek  ---
Created attachment 60393
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60393&action=edit
gcc15-pr115586.patch

Untested fix.

[Bug target/118768] New: [avr] Make genmultilib.awk more robust against white spaces

2025-02-06 Thread gjl at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118768

Bug ID: 118768
   Summary: [avr] Make genmultilib.awk more robust against white
spaces
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gjl at gcc dot gnu.org
  Target Milestone: ---

The current genmultilib.awk is prone to errors when avr-mmcu.def adds or
removed white spaces.  For example, AVR_ATTR1|AVR_ATTR2 will be parsed not the
same like AVR_ATTR1 | AVR_ATTR2.

[Bug target/118768] [avr] Make genmultilib.awk more robust against white spaces

2025-02-06 Thread gjl at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118768

Georg-Johann Lay  changed:

   What|Removed |Added

 Blocks||118764
 Target||avr
   Target Milestone|--- |15.0


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118764
[Bug 118764] [avr] Add support for Compact Vector Table

[Bug c/118765] c23 tag matching broken for multiple redeclarations of typedefs

2025-02-06 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118765

Richard Biener  changed:

   What|Removed |Added

   Last reconfirmed||2025-02-06
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW

--- Comment #10 from Richard Biener  ---
So confirmed.

[Bug tree-optimization/110449] Vect: use a small step to calculate the loop induction if the loop is unrolled during loop vectorization

2025-02-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110449

--- Comment #4 from GCC Commits  ---
The trunk branch has been updated by Richard Sandiford :

https://gcc.gnu.org/g:7eb260c8a472568912c1e0b83fb402d22977281e

commit r15-7385-g7eb260c8a472568912c1e0b83fb402d22977281e
Author: Richard Sandiford 
Date:   Thu Feb 6 10:30:53 2025 +

vect: Move induction IV increments [PR110449]

In this PR, we used to generate:

 .L6:
  mov v30.16b, v31.16b
  faddv31.4s, v31.4s, v27.4s
  faddv29.4s, v30.4s, v28.4s
  stp q30, q29, [x0]
  add x0, x0, 32
  cmp x1, x0
  bne .L6

for an unrolled induction in:

  for (int i = 0; i < 1024; i++)
{
  arr[i] = freq;
  freq += step;
}

with the problem being the unnecessary MOV.

The main induction IV was incremented by VF * step == 2 * nunits * step,
and then nunits * step was added for the second store to arr.

The original patch for the PR (r14-2367-g224fd59b2dc8) avoided the MOV
by incrementing the IV by nunits * step twice.  The problem with that
approach is that it doubles the loop-carried latency.  This change was
deliberately not preserved when moving from loop-vect to SLP and so
the test started failing again after r15-3509-gd34cda720988.

I think the main problem is that we put the IV increment in the wrong
place.  Normal IVs created by create_iv are placed before the exit
condition where possible, but vectorizable_induction instead always
inserted them at the start of the loop body.  The only use of the
incremented IV is by the phi node, so the effect is to make both
the old and new IV values live for the whole loop body, which is
why we need the MOV.

The simplest fix therefore seems to be to reuse the create_iv logic.

gcc/
PR tree-optimization/110449
* tree-ssa-loop-manip.h (insert_iv_increment): Declare.
* tree-ssa-loop-manip.cc (insert_iv_increment): New function,
split out from...
(create_iv): ...here and generalized to gimple_seqs.
* tree-vect-loop.cc (vectorizable_induction): Use
standard_iv_increment_position and insert_iv_increment
to insert the IV increment.

gcc/testsuite/
PR tree-optimization/110449
* gcc.target/aarch64/pr110449.c: Expect an increment by 8.0,
but test that there is no MOV.

[Bug tree-optimization/118756] tree-ssa-loop-ivopts.cc:1156: Function defined but not used

2025-02-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118756

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2025-02-06
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW

--- Comment #3 from Andrew Pinski  ---
.

Just an FYI, the bug report about an (static) function which is only used by
itself not being warned about in GCC is PR 32562.

[Bug preprocessor/118770] Random Segmentation fault in preprocessor from _Pragma push pop within _Pragma

2025-02-06 Thread ymity.me at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118770

--- Comment #4 from ymity.me at gmail dot com ---
I would expect it to take longer in such a case, it's almost instant on my
laptop, and quite random on my tower pc. If i modify it just a little bit it
would continue endlessly.

[Bug target/117036] [SH] add __builtin_sh_fsca, __builtin_sh_fsrra

2025-02-06 Thread skmp at emudev dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117036

Stefanos Kornilios Mitsis Poiitidis  changed:

   What|Removed |Added

 CC||skmp at emudev dot org

--- Comment #1 from Stefanos Kornilios Mitsis Poiitidis  ---
Created attachment 60402
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60402&action=edit
Initial patch for builtin_sh_fsca

This is an initial patch to add __builtin_sh_fsca.

It needs the vectors enabled (abi breaking/extending), as it returns 2-float
vector. Vector to vector mov also needed to be implemented (partial; won't work
from/to memory as is in the patch).

The following test code

float  fsca_test(unsigned angle) {
return __builtin_sh_fsca(angle)[0];
}

produces

_fsca_test:
ldsr4,fpul
rts
fscafpul,dr0

[Bug target/109780] [12/13/14/15 Regression] csmith: runtime crash with -O2 -march=znver1

2025-02-06 Thread ubizjak at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109780

--- Comment #33 from Uroš Bizjak  ---
FTR, ix86_find_max_used_stack_alignment increases alignment only when stack
pointer or frame pointer are explicitly mentioned in :

/* Find the maximum stack alignment.  */
subrtx_iterator::array_type array;
FOR_EACH_SUBRTX (iter, array, PATTERN (insn), ALL)
  if (MEM_P (*iter)
  && (reg_mentioned_p (stack_pointer_rtx,
   *iter)
  || reg_mentioned_p (frame_pointer_rtx,
  *iter)))
{
  unsigned int alignment = MEM_ALIGN (*iter);
  if (alignment > stack_alignment)
stack_alignment = alignment;


This RTX does *not* trigger stack alignment increase in the above code:

(insn 94 20 95 5 (set (mem/c:V16QI (reg/f:DI 1 dx [110]) [0 MEM 
[(void *)&k]+0 S16 A128])
(reg:V16QI 21 xmm1 [orig:122 MEM  [(void *)&k] ] [122]))
"pr109780.c":11:12 2015 {movv16qi_internal}
 (nil))

[Bug target/118776] [15 regression] ICE when building xvid-1.3.7 with LTO (extract_insn, at recog.cc:2882)

2025-02-06 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118776

--- Comment #1 from Sam James  ---
Created attachment 60403
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60403&action=edit
xvid-118776.tar.xz

`x86_64-pc-linux-gnu-gcc -m32 decoder.i xvid.i bitstream.i quant_matrix.i -o
/dev/null -shared -Wl,--version-script=libxvidcore.ld -std=gnu17 -O2
-march=tigerlake -flto`

Fails without -m32 too.

[Bug target/118776] [15 regression] ICE when building xvid-1.3.7 with LTO (extract_insn, at recog.cc:2882)

2025-02-06 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118776

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
#include 

__v32qi a[4];

__m256i
foo (__m256i b, __m256i w, __mmask32 m)
{
  return _mm256_mask_max_epu8 (w, m, ((__m256i *) &a)[2], b);
}
unfortunately doesn't reproduce it, wonder what keeps the MEM in the insn.

[Bug target/118776] [15 regression] ICE when building xvid-1.3.7 with LTO (extract_insn, at recog.cc:2882)

2025-02-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118776

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |15.0

[Bug target/109780] [12/13/14/15 Regression] csmith: runtime crash with -O2 -march=znver1

2025-02-06 Thread ubizjak at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109780

--- Comment #34 from Uroš Bizjak  ---
The problematic code is expanded from:

;; Generating RTL for gimple basic block 5

;; __builtin_memset (&k, 0, 40);

(insn 21 20 22 (parallel [
(set (reg:DI 107)
(plus:DI (reg/f:DI 93 virtual-stack-vars)
(const_int -48 [0xffd0])))
(clobber (reg:CC 17 flags))
]) "pr109780.c":11:12 -1
 (nil))

(insn 22 21 23 (set (reg:V32QI 108)
(const_vector:V32QI [
(const_int 0 [0]) repeated x32
])) "pr109780.c":11:12 -1
 (nil))

(insn 23 22 24 (set (mem/c:V16QI (reg:DI 107) [0 MEM  [(void
*)&k]+0 S16 A128])
(vec_select:V16QI (reg:V32QI 108)
(parallel [
(const_int 0 [0])
(const_int 1 [0x1])
(const_int 2 [0x2])
(const_int 3 [0x3])
(const_int 4 [0x4])
(const_int 5 [0x5])
(const_int 6 [0x6])
(const_int 7 [0x7])
(const_int 8 [0x8])
(const_int 9 [0x9])
(const_int 10 [0xa])
(const_int 11 [0xb])
(const_int 12 [0xc])
(const_int 13 [0xd])
(const_int 14 [0xe])
(const_int 15 [0xf])
]))) "pr109780.c":11:12 -1
 (nil))

(insn 24 23 25 (set (mem/c:V16QI (plus:DI (reg:DI 107)
(const_int 16 [0x10])) [0 MEM  [(void *)&k]+16 S16
A128])
(vec_select:V16QI (reg:V32QI 108)
(parallel [
(const_int 16 [0x10])
(const_int 17 [0x11])
(const_int 18 [0x12])
(const_int 19 [0x13])
(const_int 20 [0x14])
(const_int 21 [0x15])
(const_int 22 [0x16])
(const_int 23 [0x17])
(const_int 24 [0x18])
(const_int 25 [0x19])
(const_int 26 [0x1a])
(const_int 27 [0x1b])
(const_int 28 [0x1c])
(const_int 29 [0x1d])
(const_int 30 [0x1e])
(const_int 31 [0x1f])
]))) "pr109780.c":11:12 -1
 (nil))

(insn 25 24 0 (set (mem/c:DI (plus:DI (reg:DI 107)
(const_int 32 [0x20])) [0 MEM  [(void *)&k]+32 S8
A128])
(subreg:DI (reg:V32QI 108) 0)) "pr109780.c":11:12 -1
 (nil))

[Bug c++/118775] [12/13/14/15 Regression] ICE in tree_to_uhwi with unique_ptr and addresss of var converted to an integer

2025-02-06 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118775

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org
 Ever confirmed|0   |1
   Last reconfirmed||2025-02-06
   Keywords||needs-reduction
   Target Milestone|--- |12.5
   Priority|P3  |P2
Summary|ICE in tree_to_uhwi with|[12/13/14/15 Regression]
   |unique_ptr and addresss of  |ICE in tree_to_uhwi with
   |var converted to an integer |unique_ptr and addresss of
   ||var converted to an integer
 Status|UNCONFIRMED |NEW

--- Comment #1 from Marek Polacek  ---
Seems to have started with r11-7740:

commit 82bb66730bc42b8694fdebef607ea6e49e8496bf
Author: Jakub Jelinek 
Date:   Fri Mar 19 18:36:56 2021 +0100

c++: Only reject reinterpret casts from pointers to integers for
manifestly_const_eval evaluation [PR99456]

[Bug fortran/108454] ICE in gfc_trans_common, at fortran/trans-common.cc:1385

2025-02-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108454

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

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

commit r14-11276-gca652aebd30132b2a9afbc07c664a35b5e443350
Author: Harald Anlauf 
Date:   Thu Jan 30 22:21:19 2025 +0100

Fortran: host association issue with symbol in COMMON block [PR108454]

When resolving a flavorless symbol that is already registered with a COMMON
block, and which neither has the intrinsic, generic, or external attribute,
skip searching among interfaces to avoid false resolution to a derived type
of the same name.

PR fortran/108454

gcc/fortran/ChangeLog:

* resolve.cc (resolve_common_blocks): Initialize variable.
(resolve_symbol): If a symbol is already registered with a COMMON
block, do not search for an interface with the same name.

gcc/testsuite/ChangeLog:

* gfortran.dg/common_29.f90: New test.

(cherry picked from commit d6418fe22684f9335474d1fd405ade45954c069d)

[Bug c++/118775] New: ICE in tree_to_uhwi

2025-02-06 Thread nickooo314 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118775

Bug ID: 118775
   Summary: ICE in tree_to_uhwi
   Product: gcc
   Version: 14.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: nickooo314 at gmail dot com
  Target Milestone: ---

I am getting an internal compiler error when compiling the following code:

#include

int a;

int main() {
std::unique_ptr p = std::make_unique((uint64_t)&a);

return 0;
}

$ /gcc-install/bin/g++ -std=c++23 crash-test.cpp
In file included from /gcc-install/include/c++/15.0.1/memory:80,
 from crash-test.cpp:1:
/gcc-install/include/c++/15.0.1/bits/unique_ptr.h: In function ‘int main()’:
crash-test.cpp:6:57:   in ‘constexpr’ expansion of ‘std::make_unique(((uint64_t)(& a)))’
/gcc-install/include/c++/15.0.1/bits/unique_ptr.h:1092:30: internal compiler
error: in tree_to_uhwi, at tree.cc:6530
 1092 | { return unique_ptr<_Tp>(new remove_extent_t<_Tp>[__num]()); }
  |  ^
0x29dd59f internal_error(char const*, ...)
/gcc-build/../gcc/gcc/diagnostic-global-context.cc:517
0xb02eef fancy_abort(char const*, int, char const*)
/gcc-build/../gcc/gcc/diagnostic.cc:1722
0xa11d85 tree_to_uhwi(tree_node const*)
/gcc-build/../gcc/gcc/tree.cc:6530
0xa11d85 tree_to_uhwi(tree_node const*)
/gcc-build/../gcc/gcc/tree.cc:6528
0xb691f7 cxx_eval_call_expression
/gcc-build/../gcc/gcc/cp/constexpr.cc:2913
0xb6ac97 cxx_eval_constant_expression
/gcc-build/../gcc/gcc/cp/constexpr.cc:7688
0xb6ccf9 cxx_eval_constant_expression
/gcc-build/../gcc/gcc/cp/constexpr.cc:7814
0xb6abd1 cxx_eval_constant_expression
/gcc-build/../gcc/gcc/cp/constexpr.cc:8055
0xb6a85a cxx_eval_constant_expression
/gcc-build/../gcc/gcc/cp/constexpr.cc:8248
0xb67a88 cxx_bind_parameters_in_call
/gcc-build/../gcc/gcc/cp/constexpr.cc:1907
0xb67a88 cxx_eval_call_expression
/gcc-build/../gcc/gcc/cp/constexpr.cc:3059
0xb6ac97 cxx_eval_constant_expression
/gcc-build/../gcc/gcc/cp/constexpr.cc:7688
0xb711c0 cxx_eval_store_expression
/gcc-build/../gcc/gcc/cp/constexpr.cc:6784
0xb6a5cc cxx_eval_constant_expression
/gcc-build/../gcc/gcc/cp/constexpr.cc:7841
0xb6b8ae cxx_eval_constant_expression
/gcc-build/../gcc/gcc/cp/constexpr.cc:7853
0xb6ae16 cxx_eval_constant_expression
/gcc-build/../gcc/gcc/cp/constexpr.cc:7915
0xb68e7b cxx_eval_call_expression
/gcc-build/../gcc/gcc/cp/constexpr.cc:3312
0xb6ac97 cxx_eval_constant_expression
/gcc-build/../gcc/gcc/cp/constexpr.cc:7688
0xb77b02 cxx_eval_outermost_constant_expr
/gcc-build/../gcc/gcc/cp/constexpr.cc:8983
0xb7cf76 maybe_constant_value(tree_node*, tree_node*, mce_value)
/gcc-build/../gcc/gcc/cp/constexpr.cc:9278

The issue seems reproduceable in all GCC versions from 12 onward only when
using the -std=c++23 flag. It also only seems to work when 'a' is a global
variable.

[Bug c++/118763] [12/13/14/15 regression] memory leak involving early return from statement expressions since r12-6325

2025-02-06 Thread valentin at tolmer dot fr via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118763

--- Comment #4 from Valentin Tolmer  ---
I noticed that the standard (or at least cppreference) says that "The call to
the allocation function (operator new) is sequenced before(since C++17) the
evaluation of the constructor arguments in a new expression."

I'm not sure what that entails for statement expressions. On the one hand, I
can see that the current behavior is a correct interpretation of the standard:
the allocation is done, then the arguments are evaluated, and we return from
the function with no destructors to run. On the other hand, that's quite
painful for the use case in question. The only way I can see to fix that is to
document that you shouldn't return inside the constructor arguments of a new,
and possibly implement a clang-tidy check to enforce that.

[Bug target/118776] [15 regression] ICE when building xvid-1.3.7 with LTO (extract_insn, at recog.cc:2882)

2025-02-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118776

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||needs-bisection,
   ||needs-reduction

--- Comment #3 from Andrew Pinski  ---
Reducing ...

[Bug target/118776] [15 regression] ICE when building xvid-1.3.7 with LTO (extract_insn, at recog.cc:2882)

2025-02-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118776

--- Comment #4 from Andrew Pinski  ---
Note if you change the linker script to just export decoder_decode you can
remove xvid.i file from what is needed to reduce it.

[Bug target/109780] [12/13/14/15 Regression] csmith: runtime crash with -O2 -march=znver1

2025-02-06 Thread ubizjak at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109780

--- Comment #36 from Uroš Bizjak  ---
(In reply to Uroš Bizjak from comment #35)

> It is not a good idea to CSE address that refers to virtual stack vars to a
> temporary. This defeats stack/frame pointer detection, mentioned in Comment
> #33, and consequently fails to increase stack alignment.

This is expanded via builtins.cc/expand_builtin_memset_args.

[Bug target/118771] [15 regression] aarch64 bootstrap fails unless --disable-werror

2025-02-06 Thread schwab--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118771

--- Comment #1 from Andreas Schwab  ---
The maybe-uninitialized warning only triggers with release checking.

[Bug fortran/118750] [14/15 Regression] ICE on associate with elemental function with polymorphic array dummy argument

2025-02-06 Thread pault at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118750

Paul Thomas  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
   Assignee|unassigned at gcc dot gnu.org  |pault at gcc dot gnu.org
   Last reconfirmed||2025-02-06
 CC||pault at gcc dot gnu.org

--- Comment #1 from Paul Thomas  ---
Created attachment 60396
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60396&action=edit
Fix for the PR

Hi Dmaina,

Thanks for the report. The regression is almost certainly my doing but I am
blowed if I can see when and where.

This patch is regtesting as I write. It should be OK though and will be
submitted as soon as the regtesting is done.

Paul

[Bug target/118768] [avr] Make genmultilib.awk more robust against white spaces

2025-02-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118768

--- Comment #1 from GCC Commits  ---
The master branch has been updated by Georg-Johann Lay :

https://gcc.gnu.org/g:5282e13a938404d7d4edc0ccfe6cbe9b4f980d7e

commit r15-7387-g5282e13a938404d7d4edc0ccfe6cbe9b4f980d7e
Author: Georg-Johann Lay 
Date:   Wed Feb 5 12:01:55 2025 +0100

AVR: genmultilib.awk - Use more robust parsing of spaces.

gcc/
PR target/118768
* config/avr/genmultilib.awk: Parse the AVR_MCU lines in
a more robust way w.r.t. white spaces.

[Bug target/118764] [avr] Add support for Compact Vector Table

2025-02-06 Thread gjl at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118764
Bug 118764 depends on bug 118768, which changed state.

Bug 118768 Summary: [avr] Make genmultilib.awk more robust against white spaces
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118768

   What|Removed |Added

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

[Bug target/118768] [avr] Make genmultilib.awk more robust against white spaces

2025-02-06 Thread gjl at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118768

Georg-Johann Lay  changed:

   What|Removed |Added

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

--- Comment #2 from Georg-Johann Lay  ---
Done.

[Bug target/118772] BPF doesn't actually support effective-target 'exceptions'?

2025-02-06 Thread jemarch at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118772

--- Comment #1 from Jose E. Marchesi  ---
Hello Thomas.

I can confirm it is ok to get check_effective_target_exceptions to return 0 for
bpf-*-* targets.  Thanks!

[Bug target/118771] [15 regression] aarch64 bootstrap fails with --enabled-checking=release because of uninitialized warning

2025-02-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118771

Andrew Pinski  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |pinskia at gcc dot 
gnu.org
   Last reconfirmed||2025-02-06
 Ever confirmed|0   |1
 Status|UNCONFIRMED |ASSIGNED

--- Comment #2 from Andrew Pinski  ---
So looking into this. The problem is GCC does not realize that npieces is
non-zero (that is this is false positive but not enough information is provided
to GCC to figure it out).

I am deciding between adding:
```
gcc_assert (npieces > 0);
```
or
```
if (npieces <= 0)
  gcc_unreachable();
```

to aarch64_split_move .

[Bug c++/110345] [C++26] P2552R3 - On the ignorability of standard attributes

2025-02-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110345

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

https://gcc.gnu.org/g:122b946cc632e472ee6d828f8adf05567cfaa831

commit r15-7392-g122b946cc632e472ee6d828f8adf05567cfaa831
Author: Jakub Jelinek 
Date:   Thu Feb 6 18:34:01 2025 +0100

c++: Add noreturn attribute further test coverage [PR110345]

Another non-problematic attribute.

2025-02-06  Jakub Jelinek  

PR c++/110345
* g++.dg/cpp0x/attr-noreturn1.C: New test.

[Bug c++/110345] [C++26] P2552R3 - On the ignorability of standard attributes

2025-02-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110345

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

https://gcc.gnu.org/g:6305c46fad5ae9b3b94b069c040cdd0c67e6e49e

commit r15-7393-g6305c46fad5ae9b3b94b069c040cdd0c67e6e49e
Author: Jakub Jelinek 
Date:   Thu Feb 6 18:35:13 2025 +0100

c++: Add no_unique_address attribute further test coverage [PR110345]

Another non-problematic attribute.

2025-02-06  Jakub Jelinek  

PR c++/110345
* g++.dg/cpp0x/attr-no_unique_address1.C: New test.

[Bug c++/110345] [C++26] P2552R3 - On the ignorability of standard attributes

2025-02-06 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110345

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #20 from Jakub Jelinek  ---
Implemented for GCC 15.

[Bug c++/85481] [12/13/14/15 Regression] ICE in maybe_explain_implicit_delete

2025-02-06 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85481

Marek Polacek  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 CC||mpolacek at gcc dot gnu.org
 Status|NEW |RESOLVED

--- Comment #14 from Marek Polacek  ---
Fixed by r12-6863.

[Bug c++/110338] Implement C++26 language features

2025-02-06 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110338
Bug 110338 depends on bug 110345, which changed state.

Bug 110345 Summary: [C++26] P2552R3 - On the ignorability of standard attributes
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110345

   What|Removed |Added

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

[Bug libfortran/114618] Format produces incorrect output when contains 1x, ok when uses " "

2025-02-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114618

--- Comment #8 from GCC Commits  ---
The master branch has been updated by Jerry DeLisle :

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

commit r15-7394-gcfed99751c1a3b93ca66451eb1b62271e682f927
Author: Jerry DeLisle 
Date:   Wed Jan 29 13:40:59 2025 -0800

Fortran: Fix handling of the X edit descriptor.

This patch is a partial fix of handling of X edit descriptors
when combined with certain T edit descriptors.

PR libfortran/114618

libgfortran/ChangeLog:

* io/transfer.c (formatted_transfer_scalar_write): Change name
of vriable 'pos' to 'tab_pos' to improve clarity. Add new
variable next_pos when calculating the maximum position.
Update the calculation of pending spaces.

gcc/testsuite/ChangeLog:

* gfortran.dg/pr114618.f90: New test.

[Bug libfortran/114618] Format produces incorrect output when contains 1x, ok when uses " "

2025-02-06 Thread jvdelisle at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114618

--- Comment #9 from Jerry DeLisle  ---
I am thinking to backport this as it cleans up some output with garbage in it.

Any thoughts?

[Bug tree-optimization/118756] tree-ssa-loop-ivopts.cc:1156: Function defined but not used

2025-02-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118756

--- Comment #4 from GCC Commits  ---
The master branch has been updated by Tamar Christina :

https://gcc.gnu.org/g:8d19fbb2be487f19ed1c48699e17cafe19520525

commit r15-7395-g8d19fbb2be487f19ed1c48699e17cafe19520525
Author: Tamar Christina 
Date:   Thu Feb 6 17:46:52 2025 +

middle-end: Remove unused internal function after IVopts cleanup [PR118756]

It seems that after my IVopts patches the function
contain_complex_addr_expr
became unused and clang is rightfully complaining about it.

This removes the unused internal function.

gcc/ChangeLog:

PR tree-optimization/118756
* tree-ssa-loop-ivopts.cc (contain_complex_addr_expr): Remove.

[Bug tree-optimization/118756] tree-ssa-loop-ivopts.cc:1156: Function defined but not used

2025-02-06 Thread tnfchris at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118756

Tamar Christina  changed:

   What|Removed |Added

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

--- Comment #5 from Tamar Christina  ---
Fixed, thanks for pointing it out

[Bug target/115703] [15 Regression] rv64gcv_zvl256b miscompile since r15-1579-g792f97b44ff

2025-02-06 Thread rdapp at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115703

--- Comment #4 from Robin Dapp  ---
The problem appears to be

Fuse curr info since prev info compatible with it:
  prev_info: VALID (insn 438, bb 2)
Demand fields: demand_ge_sew demand_non_zero_avl
SEW=32, VLMUL=m1, RATIO=32, MAX_SEW=64
TAIL_POLICY=agnostic, MASK_POLICY=agnostic
AVL=(reg:DI 0 zero)
VL=(reg:DI 9 s1 [312])
  curr_info: VALID (insn 92, bb 20)
Demand fields: demand_ratio_and_ge_sew demand_avl
SEW=64, VLMUL=m1, RATIO=64, MAX_SEW=64
TAIL_POLICY=agnostic, MASK_POLICY=agnostic
AVL=(const_int 4 [0x4])
VL=(nil)
  prev_info after fused: VALID (insn 438, bb 2)
Demand fields: demand_ratio_and_ge_sew demand_avl
SEW=64, VLMUL=mf2, RATIO=64, MAX_SEW=64
TAIL_POLICY=agnostic, MASK_POLICY=agnostic
AVL=(const_int 4 [0x4])
VL=(nil)

where we fuse

vsetvl ...,e32,m1

and

vsetvl ...,e64,m1

to

vsetvl ...,e64,mf2

Testing a patch.

[Bug rtl-optimization/117506] [15 Regression] ICE: in decompose, at wide-int.h:1049 with -O3 -funroll-loops

2025-02-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117506

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

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

commit r15-7388-gbb9cee8928f7f4dfb94e7a8f232eda736b711450
Author: Jakub Jelinek 
Date:   Thu Feb 6 15:39:18 2025 +0100

loop-iv, riscv: Fix get_biv_step_1 for RISC-V [PR117506]

The following test ICEs on RISC-V at least latently since
r14-1622-g99bfdb072e67fa3fe294d86b4b2a9f686f8d9705 which added
RISC-V specific case to get_biv_step_1 to recognize also
({zero,sign}_extend:DI (plus:SI op0 op1))

The reason for the ICE is that op1 in this case is CONST_POLY_INT
which unlike the really expected VOIDmode CONST_INTs has its own
mode and still satisfies CONSTANT_P.
GET_MODE (rhs) (SImode) is different from outer_mode (DImode), so
the function later does
*inner_step = simplify_gen_binary (code, outer_mode,
   *inner_step, op1);
but that obviously ICEs because while *inner_step is either VOIDmode
or DImode, op1 has SImode.

The following patch fixes it by extending op1 using code so that
simplify_gen_binary can handle it.  Another option would be
to change the !CONSTANT_P (op1) 3 lines above this to
!CONST_INT_P (op1), I think it isn't very likely that we get something
useful from other constants there.

2025-02-06  Jakub Jelinek  

PR rtl-optimization/117506
* loop-iv.cc (get_biv_step_1): For {ZERO,SIGN}_EXTEND
of PLUS apply {ZERO,SIGN}_EXTEND to op1.

* gcc.dg/pr117506.c: New test.
* gcc.target/riscv/pr117506.c: New test.

[Bug rtl-optimization/117506] [15 Regression] ICE: in decompose, at wide-int.h:1049 with -O3 -funroll-loops

2025-02-06 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117506

Jakub Jelinek  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #7 from Jakub Jelinek  ---
Fixed.

[Bug c++/100570] g++ does not suppress bitfield conversion warning even isystem flag is set

2025-02-06 Thread fsmoke at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100570

--- Comment #3 from fsmoke  ---
Is any movement about this BUG?

[Bug c++/100570] g++ does not suppress bitfield conversion warning even isystem flag is set

2025-02-06 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100570

--- Comment #4 from Patrick Palka  ---
I can't reproduce this.

> g++ -c -x c++ test.cpp -I /usr/local/include/qt5 -I 
> /usr/local/include/qt5/QtCore -g2 -gdwarf-2 -Wall -Wswitch 
> -W"no-deprecated-declarations" -W"empty-body" -Wconversion -W"return-type" 
> -Wparentheses -W"no-format" -Wuninitialized -W"unreachable-code" 
> -W"unused-function" -W"unused-value" -W"unused-variable" -O0 
> -fno-strict-aliasing -fno-omit-frame-pointer -fpic -fthreadsafe-statics 
> -fexceptions -frtti -std=c++20 -isystem /usr/local/include/qt5

Don't you need to also mark .../qt5/QtCore as a system include directory via
-isystem /usr/local/include/qt5/QtCore?  I suspect that will suppress the
warning you're seeing.

[Bug c++/110345] [C++26] P2552R3 - On the ignorability of standard attributes

2025-02-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110345

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

https://gcc.gnu.org/g:7169ee08203878ba351eedf206df7ff43014d634

commit r15-7391-g7169ee08203878ba351eedf206df7ff43014d634
Author: Jakub Jelinek 
Date:   Thu Feb 6 18:32:32 2025 +0100

c++: Add nodiscard attribute further test coverage [PR110345]

Fairly non-problematic attribute.

2025-02-06  Jakub Jelinek  

PR c++/110345
* g++.dg/cpp0x/attr-nodiscard1.C: New test.

[Bug libfortran/114618] Format produces incorrect output when contains 1x, ok when uses " "

2025-02-06 Thread kargls at comcast dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114618

kargls at comcast dot net changed:

   What|Removed |Added

 CC||kargls at comcast dot net

--- Comment #10 from kargls at comcast dot net ---
(In reply to Jerry DeLisle from comment #9)
> I am thinking to backport this as it cleans up some output with garbage in
> it.
> 
> Any thoughts?

I've always gone with the mantra "It's up to the committer if
a backport should be done."  There is the corollary, "If it's
easy to do and doesn't break anything, then sure backport."

[Bug target/67771] integer-to-floating-point conversions wrongly produce -0 in FE_DOWNWARD mode

2025-02-06 Thread glaubitz at physik dot fu-berlin.de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67771

--- Comment #4 from John Paul Adrian Glaubitz  ---
This regression causes two testsuite failures in glibc on 32-bit PowerPC:

FAIL: math/test-float-log10
FAIL: math/test-float32-log10

See:
https://buildd.debian.org/status/fetch.php?pkg=glibc&arch=powerpc&ver=2.41-1&stamp=1738281295&raw=0

[Bug target/109780] [12/13/14/15 Regression] csmith: runtime crash with -O2 -march=znver1

2025-02-06 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109780

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #31 from Jakub Jelinek  ---
#c29 works since r15-571-g1e0ae1f52741f7e0133661659ed2d210f939a398

[Bug target/109780] [12/13/14/15 Regression] csmith: runtime crash with -O2 -march=znver1

2025-02-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109780

--- Comment #32 from Andrew Pinski  ---
(In reply to Jakub Jelinek from comment #31)
> #c29 works since r15-571-g1e0ae1f52741f7e0133661659ed2d210f939a398

That means it most likely went latent.

[Bug target/109780] [12/13/14/15 Regression] csmith: runtime crash with -O2 -march=znver1

2025-02-06 Thread ubizjak at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109780

--- Comment #35 from Uroš Bizjak  ---
(In reply to Uroš Bizjak from comment #34)
> The problematic code is expanded from:
> 
> ;; Generating RTL for gimple basic block 5
> 
> ;; __builtin_memset (&k, 0, 40);
> 
> (insn 21 20 22 (parallel [
> (set (reg:DI 107)
> (plus:DI (reg/f:DI 93 virtual-stack-vars)
> (const_int -48 [0xffd0])))
> (clobber (reg:CC 17 flags))
> ]) "pr109780.c":11:12 -1
>  (nil))

It is not a good idea to CSE address that refers to virtual stack vars to a
temporary. This defeats stack/frame pointer detection, mentioned in Comment
#33, and consequently fails to increase stack alignment.

[Bug fortran/108454] ICE in gfc_trans_common, at fortran/trans-common.cc:1385

2025-02-06 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108454

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
   Target Milestone|--- |14.3
 Resolution|--- |FIXED

--- Comment #8 from anlauf at gcc dot gnu.org ---
Fixed for gcc-15, and backported to 14-branch.  Closing.

The remaining symbol t / type(t) / class(t) issue is tracked in pr118709.

Thanks for the report!

[Bug target/118776] New: [15 regression] ICE when building xvid-1.3.7 with LTO (extract_insn, at recog.cc:2882)

2025-02-06 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118776

Bug ID: 118776
   Summary: [15 regression] ICE when building xvid-1.3.7 with LTO
(extract_insn, at recog.cc:2882)
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code, lto
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: sjames at gcc dot gnu.org
  Target Milestone: ---

```
# x86_64-pc-linux-gnu-gcc -m32 -mfpmath=sse -fuse-ld=bfd -Wl,-O1
-Wl,--as-needed @list -o /dev/null -shared -Wl,--version-script=libxvidcore.ld 
-std=gnu17 -fPIC -flto=jobserver -O2 -march=tigerlake
lto-wrapper: warning: jobserver is not available: ‘MAKEFLAGS’ environment
variable is unset
lto-wrapper: note: see the ‘-flto’ option documentation for more information
../../../src/decoder.c: In function ‘decoder_decode’:
../../../src/decoder.c:1789:1: error: unrecognizable insn:
 1789 | }
  | ^
(insn 2041 2040 2042 314 (set (reg:V32QI 597 [ _1171 ])
(vec_merge:V32QI (umax:V32QI (mem/c:V32QI (plus:SI (reg/f:SI 93
virtual-stack-vars)
(const_int -64 [0xffc0])) [0 MEM
 [(const uint8_t *)_2207 + 32B]+0 S32 A256])
(reg:V32QI 1585))
(reg:V32QI 1586)
(reg:SI 1584))) -1
 (nil))
during RTL pass: vregs
../../../src/decoder.c:1789:1: internal compiler error: in extract_insn, at
recog.cc:2882
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See  for instructions.
make: *** [/tmp/ccTiA1ax.mk:2: /tmp/ccSLExF5.ltrans0.ltrans.o] Error 1
lto-wrapper: fatal error: make returned 2 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/bin/ld.bfd:
error: lto-wrapper failed
```

---

```

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/15/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage.notmp/portage/sys-devel/gcc-15.0./work/gcc-15.0./configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/15
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/15/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/15
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/15/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/15/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15
--disable-silent-rules --disable-dependency-tracking
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/15/python
--enable-objc-gc --enable-languages=c,c++,d,go,objc,obj-c++,fortran,ada
--enable-obsolete --enable-secureplt --disable-werror --with-system-zlib
--enable-nls --without-included-gettext --disable-libunwind-exceptions
--enable-checking=yes,extra,rtl --with-bugurl=https://bugs.gentoo.org/
--with-pkgversion='Gentoo Hardened 15.0. p, commit
601d2479a8464e3bf1fb53065109a027db7c93f1' --with-gcc-major-version-only
--enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
--enable-multilib --with-multilib-list=m32,m64 --disable-fixed-point
--enable-targets=all --enable-offload-defaulted
--enable-offload-targets=nvptx-none --enable-libgomp --disable-libssp
--enable-libada --enable-cet --disable-systemtap --disable-valgrind-annotations
--disable-vtable-verify --disable-libvtv --with-zstd --with-isl
--disable-isl-version-check --enable-default-pie --enable-host-pie
--enable-host-bind-now --enable-default-ssp --disable-fixincludes
--with-build-config=bootstrap-cet
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.1 20250204 (experimental)
64c66f5bce60fcc4a943bcac1865db2a72aaa1bd (Gentoo Hardened 15.0. p, commit
601d2479a8464e3bf1fb53065109a027db7c93f1)
```

[Bug target/118241] RISC-V ICE: internal compiler error: in int_mode_for_mode, at stor-layout.cc:407 caused by prefetch instructions

2025-02-06 Thread law at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118241

--- Comment #5 from Jeffrey A. Law  ---
There's 3 patches all in this same area that we're still sorting through.

[Bug fortran/118750] [14/15 Regression] ICE on associate with elemental function with polymorphic array dummy argument

2025-02-06 Thread damian at archaeologic dot codes via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118750

--- Comment #2 from Damian Rouson  ---
Comment on attachment 60396
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60396
Fix for the PR

Thanks, Paul!

[Bug target/118772] New: BPF doesn't actually support effective-target 'exceptions'?

2025-02-06 Thread tschwinge at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118772

Bug ID: 118772
   Summary: BPF doesn't actually support effective-target
'exceptions'?
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: tschwinge at gcc dot gnu.org
CC: jemarch at gcc dot gnu.org
  Target Milestone: ---
Target: BPF

Working on GCN, nvptx targets, I find that a few GCC test cases are incorrectly
tagged as requiring effective-target 'nonlocal_goto', when in fact they should
require effective-target 'exceptions', and I'd like to fix this up in the
affected test cases.  However: while BPF currently isn't effective-target
'nonlocal_goto' (correct, per my understanding), but it claims to support
effective-target 'exceptions' (wrong, per my understanding).  (For example, "In
eBPF it is not possible to unwind frames." comments in 'gcc/config/bpf/bpf.h',
'gcc/config/bpf/bpf.cc'.)  If you ACK, to avoid regressing the to-be-fixed test
cases for BPF, I'll add '[istarget bpf-*-*]' to the 'return 0' branch in
'gcc/testsuite/lib/target-supports.exp:check_effective_target_exceptions'. 
(Likewise for nvptx...)

[Bug tree-optimization/107919] Possibly false-positive "maybe-uninitialized" with GCC 12 on complex variant-variant-tuple-unique_ptr types

2025-02-06 Thread rogerio.souza at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107919

--- Comment #13 from Rogério de Souza Moraes  
---
I have backported the patches, but it seems that they are not enough to fix
this issue on 12.4.
If you want I could attach them to this bugzilla.

[Bug target/112853] RISC-V: RVV: SPEC2017 525.x264 regression

2025-02-06 Thread rdapp at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112853

Robin Dapp  changed:

   What|Removed |Added

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

--- Comment #11 from Robin Dapp  ---
This is stale, and all the old issues are fixed, closing.

[Bug tree-optimization/118521] [15 regression] std::vector Wstringop-overflow false positive since r15-4473

2025-02-06 Thread law at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118521

Jeffrey A. Law  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug preprocessor/106767] Failure to detect recursive macro calls due to _Pragma(pop_macro)

2025-02-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106767

Andrew Pinski  changed:

   What|Removed |Added

 CC||ymity.me at gmail dot com

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

[Bug libfortran/118774] New: Tab skips miscalculated with 'stream' write

2025-02-06 Thread jvdelisle at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118774

Bug ID: 118774
   Summary: Tab skips miscalculated with 'stream' write
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libfortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jvdelisle at gcc dot gnu.org
  Target Milestone: ---

This test case found during review of patch for PR114618.

program z3
   implicit none
   integer, parameter :: wp = kind(0d0)
   real(kind=wp) :: pi  = 3.14159265358979323846264338_wp
   character(len=*), parameter:: fmt1 = '(19("."),t1,g0,1x,t21,g0)'
   character(len=*), parameter:: fmt2 = '(19("."),t1,g0," ",t21,g0)'
   character(21) :: output1, output2

   write (*, fmt1) 'RADIX', radix(pi)
   write (*, fmt2) 'RADIX', radix(pi)
   open (10, form="formatted")
   write(10, fmt1) 'RADIX', radix(pi)
   write(10, fmt2) 'RADIX', radix(pi)
   close(10)
   open (11, form="formatted", access="stream")
   write(11, fmt1) 'RADIX', radix(pi)
   write(11, fmt2) 'RADIX', radix(pi)
   close(11)
end program z3

Output:

% head fort.10 fort.11
==> fort.10 <==
RADIX.. 2
RADIX . 2

==> fort.11 <==
RADIX 2
RADIX  2...

[Bug preprocessor/118770] Random Segmentation fault in preprocessor from _Pragma push pop within _Pragma

2025-02-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118770

Andrew Pinski  changed:

   What|Removed |Added

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

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

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

[Bug libfortran/118774] Tab skips miscalculated with 'stream' write

2025-02-06 Thread jvdelisle at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118774

Jerry DeLisle  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |jvdelisle at gcc dot 
gnu.org
   Last reconfirmed||2025-02-06

[Bug c/118769] Provide better location information for diagnostics with -Wattributes

2025-02-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118769

Andrew Pinski  changed:

   What|Removed |Added

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

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

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

[Bug c++/102647] Wrong caret location for 'attribute directive ignored' warning

2025-02-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102647

Andrew Pinski  changed:

   What|Removed |Added

 CC||gjl at gcc dot gnu.org

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

[Bug target/118764] [avr] Add support for Compact Vector Table

2025-02-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118764

--- Comment #1 from GCC Commits  ---
The master branch has been updated by Georg-Johann Lay :

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

commit r15-7390-gcb27337f9f4956e6eb634b26a7999ea68063f58a
Author: Georg-Johann Lay 
Date:   Thu Feb 6 11:28:28 2025 +0100

AVR: Add support for a Compact Vector Table (-mcvt).

Some AVR devices support a CVT:

-  Devices from the 0-series, 1-series, 2-series.
-  AVR16, AVR32, AVR64, AVR128 devices.

The support is provided by means of a startup code file
crt-cvt.o from AVR-LibC v2.3 that can be linked instead
of the traditional crt.o.

This patch adds a new command line option -mcvt that links
that CVT startup code (or issues an error when the device
doesn't support a CVT).

PR target/118764
gcc/
* config/avr/avr.opt (-mcvt): New target option.
* config/avr/avr-arch.h (AVR_CVT): New enum value.
* config/avr/avr-mcus.def: Add AVR_CVT flag for devices that
support it.
* config/avr/avr.cc (avr_handle_isr_attribute) [TARGET_CVT]: Issue
an error when a vector number larger that 3 is used.
* config/avr/gen-avr-mmcu-specs.cc (McuInfo.have_cvt): New
property.
(print_mcu) <*avrlibc_startfile>: Use crt-cvt.o depending
on -mcvt (or issue an error when the device doesn't support a CVT).
* doc/invoke.texi (AVR Options): Document -mcvt.

[Bug target/118764] [avr] Add support for Compact Vector Table

2025-02-06 Thread gjl at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118764

Georg-Johann Lay  changed:

   What|Removed |Added

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

--- Comment #2 from Georg-Johann Lay  ---
Added in v15.

[Bug target/118771] [15 regression] aarch64 bootstrap fails with --enabled-checking=release because of uninitialized warning

2025-02-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118771

Andrew Pinski  changed:

   What|Removed |Added

Summary|[15 regression] aarch64 |[15 regression] aarch64
   |bootstrap fails unless  |bootstrap fails with
   |--disable-werror|--enabled-checking=release
   ||because of uninitialized
   ||warning
 Blocks||24639
   Keywords||build, diagnostic
   Target Milestone|--- |15.0


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24639
[Bug 24639] [meta-bug] bug to track all Wuninitialized issues

[Bug c++/118775] [12/13/14/15 Regression] ICE in tree_to_uhwi with unique_ptr and addresss of var converted to an integer

2025-02-06 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118775

Marek Polacek  changed:

   What|Removed |Added

   Keywords|needs-reduction |

--- Comment #2 from Marek Polacek  ---
namespace std {
struct __uniq_ptr_impl {
  constexpr __uniq_ptr_impl(char *) {}
};
template  struct unique_ptr {
  __uniq_ptr_impl _M_t;
  constexpr ~unique_ptr() {}
};
template  struct _MakeUniq;
template  struct _MakeUniq<_Tp[]> {
  typedef unique_ptr<_Tp[]> __array;
};
template  using __unique_ptr_array_t = _MakeUniq<_Tp>::__array;
constexpr __unique_ptr_array_t make_unique(long __num) {
  return unique_ptr(new char[__num]);
}
} // namespace std
int a;
int main() { std::unique_ptr p = std::make_unique((long)&a); }

[Bug target/118778] New: ICE: SIGSEGV in print_type (c-objc-common.cc:239) OR unrecognizable insn: (set (reg:SF ...) (mem/c:SF ...)) with -mgeneral-regs-only and "float"

2025-02-06 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118778

Bug ID: 118778
   Summary: ICE: SIGSEGV in print_type (c-objc-common.cc:239) OR
unrecognizable insn: (set (reg:SF ...) (mem/c:SF ...))
with -mgeneral-regs-only and "float"
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: armv7a-hardfloat-linux-gnueabi

Created attachment 60408
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60408&action=edit
reduced testcase

Compiler output:
$ armv7a-hardfloat-linux-gnueabi-gcc -mgeneral-regs-only testcase.i -wrapper
valgrind,-q
==32066== Invalid read of size 2
==32066==at 0xB690D4: print_type(c_pretty_printer*, tree_node*, bool*, char
const*) (c-objc-common.cc:239)
==32066==by 0xB69501: c_tree_printer(pretty_printer*, text_info*, char
const*, int, bool, bool, bool, bool*, pp_token_list&) (c-objc-common.cc:363)
==32066==by 0x23B7C06: format_phase_2 (pretty-print.cc:2158)
==32066==by 0x23B7C06: pretty_printer::format(text_info&)
(pretty-print.cc:1711)
==32066==by 0x237FB9D: pp_format (pretty-print.h:594)
==32066==by 0x237FB9D:
diagnostic_context::report_diagnostic(diagnostic_info*) (diagnostic.cc:1478)
==32066==by 0x237FEED: diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t) (diagnostic.cc:1614)
==32066==by 0x2394B21: error(char const*, ...)
(diagnostic-global-context.cc:397)
==32066==by 0x16C3B61: aapcs_vfp_is_call_or_return_candidate(arm_pcs,
machine_mode, tree_node const*, machine_mode*, int*) (arm.cc:6724)
==32066==by 0x16B4277: aapcs_select_call_coproc (arm.cc:6932)
==32066==by 0x16B4277: aapcs_layout_arg(CUMULATIVE_ARGS*, machine_mode,
tree_node const*, bool) [clone .part.0] [clone .constprop.0] (arm.cc:7062)
==32066==by 0x16B9975: aapcs_layout_arg (arm.cc:7056)
==32066==by 0x16B9975: arm_function_arg(cumulative_args_t,
function_arg_info const&) (arm.cc:7304)
==32066==by 0xCA1C82: emit_library_call_value_1(int, rtx_def*, rtx_def*,
libcall_type, machine_mode, int, std::pair*)
(calls.cc:4407)
==32066==by 0x10E69CC: emit_library_call_value (rtl.h:4439)
==32066==by 0x10E69CC: prepare_float_lib_cmp (optabs.cc:4955)
==32066==by 0x10E69CC: prepare_cmp_insn(rtx_def*, rtx_def*, rtx_code,
rtx_def*, int, optab_methods, rtx_def**, machine_mode*) (optabs.cc:4588)
==32066==by 0x10E71C2: emit_cmp_and_jump_insns(rtx_def*, rtx_def*,
rtx_code, rtx_def*, machine_mode, int, tree_node*, rtx_def*,
profile_probability) (optabs.cc:4812)
==32066==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32066== 

during RTL pass: expand
In function 'foo':
Segmentation fault
2 | int foo() { return f < 0; }
  |~~^~~
0x2395361 internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic-global-context.cc:517
..

Or, when foo() is commented-out:
$ armv7a-hardfloat-linux-gnueabi-gcc -mgeneral-regs-only testcase.i
testcase.i: In function 'bar':
testcase.i:3:21: error: unrecognizable insn:
3 | void bar() { f < 0; }
  | ^
(insn 6 5 0 2 (set (reg:SF 114 [ f.0_1 ])
(mem/c:SF (reg/f:SI 115) [1 f+0 S4 A32])) "testcase.i":3:16 -1
 (nil))
during RTL pass: vregs
testcase.i:3:21: internal compiler error: in extract_insn, at recog.cc:2882
0x2395361 internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic-global-context.cc:517
0xaf9d37 fancy_abort(char const*, int, char const*)
/repo/gcc-trunk/gcc/diagnostic.cc:1722
0x7cdc56 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/repo/gcc-trunk/gcc/rtl-error.cc:108
0x7cdcd3 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
/repo/gcc-trunk/gcc/rtl-error.cc:116
0x7be8c6 extract_insn(rtx_insn*)
/repo/gcc-trunk/gcc/recog.cc:2882
0xe6f4ef instantiate_virtual_regs_in_insn
/repo/gcc-trunk/gcc/function.cc:1612
0xe6f4ef instantiate_virtual_regs
/repo/gcc-trunk/gcc/function.cc:1995
0xe6f4ef execute
/repo/gcc-trunk/gcc/function.cc:2042
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.

$ armv7a-hardfloat-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-armv7a-hardfloat/bin/armv7a-hardfloat-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-20250131094006-r15-7305-gdecc6c0d4d909c-checking-yes-rtl-df-extra-armv7a-hardfloat/bin/../libexec/gcc/armv7a-hardfloat-linux-gnueabi/15.0.1/lto-wrapper
Target: armv7a-hardfloat-linux-gnueabi

[Bug jit/117047] [15 regression] Segfault in libgccjit garbage collection when compiling GNU Emacs with Native Compilation

2025-02-06 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117047

--- Comment #6 from Sam James  ---
I'll try get back to bisecting this in the week. It's hard to reproduce in some
environments.

richi/jakub: can we make this P1 for now? it doesn't have to really block the
release if it comes down to it, but I'd like to make sure we don't forget about
it, and the functionality broken here is really popular with users.

[Bug target/118771] [15 regression] aarch64 bootstrap fails with --enabled-checking=release because of uninitialized warning

2025-02-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118771

Andrew Pinski  changed:

   What|Removed |Added

URL||https://gcc.gnu.org/piperma
   ||il/gcc-patches/2025-Februar
   ||y/675258.html
   Keywords||patch

--- Comment #3 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #2)
> I am deciding between adding:
> ```
> gcc_assert (npieces > 0);
> ```
> or
> ```
> if (npieces <= 0)
>   gcc_unreachable();
> ```
> 
> to aarch64_split_move .

I went with gcc_assert in the end:
https://gcc.gnu.org/pipermail/gcc-patches/2025-February/675258.html

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

2025-02-06 Thread liuhongt at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117081

--- Comment #16 from Hongtao Liu  ---
(In reply to H.J. Lu from comment #15)
> r15-7400-gd3ff498c478ace gave
> 
> $ cat x.c
> int f (int);
> int
> advance (int dz)
> {
>   if (dz > 0)
> return (dz + dz) * dz;
>   else
> return dz * f (dz);
> }
> [hjl@gnu-tgl-3 pr111673]$ make x.o
> /export/build/gnu/tools-build/gcc-gitlab-debug/build-x86_64-linux/gcc/xgcc
> -B/export/build/gnu/tools-build/gcc-gitlab-debug/build-x86_64-linux/gcc/ -O2
> -c -o x.o x.c
> $ objdump -dw x.o
> 
> x.o: file format elf64-x86-64
> 
> 
> Disassembly of section .text:
> 
>  :
>0: 85 ff   test   %edi,%edi
>2: 7e 0c   jle10 
>4: 0f af ffimul   %edi,%edi
>7: 8d 04 3flea(%rdi,%rdi,1),%eax
>a: c3  ret
>b: 0f 1f 44 00 00  nopl   0x0(%rax,%rax,1)
>   10: 53  push   %rbx
>   11: 89 fb   mov%edi,%ebx
>   13: e8 00 00 00 00  call   18 
>   18: 0f af c3imul   %ebx,%eax
>   1b: 5b  pop%rbx
>   1c: c3  ret
> $ 
> 
> Does it look OK?

It looks reasonable.

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

2025-02-06 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117081

--- Comment #15 from H.J. Lu  ---
r15-7400-gd3ff498c478ace gave

$ cat x.c
int f (int);
int
advance (int dz)
{
  if (dz > 0)
return (dz + dz) * dz;
  else
return dz * f (dz);
}
[hjl@gnu-tgl-3 pr111673]$ make x.o
/export/build/gnu/tools-build/gcc-gitlab-debug/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/tools-build/gcc-gitlab-debug/build-x86_64-linux/gcc/ -O2  
-c -o x.o x.c
$ objdump -dw x.o

x.o: file format elf64-x86-64


Disassembly of section .text:

 :
   0:   85 ff   test   %edi,%edi
   2:   7e 0c   jle10 
   4:   0f af ffimul   %edi,%edi
   7:   8d 04 3flea(%rdi,%rdi,1),%eax
   a:   c3  ret
   b:   0f 1f 44 00 00  nopl   0x0(%rax,%rax,1)
  10:   53  push   %rbx
  11:   89 fb   mov%edi,%ebx
  13:   e8 00 00 00 00  call   18 
  18:   0f af c3imul   %ebx,%eax
  1b:   5b  pop%rbx
  1c:   c3  ret
$ 

Does it look OK?

[Bug target/118601] [15] RISC-V: unrecognizable insn ICE in xtheadvector/pr114194.c on 32bit targets

2025-02-06 Thread majin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118601

Jin Ma  changed:

   What|Removed |Added

   Last reconfirmed||2025-02-07
 Status|UNCONFIRMED |ASSIGNED
 Ever confirmed|0   |1

[Bug tree-optimization/118706] [15 Regression] ICE on valid code at -O1 and above with "-fno-tree-fre" on x86_64-linux-gnu: in make_bit_field_load, at gimple-fold.cc:7862 since r15-7171

2025-02-06 Thread aoliva at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118706

Alexandre Oliva  changed:

   What|Removed |Added

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

--- Comment #5 from Alexandre Oliva  ---
Mine

[Bug target/118776] [12/13/14/15 regression] ICE when building xvid-1.3.7 with LTO (extract_insn, at recog.cc:2882)

2025-02-06 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118776

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
   Target Milestone|14.3|12.5

[Bug target/118776] [15 regression] ICE when building xvid-1.3.7 with LTO (extract_insn, at recog.cc:2882)

2025-02-06 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118776

--- Comment #6 from Sam James  ---
Not killed LTO yet.

bitstream.i:
```
typedef struct {
  int quant_type;
  short *mpeg_quant_matrices
} DECODER;
char BitstreamReadHeaders_matrix[];
void set_intra_matrix();
void BitstreamReadHeaders(struct length *bs, DECODER *dec) {
  while (bs)
if (dec->quant_type)
  set_intra_matrix(dec->mpeg_quant_matrices, BitstreamReadHeaders_matrix);
}

int set_intra_matrix_i;
void set_intra_matrix(short *mpeg_quant_matrices, char *matrix) {
  short *intra_matrix = mpeg_quant_matrices;
  set_intra_matrix_i = 0;
  for (; set_intra_matrix_i < 64; set_intra_matrix_i++)
intra_matrix[set_intra_matrix_i] = !set_intra_matrix_i ? 8 : 1 >
matrix[set_intra_matrix_i] ?: matrix[set_intra_matrix_i];
}
```

decoder.i:
```
void BitstreamReadHeaders();
__attribute__((visibility("default")))
void decoder_decode() { BitstreamReadHeaders(); }
```

[Bug target/118776] [15 regression] ICE when building xvid-1.3.7 with LTO (extract_insn, at recog.cc:2882)

2025-02-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118776

--- Comment #7 from Andrew Pinski  ---
Created attachment 60406
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60406&action=edit
testcase without LTO

`-O2 -march=tigerlake` is enough

[Bug c++/118775] [12/13/14/15 Regression] ICE in tree_to_uhwi with unique_ptr and addresss of var converted to an integer

2025-02-06 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118775

--- Comment #3 from Marek Polacek  ---
I suppose we need something like

--- a/gcc/cp/constexpr.cc
+++ b/gcc/cp/constexpr.cc
@@ -2909,6 +2909,11 @@ cxx_eval_call_expression (const constexpr_ctx *ctx, tree
t,
  gcc_assert (arg0);
  if (new_op_p)
{
+ if (!tree_fits_uhwi_p (arg0))
+   {
+ *non_constant_p = true;
+ return t;
+   }
  tree type = build_array_type_nelts (char_type_node,
  tree_to_uhwi (arg0));
  tree var = build_decl (loc, VAR_DECL,


except perhaps with an error message.

[Bug c++/118775] [12/13/14/15 Regression] ICE in tree_to_uhwi with unique_ptr and addresss of var converted to an integer

2025-02-06 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118775

Marek Polacek  changed:

   What|Removed |Added

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

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

2025-02-06 Thread liuhongt at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117081

--- Comment #14 from Hongtao Liu  ---

> can be sinked to else branch(as sub + mov). When jle .L2 is not taken,
> it can save one push instruction. And that's why 511.povray_r is improved.
plus one pop instruction.

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

2025-02-06 Thread liuhongt at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117081

--- Comment #13 from Hongtao Liu  ---
(In reply to H.J. Lu from comment #10)
> (In reply to Hongtao Liu from comment #9)
> > (In reply to Hongtao Liu from comment #8)
> > > (In reply to H.J. Lu from comment #7)
> > > > Created attachment 60350 [details]
> > > > ira: Don't increase callee-saved register cost by 1000x
> > > 
> > > NOTE, r15-1619-g3b9b8d6cfdf593 improved 500.perlbench_r on many different
> > > platforms, let me help verify the patch with SPEC2017.
> > 
> > There're 5% regression on alderlake for 511.povray_r.
> > With the patch, there're more PUSH/POPs for callee saved registers.(Those
> > PUSH/POPs  have been eliminated by  r15-1619-g3b9b8d6cfdf593)
> 
> We need testcases to show that.  Without them, we can't be sure that the
> improvement won't go away.
I think the testcase in PR111673 demonstrates it

int f(int);

int advance(int dz)
{
if (dz > 0)
return (dz + dz) * dz;
else
return dz * f(dz);
}


Before r15-1619-g3b9b8d6cfdf593

advance(int):
pushrbx
mov ebx, edi
testedi, edi
jle .L2
imulebx, edi
lea eax, [rbx+rbx]
pop rbx
ret
.L2:
callf(int)
imuleax, ebx
pop rbx
ret

After

 advance(int):
testedi, edi
jle .L2
imuledi, edi
lea eax, [rdi+rdi]
ret
.L2:
sub rsp, 24
mov DWORD PTR [rsp+12], edi
callf(int)
imuleax, DWORD PTR [rsp+12]
add rsp, 24
ret

Unlike testcase in #c6(call in both if and else branch), there's no call in if
branch, it's not optimal to push  rbx at the entry of the function, it can be
sinked to else branch(as sub + mov). When jle .L2 is not taken, it can save
one push instruction. And that's why 511.povray_r is improved.

[Bug fortran/59252] [F03] wrong code generation for allocatable character component

2025-02-06 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59252

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

 CC||anlauf at gcc dot gnu.org

--- Comment #6 from anlauf at gcc dot gnu.org ---
Created attachment 60404
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60404&action=edit
Another draft patch

This tentative patch does the initialization of allocatable components with
NULL, unless it is a character component of deferred length.

  1   2   >