[Bug target/120070] [15/16 regression] m68k-linux-gnu-gcc -Os ICE segfault compiling xfs_trans_ail.c

2025-05-03 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120070

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
This is
(insn 15 14 82 4 (parallel [
(set (reg:DI 48 [ _38 ])
(minus:DI (subreg:DI (reg:SI 32 [ _2 ]) 0)
(subreg:DI (reg:SI 50 [ _35 ]) 0)))
(clobber (scratch:SI))
]) "pr120070.c":11:36 175 {subdi3}
 (expr_list:REG_DEAD (reg:SI 50 [ _35 ])
(nil)))
during IRA, but reload turns that into
(insn 15 98 99 4 (parallel [
(set (reg:DI 6 %d6)
(minus:DI (reg:DI 6 %d6)
(reg:DI -1 [+-4 ])))
(clobber (scratch:SI))
]) "pr120070.c":11:36 175 {subdi3}
 (nil))
which is invalid, there is no register -1.
Compiles fine with -Os -mlra.
Don't know if anybody will spend time on reload when it is going to be removed
in GCC 16.

[Bug target/120070] [15/16 regression] m68k-linux-gnu-gcc -Os ICE segfault compiling xfs_trans_ail.c

2025-05-03 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120070

Jakub Jelinek  changed:

   What|Removed |Added

 CC||law at gcc dot gnu.org,
   ||schwab at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek  ---
-fno-ext-dce also works.
Before ext-dce we have:
(insn 12 11 13 4 (parallel [
(set (reg:DI 49 [ _34 ])
(sign_extend:DI (reg:SI 32 [ _2 ])))
(clobber (scratch:SI))
]) "pr120070.c":11:10 93 {extendsidi2}
 (nil))
(insn 13 12 14 4 (set (reg:SI 50 [ _35 ])
(ashift:SI (reg:SI 44 [ xlog_lsn_sub_low.3_32 ])
(const_int 9 [0x9]))) "pr120070.c":11:56 311 {ashlsi3}
 (expr_list:REG_DEAD (reg:SI 44 [ xlog_lsn_sub_low.3_32 ])
(nil)))
(insn 14 13 15 4 (parallel [
(set (reg:DI 51 [ _36 ])
(sign_extend:DI (reg:SI 50 [ _35 ])))
(clobber (scratch:SI))
]) "pr120070.c":11:56 93 {extendsidi2}
 (expr_list:REG_DEAD (reg:SI 50 [ _35 ])
(nil)))
(insn 15 14 68 4 (parallel [
(set (reg:DI 48 [ _38 ])
(minus:DI (reg:DI 49 [ _34 ])
(reg:DI 51 [ _36 ])))
(clobber (scratch:SI))
]) "pr120070.c":11:36 175 {subdi3}
 (expr_list:REG_DEAD (reg:DI 51 [ _36 ])
(expr_list:REG_DEAD (reg:DI 49 [ _34 ])
(nil
...
(insn 18 17 19 6 (set (reg:SI 35 [ _6 ])
(minus:SI (reg:SI 32 [ _2 ])
(subreg:SI (reg:DI 48 [ _38 ]) 4))) "pr120070.c":17:36 discrim 1
176 {subsi3}
 (expr_list:REG_DEAD (reg:DI 48 [ _38 ])
(expr_list:REG_DEAD (reg:SI 32 [ _2 ])
(nil
which is the only use of DI 48, so we actually only care about the low 32 bits
of the subtraction.
ext-dce figures out the upper bits aren't needed and uses paradoxical subregs
instead of the sign extensions:
(insn 12 11 13 4 (set (reg:DI 49 [ _34 ])
(subreg:DI (reg:SI 32 [ _2 ]) 0)) "pr120070.c":11:10 76 {*m68k.md:1609}
 (nil))
(insn 13 12 14 4 (set (reg:SI 50 [ _35 ])
(ashift:SI (reg:SI 44 [ xlog_lsn_sub_low.3_32 ])
(const_int 9 [0x9]))) "pr120070.c":11:56 311 {ashlsi3}
 (expr_list:REG_DEAD (reg:SI 44 [ xlog_lsn_sub_low.3_32 ])
(nil)))
(insn 14 13 15 4 (set (reg:DI 51 [ _36 ])
(subreg:DI (reg:SI 50 [ _35 ]) 0)) "pr120070.c":11:56 76
{*m68k.md:1609}
 (expr_list:REG_DEAD (reg:SI 50 [ _35 ])
(nil)))
(insn 15 14 68 4 (parallel [
(set (reg:DI 48 [ _38 ])
(minus:DI (reg:DI 49 [ _34 ])
(reg:DI 51 [ _36 ])))
(clobber (scratch:SI))
]) "pr120070.c":11:36 175 {subdi3}
 (expr_list:REG_DEAD (reg:DI 51 [ _36 ])
(expr_list:REG_DEAD (reg:DI 49 [ _34 ])
(nil
Combine then propagates those.  Reload decides then to put
(reg:SI 32 [ _2 ]) into (reg:SI %d1) and (reg:SI 50 [ _35 ]) into (reg:SI %d0)
and
then uses (reg:DI %d0) for the first paradoxical subreg and (reg:DI -1) for the
second.

[Bug target/120050] [15/16 Regression] ICE bootstrapping on mips64el with --with-arch=gs464 --with-build-config=bootstrap-O3 --enable-checking=yes,extra

2025-05-03 Thread xry111 at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120050

--- Comment #4 from Xi Ruoyao  ---
As a hack I disabled ext-dce for MIPS by default:

diff --git a/gcc/config/mips/mips.cc b/gcc/config/mips/mips.cc
index 24a28dcf817..cf4784c48bb 100644
--- a/gcc/config/mips/mips.cc
+++ b/gcc/config/mips/mips.cc
@@ -20993,6 +20993,10 @@ mips_option_override (void)
 REAL_MODE_FORMAT (SFmode) = &spu_single_format;

   mips_register_frame_header_opt ();
+
+  /* FIXME: PR120050 */
+  if (!OPTION_SET_P (flag_ext_dce))
+flag_ext_dce = 0;
 }

 /* Swap the register information for registers I and I + 1, which

And then 15.1.0 bootstraps fine.

[Bug tree-optimization/120074] [15/16 regression] ICE on valid code at -O1 with "-fno-tree-copy-prop -fno-tree-forwprop -fno-tree-ccp" on x86_64-linux-gnu: in decompose, at wide-int.h:1049 since r15-6

2025-05-03 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120074

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2025-05-03
 CC||jakub at gcc dot gnu.org
Summary|[15/16 regression] ICE on   |[15/16 regression] ICE on
   |valid code at -O1 with  |valid code at -O1 with
   |"-fno-tree-copy-prop|"-fno-tree-copy-prop
   |-fno-tree-forwprop  |-fno-tree-forwprop
   |-fno-tree-ccp" on   |-fno-tree-ccp" on
   |x86_64-linux-gnu: in|x86_64-linux-gnu: in
   |decompose, at   |decompose, at
   |wide-int.h:1049 |wide-int.h:1049 since
   ||r15-6866
   Keywords|needs-bisection |
 Ever confirmed|0   |1

--- Comment #3 from Jakub Jelinek  ---
Started with r15-6866-g52e4ede030979d8aff2f88364e1d11c61fb212aa

[Bug tree-optimization/120080] New: [16 regression] ICE when building llvm-20.1.3 (find_bit_tests, at tree-switch-conversion.cc:1799)

2025-05-03 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120080

Bug ID: 120080
   Summary: [16 regression] ICE when building llvm-20.1.3
(find_bit_tests, at tree-switch-conversion.cc:1799)
   Product: gcc
   Version: 16.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: sjames at gcc dot gnu.org
  Target Milestone: ---

Created attachment 61279
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61279&action=edit
NVPTXInstPrinter.cpp.ii.xz

```
FAILED: [code=1]
lib/Target/NVPTX/MCTargetDesc/CMakeFiles/LLVMNVPTXDesc.dir/NVPTXInstPrinter.cpp.o
   
   /usr/bin/x86_64-pc-linux-gnu-g++ -m32 -mfpmath=sse -DLLVM_EXPORTS
-D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_LARGEFILE_SOURCE
-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
-I/var/tmp/portage.notmp/portage/llvm-core/llvm-20.1.3/work/llvm_build-abi_x86_32.x86/lib/Target/NVPTX/MCTargetDesc
-I/var/tmp/portage.notmp/portage/llvm-core/llvm-20.1.3/work/llvm/lib/Target/NVPTX/MCTargetDesc
-I/var/tmp/portage.notmp/portage/llvm-core/llvm-20.1.3/work/llvm/lib/Target/NVPTX
-I/var/tmp/portage.notmp/portage/llvm-core/llvm-20.1.3/work/llvm_build-abi_x86_32.x86/lib/Target/NVPTX
-I/var/tmp/portage.notmp/portage/llvm-core/llvm-20.1.3/work/llvm_build-abi_x86_32.x86/include
-I/var/tmp/portage.notmp/portage/llvm-core/llvm-20.1.3/work/llvm/include 
-DNDEBUG -O3 -march=native -mtls-dialect=gnu2 -fno-semantic-interposition -g1
-pipe -fcf-protection=none -fdiagnostics-color=always -fdiagnostics-urls=never
-frecord-gcc-switches -fdiagnostics-details
-fdiagnostics-set-output=text:experimental-nesting=yes -Wa,-O2
-Wa,-mtune=znver2 -Warray-bounds --param=ggc-min-expand=120 -Wstrict-aliasing
-Wfree-nonheap-object -Wuninitialized -Wmaybe-uninitialized -Wreturn-type
-fno-lto -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden
-Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter
-Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic
-Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull
-Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move
-Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment
-Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color
-ffunction-sections -fdata-sections -std=c++17 -fvisibility=hidden
-fdiagnostics-color=always -MD -MT
lib/Target/NVPTX/MCTargetDesc/CMakeFiles/LLVMNVPTXDesc.dir/NVPTXInstPrinter.cpp.o
-MF
lib/Target/NVPTX/MCTargetDesc/CMakeFiles/LLVMNVPTXDesc.dir/NVPTXInstPrinter.cpp.o.d
-o
lib/Target/NVPTX/MCTargetDesc/CMakeFiles/LLVMNVPTXDesc.dir/NVPTXInstPrinter.cpp.o
-c
/var/tmp/portage.notmp/portage/llvm-core/llvm-20.1.3/work/llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXInstPrinter.cpp
   
   during GIMPLE pass: switchlower 
   

/var/tmp/portage.notmp/portage/llvm-core/llvm-20.1.3/work/llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXInstPrinter.cpp:
In member function ‘void llvm::NVPTXInstPrinter::printLdStCode(const
llvm::MCInst*, int, llvm::raw_ostream&, const char*)’:
/var/tmp/portage.notmp/portage/llvm-core/llvm-20.1.3/work/llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXInstPrinter.cpp:231:6:
internal compiler error: in find_bit_tests, at tree-switch-conversion.cc:1799
  231 | void NVPTXInstPrinter::printLdStCode(const MCInst *MI, int OpNum,  
   
|  ^~~~
0x5f7069a50263 internal_error(char const*, ...)
   
/usr/src/debug/sys-devel/gcc-16.0./gcc-16.0./gcc/diagnostic-global-context.cc:517
0x5f7069a31b58 fancy_abort(char const*, int, char const*)
   
/usr/src/debug/sys-devel/gcc-16.0./gcc-16.0./gcc/diagnostic.cc:1748
0x5f706881531f
tree_switch_conversion::bit_test_cluster::find_bit_tests(vec&, int)
   
/usr/src/debug/sys-devel/gcc-16.0./gcc-16.0./gcc/tree-switch-conversion.cc:1799
0x5f706881531f
tree_switch_conversion::bit_test_cluster::find_bit_tests(vec&, int)
   
/usr/src/debug/sys-devel/gcc-16.0./gcc-16.0./gcc/tree-switch-conversion.cc:1781
0x5f706a37b05c
tree_switch_conversion::switch_decision_tree::analyze_switch_statement()
   
/usr/src/debug/sys-devel/gcc-16.0./gcc-16.0./gcc/tree-switch-conversion.cc:2261
0x5f706a120fb7 execute
   
/usr/src/debug/sys-devel/gcc-16.0./gcc-16.0./gcc/tree-switch-conversion.cc:3060
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtra

[Bug tree-optimization/120080] [16 regression] ICE when building llvm-20.1.3 (find_bit_tests, at tree-switch-conversion.cc:1799)

2025-05-03 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120080

Sam James  changed:

   What|Removed |Added

   Target Milestone|--- |16.0
 CC||pheeck at gcc dot gnu.org

--- Comment #1 from Sam James  ---
Just `g++ -c NVPTXInstPrinter.cpp.ii -m32 -O2` is enough.

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

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

--- Comment #447 from John Paul Adrian Glaubitz  ---
(In reply to pietro from comment #446)
> FYI, there's talk of forcing all GCC targets to use LRA for the next release:
> 
> https://gcc.gnu.org/pipermail/gcc-patches/2025-May/682470.html
> https://gcc.gnu.org/pipermail/gcc-patches/2025-May/682477.html

Oleg's GCC tree contains a working LRA conversion, see:

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

This tree with the patches 59432 and 59550 has gotten me the best results so
far.

[Bug rtl-optimization/120064] [15/16 Regression] -f[no-]ext-dce not documented

2025-05-03 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120064

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug tree-optimization/120074] [15/16 regression] ICE on valid code at -O1 with "-fno-tree-copy-prop -fno-tree-forwprop -fno-tree-ccp" on x86_64-linux-gnu: in decompose, at wide-int.h:1049 since r15-6

2025-05-03 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120074

Richard Biener  changed:

   What|Removed |Added

Version|unknown |15.1.0
   Priority|P3  |P2

[Bug preprocessor/120061] [14 Regression] libqt6webengine fails static_assert (__LINE__ == 470, ...)

2025-05-03 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120061

Richard Biener  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2025-05-03

--- Comment #4 from Richard Biener  ---
I have reverted r14-11679-g8a884140c2bcb7 and this fixed the build.  I can't
currently access the machine where the failed build resides, once I recover
access I'll try to gather up a non-preprocessed set of files to reproduce the
issue.  I've tried N newlines before a static_assert on __LINE__ but that does
not seem to trigger it - likely some file context swaps are required.

I've tried the preprocessed source with the static_assert changed back to
__LINE__ and compiling without -fpreprocessed and that reproduces it
when compiling with -fno-preprocessed, but I'm not sure that's a valid
testcase as the #line directives in the preprocessed source are off.

In fact:

# 28
"../../../../../src/3rdparty/chromium/third_party/blink/public/common/interest_group/auction_config.h"
2




namespace blink {

is probably the first wrong line directive.  The corresponding source is

#include "url/gurl.h"
#include "url/origin.h" 

namespace blink {


There are larger comment blocks we skip with line directives, possibly those
are an issue as well.


For the 14 branch I think the solution is to revert the backport, the bug
was not marked as regression.  I'm confirming the issue based on the
reversion fixing the build.

[Bug preprocessor/120061] [14 Regression] libqt6webengine fails static_assert (__LINE__ == 470, ...)

2025-05-03 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120061

--- Comment #5 from Richard Biener  ---
The preprocessed source is too large to attach as well (~4MB compressed).

[Bug preprocessor/120061] [14 Regression] libqt6webengine fails static_assert (__LINE__ == 470, ...)

2025-05-03 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120061

--- Comment #6 from Richard Biener  ---
Our build succeeds with GCC 15, but as Jakub says, location_t is larger there.

[Bug preprocessor/120061] [14 Regression] libqt6webengine fails static_assert (__LINE__ == 470, ...)

2025-05-03 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120061

--- Comment #7 from Jakub Jelinek  ---
I'm not against reverting the patch, but I'd really like to understand what's
going on, because 15/16 could very well be wrong too, just on larger testcases.
Anyway, I've tried
468x empty line followed by
#include "pr120067.h"

followed by empty line followed by
  static_assert(__LINE__ == 470, R"(
If modifying AuctionConfig fields, please make sure to also modify:
etc.
and in pr120067.h e.g. 11498928 empty lines (and some other counts), but that
didn't reproduce it.

[Bug target/119900] [16 regression] imagick slowdown with -Ofast -march=native -fprofile-use since r16-39-gf6859fb621179e (interaction of rpad and late-combine)

2025-05-03 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119900

--- Comment #6 from Jan Hubicka  ---
Sadly this did not fix the whole regression.  The problem is that after my
change to enable ipa-cp to clone over cold edges we clone
GetVirtualPixelsFromNexus twice (as constprop.0 and constprop.1).  This
function calls SetPixelCacheNexusPixels.isra.0 which needs to be inlined to get
good performance.

Now the problem is that cutoff for hot code is:

  9358048944: time:2 (6.38) size:2 (0.00)
  9312701352: time:29 (98.38) size:29 (0.01)
  46090224: time:2 (98.41) size:2 (0.01)
  45347592: time:5 (98.49) size:5 (0.01)
  23936592: time:2 (98.51) size:2 (0.01)
  23847888: time:20 (98.67) size:19 (0.02)
  23846892: time:10 (98.75) size:10 (0.03)
  23844228: time:14 (98.86) size:14 (0.03)
  23842804: time:50 (99.27) size:40 (0.04)   <--- here is the cutoff
  23842652: time:3 (99.29) size:3 (0.05)
  23842500: time:2 (99.31) size:2 (0.05)
  23841808: time:11 (99.40) size:11 (0.05)
  23838196: time:8 (99.46) size:8 (0.05)
  23739800: time:48 (99.85) size:57 (0.07)
  11968296: time:2 (99.86) size:2 (0.07)
  11869900: time:3 (99.87) size:3 (0.08)
  3132000: time:2 (99.87) size:2 (0.08)
  2503800: time:33 (99.90) size:33 (0.09)
  1338020: time:2 (99.90) size:2 (0.09)
  1069820: time:35 (99.92) size:35 (0.10)


Determined min count: 23842804 Time:99.27% Size:0.04%

So there is actual code with counters very close to the cutoff and that is the
case of the call in question which is called 23847888 times. Now cloning twise
reduces count of each call to 8367864 (for constprop.0), 15459299 (for
constrprop.1) and 15641 (for the non-cloned version) which are all bellow
threshold so we no longer inline.

This is likely non-representative train run.  Inliner can scale the count by
speedup before deciding on hotness which would likely make this inlining
happen. Problem is that the computation is on a hot path and I am not sure I
want to slow it down for this, since those are cases that should be
theoretically caught by ipa-cp.

--param hot-bb-count-ws-permille=999

Improves rate from 13.0 to 14.2 (9%).

[Bug tree-optimization/120069] [16 Regression] Yes another imagick -march=native -flto -Ofast + PGO regression between g:1c0cbc1b300e08df5ebfce00a7195890d78f2064 and g:55b01e17c793688a2878fa43a76df126

2025-05-03 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120069

Jan Hubicka  changed:

   What|Removed |Added

   Last reconfirmed||2025-05-03
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW

--- Comment #6 from Jan Hubicka  ---
I added some furhter analysis to PR119900. The aarch slowdown is possibly
caused by ipa-cp disabling one inline. A workaround is to increase
hot-ws-bb-count-permille.

Part of the regression tracked here is solved by the VEC_SELECT costing fix,
but not all of it.  It would be still useful to bisect this.

คุณเดือดร้อน เราช่วยคุณได้ ไม่มีโอนก่อนไม่มีมัดจำ

2025-05-03 Thread TPL Group via Gcc-bugs


[Bug c++/85944] Address of temporary at global scope not considered constexpr

2025-05-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85944

--- Comment #20 from GCC Commits  ---
The trunk branch has been updated by Jason Merrill :

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

commit r16-368-ga63d871eac0e57002b4ab4e1522f3f3851183b5e
Author: Jason Merrill 
Date:   Fri May 2 10:47:01 2025 -0400

c++: add fixed testcase [PR85944]

This testcase was incidentally fixed by r16-325 for PR119162.

PR c++/85944

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/constexpr-temp3.C: New test.

[Bug target/120050] [15/16 Regression] ICE bootstrapping on mips64el with --with-arch=gs464 --with-build-config=bootstrap-O3 --enable-checking=yes,extra

2025-05-03 Thread xry111 at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120050

--- Comment #5 from Xi Ruoyao  ---
Before ext-dce:

(insn 420 419 421 43 (set (reg:SI 423 [ _144 ])
(truncate:SI (reg:DI 304 [ ivtmp.55 ]))) 203 {truncdisi2}
 (nil))
(insn 421 420 422 43 (set (reg:DI 523 [ i ])
(sign_extend:DI (reg:SI 423 [ _144 ]))) 238 {extendsidi2}
"../../gcc/gcc/genhooks.cc":198:8 323 {*movsi_internal}
(insn 439 436 440 45 (set (reg:SI 430 [ shp_91->pos ])
(mem:SI (plus:DI (reg/v/f:DI 240 [ shp ])
(const_int 8 [0x8])) [5 shp_91->pos+0 S4 A64]))
"../../gcc/gcc/genhooks.cc":198:8 323 {*movsi_internal} 
 (nil)) 
(insn 440 439 441 45 (set (reg:SI 431 [ i ])
(subreg/u:SI (reg:DI 523 [ i ]) 0)) "../../gcc/gcc/genhooks.cc":198:8
323 {*movsi_internal}  
 (nil))
(jump_insn 441 440 442 45 (set (pc)
(if_then_else (eq (reg:SI 430 [ shp_91->pos ])
(reg:SI 431 [ i ])) 
(label_ref 448)
(pc))) "../../gcc/gcc/genhooks.cc":198:8 487 {*branch_equalitysi}
(expr_list:REG_DEAD (reg:SI 431 [ i ])
(expr_list:REG_DEAD (reg:SI 430 [ shp_91->pos ])
(int_list:REG_BR_PROB 548896828 (nil
 -> 448)  

And ext-dce rewrites the sign_extend in insn 421 as subreg.  I don't even know
if this is correct before ext-dce...

[Bug c++/118874] [15 regression] ICE in copy_rtx, at rtl.cc:372

2025-05-03 Thread iains at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118874

--- Comment #22 from Iain Sandoe  ---
Given that Rainer reports that this is a regression from GCC-10, I was looking
into back porting it for GCC-14.3.  However, it does not seem that either the
pr115905 or the test case here fail with current releases/gcc-14. (they do fail
with gcc14.2).

This is on cfarm216 configured:
../src/configure --prefix=... --with-gnu-as --with-as=/usr/gnu/bin/as
--disable-rpath --without-gnu-ld --with-ld=/usr/bin/ld --enable-languages=c,c++

@rainer - any advice?

[Bug target/120083] New: Use vcvtneps2bf16 AVX512BF instruction to convert float to __bf16

2025-05-03 Thread mcccs at gmx dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120083

Bug ID: 120083
   Summary: Use vcvtneps2bf16 AVX512BF instruction to convert
float to __bf16
   Product: gcc
   Version: 16.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mcccs at gmx dot com
  Target Milestone: ---

pr119626 was for arm, this is for x86.

Copy LLVM 21's behavior:

With -mavx512vl -mavx512bf16 and -O3

__bf16 cvt(float r) {
return (__bf16) r;
}

should use vcvtneps2bf16

related: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117542

[Bug ipa/120082] FAIL: gcc.dg/ipa/pr119318.c execution test

2025-05-03 Thread danglin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120082

--- Comment #3 from John David Anglin  ---
Fails at first cmpb:

=> 0x400067bc :   cmpb,*<> r0,ret0,0x40006804

   0x400067c0 :   depdi,z,* -7,31,5,ret0
   0x400067c4 :   cmpb,*<> ret0,ret1,0x40006804


(gdb) p/x $ret0
$1 = 0x19
(gdb) stepi
0x400067c0  34  if (x[i] != (i ? 0 : 0x19))
(gdb)
35__builtin_abort();
(gdb) p/x $ret0
$2 = 0x19
(gdb) p/x $ret1
$3 = 0x0

Looks like endian issue.

[Bug target/120083] Use vcvtneps2bf16 AVX512BF instruction to convert float to __bf16 on -O3 without needing -Ofast

2025-05-03 Thread mcccs at gmx dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120083

--- Comment #1 from mcccs at gmx dot com ---
So the issue is doing what GCC does for Ofast for O3 as well, many thanks and
kind regards

[Bug testsuite/120082] FAIL: gcc.dg/ipa/pr119318.c execution test due to endianness

2025-05-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120082

Andrew Pinski  changed:

   What|Removed |Added

   Host|hppa64-hp-hpux11.11 |
  Build|hppa64-hp-hpux11.11 |
 Target|hppa64-hp-hpux11.11 |hppa64-hp-hpux11.11
   ||powerpc64-linux-gnu
Summary|FAIL: gcc.dg/ipa/pr119318.c |FAIL: gcc.dg/ipa/pr119318.c
   |execution test  |execution test due to
   ||endianness

--- Comment #5 from Andrew Pinski  ---
Fails on big-endian ppc too:
https://gcc.gnu.org/pipermail/gcc-testresults/2025-May/845913.html

[Bug ada/114065] gnat build with -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 fails on 32bit archs

2025-05-03 Thread nicolas at debian dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114065

--- Comment #40 from Nicolas Boulenguez  ---
Created attachment 61282
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61282&action=edit
fix details, improve diff readability

Hello.
This version fixes various cosmetic details in v15.
The archive contains a diff between v15 and v16. Only patch 1 is affected.
* Remove the C types from the new s-linux__android-aarch64.ads.
* Move the changes in a-calcon and g-calend from the spec to the body,
  improving the confidence that existing code will build unchanged.
* Declare all wrappers Obsolescent with a link to s-c_time.
* Remove a constant and two wrappers from s-c_time.

[Bug lto/120084] New: FAIL: gcc-dg-lto-pr60779-01.exe scan-ltrans-tree-dump-times optimized "divdc3" 1

2025-05-03 Thread danglin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120084

Bug ID: 120084
   Summary: FAIL: gcc-dg-lto-pr60779-01.exe
scan-ltrans-tree-dump-times optimized "divdc3" 1
   Product: gcc
   Version: 16.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: lto
  Assignee: unassigned at gcc dot gnu.org
  Reporter: danglin at gcc dot gnu.org
CC: rguenth at gcc dot gnu.org
  Target Milestone: ---
  Host: hppa64-hp-hpux11.11
Target: hppa64-hp-hpux11.11
 Build: hppa64-hp-hpux11.11

Created attachment 61283
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61283&action=edit
Tree dump

Executing on host: /home/dave/gnu/gcc/objdir64/gcc/xgcc
-B/home/dave/gnu/gcc/objdir64/gcc/ -fdiagnostics-plain-output   -O -flto
-fdump-tree-optimized   -c -o c_lto_pr60779_0.o
/home/dave/gnu/gcc/gcc/gcc/testsuite/gcc.dg/lto/pr60779_0.c(timeout = 300)
spawn -ignore SIGHUP /home/dave/gnu/gcc/objdir64/gcc/xgcc
-B/home/dave/gnu/gcc/objdir64/gcc/ -fdiagnostics-plain-output -O -flto
-fdump-tree-optimized -c -o c_lto_pr60779_0.o
/home/dave/gnu/gcc/gcc/gcc/testsuite/gcc.dg/lto/pr60779_0.c
PASS: gcc.dg/lto/pr60779 c_lto_pr60779_0.o assemble,  -O -flto
-fdump-tree-optimized
Executing on host: /home/dave/gnu/gcc/objdir64/gcc/xgcc
-B/home/dave/gnu/gcc/objdir64/gcc/ -fdiagnostics-plain-output   -O -flto
-fdump-tree-optimized  -fcx-limited-range -c -o c_lto_pr60779_1.o
/home/dave/gnu/gcc/gcc/gcc/testsuite/gcc.dg/lto/pr60779_1.c(timeout = 300)
spawn -ignore SIGHUP /home/dave/gnu/gcc/objdir64/gcc/xgcc
-B/home/dave/gnu/gcc/objdir64/gcc/ -fdiagnostics-plain-output -O -flto
-fdump-tree-optimized -fcx-limited-range -c -o c_lto_pr60779_1.o
/home/dave/gnu/gcc/gcc/gcc/testsuite/gcc.dg/lto/pr60779_1.c
PASS: gcc.dg/lto/pr60779 c_lto_pr60779_1.o assemble,  -O -flto
-fdump-tree-optimized
Executing on host: /home/dave/gnu/gcc/objdir64/gcc/xgcc
-B/home/dave/gnu/gcc/objdir64/gcc/  c_lto_pr60779_0.o c_lto_pr60779_1.o   
-fdiagnostics-plain-output   -O -flto -fdump-tree-optimized   -o
gcc-dg-lto-pr60779-01.exe(timeout = 300)
spawn -ignore SIGHUP /home/dave/gnu/gcc/objdir64/gcc/xgcc
-B/home/dave/gnu/gcc/objdir64/gcc/ c_lto_pr60779_0.o c_lto_pr60779_1.o
-fdiagnostics-plain-output -O -flto -fdump-tree-optimized -o
gcc-dg-lto-pr60779-01.exe
PASS: gcc.dg/lto/pr60779 c_lto_pr60779_0.o-c_lto_pr60779_1.o link,  -O -flto
-fdump-tree-optimized
gcc-dg-lto-pr60779-01.exe: pattern found 2 times
FAIL: gcc-dg-lto-pr60779-01.exe scan-ltrans-tree-dump-times optimized "divdc3"
1

There are two instances of divdc3 in dump.  It appears foo was expected to
be optimized away.

[Bug testsuite/120084] FAIL: gcc-dg-lto-pr60779-01.exe scan-ltrans-tree-dump-times optimized "divdc3" 1

2025-05-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120084

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2025-05-03
  Component|lto |testsuite
 Ever confirmed|0   |1

--- Comment #1 from Andrew Pinski  ---
> It appears foo was expected to be optimized away.

Or not be inlined. 

I think adding `/* { dg-require-linker-plugin "" } */` to
gcc.dg/lto/pr60779_0.c will fix the testcase since it requires the linker
plugin to be able to detect if foo is needed or not.

[Bug target/120083] Use vcvtneps2bf16 AVX512BF instruction to convert float to __bf16 on -O3 without needing -Ofast

2025-05-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120083

--- Comment #3 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #2)
> GCC was changed not to emit them on purpose, see r15-5071-gde867e8da30bf5
> which made the change to only allow it at -Ofast.

https://gcc.gnu.org/pipermail/gcc-patches/2024-November/668040.html


So if anything this is a bug in LLVM.

[Bug fortran/102900] ICE via gfc_class_data_get with alloc_comp_class_4.f03 or proc_ptr_52.f90 using -fcheck=all

2025-05-03 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102900

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #12 from anlauf at gcc dot gnu.org ---
Should be fixed on mainline for gcc-16, and backported to 15-branch.  Closing.

Feel free to reopen if I missing something.

[Bug testsuite/120085] New: FAIL: gcc.dg/lto/modref-2 c_lto_modref-2_0.o-c_lto_modref-2_0.o link, -O2 -flto-partition=max -flto -fno-ipa-sra

2025-05-03 Thread danglin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120085

Bug ID: 120085
   Summary: FAIL: gcc.dg/lto/modref-2
c_lto_modref-2_0.o-c_lto_modref-2_0.o link, -O2
-flto-partition=max -flto -fno-ipa-sra
   Product: gcc
   Version: 16.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: testsuite
  Assignee: unassigned at gcc dot gnu.org
  Reporter: danglin at gcc dot gnu.org
  Target Milestone: ---
  Host: hppa64-hp-hpux11.11
Target: hppa64-hp-hpux11.11
 Build: hppa64-hp-hpux11.11

spawn -ignore SIGHUP /home/dave/gnu/gcc/objdir64/gcc/xgcc
-B/home/dave/gnu/gcc/o
bjdir64/gcc/ c_lto_modref-2_0.o -fdiagnostics-plain-output -O2
-flto-partition=m
ax -flto -fno-ipa-sra -o gcc-dg-lto-modref-2-01.exe
ld: Unsatisfied symbol "modf" in file c_lto_modref-2_0.o
1 errors.
collect2: error: ld returned 1 exit status
compiler exited with status 1
FAIL: gcc.dg/lto/modref-2 c_lto_modref-2_0.o-c_lto_modref-2_0.o link, -O2
-flto-partition=max -flto -fno-ipa-sra

modf is in libm on hpux.

[Bug rust/119641] narrowing Warning during bootstrap in Rust::BIR::PlaceDB::lookup_or_add_variable

2025-05-03 Thread tschwinge at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119641

--- Comment #3 from Thomas Schwinge  ---
(I haven't checked, but) supposedly fixed in trunk via commit
r16-237-gbeced835afa3908aa94550d2ca5ee3879a620adb "gccrs: Fix narrowing
conversion warnings".

Owen, for next time, to auto-annotate GCC Bugzilla, the correct syntax to use
in Git log would've been to put "PR rust/119641" into the ChangeLog snippet,
see .

Given this has been filed with "Version: 15.0", should this be cherry-picked
into releases/gcc-15 branch as well?

[Bug gcov-profile/120086] FAIL: gcc.misc-tests/gcov-29.c

2025-05-03 Thread danglin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120086

--- Comment #1 from John David Anglin  ---
Similar fails:
FAIL: gcc.misc-tests/gcov-30.c gcov: 0 failures in line counts, 0 in branch
percentages, 0 in condition/decision, 12 in prime-paths, 0 in return
percentages, 0 in intermediate format, 0 failed in filters
FAIL: expected covered: '{13(true) 14 17}'
FAIL: gcc.misc-tests/gcov-33.c gcov: 0 failures in line counts, 0 in branch
percentages, 0 in condition/decision, 1 in prime-paths, 0 in return
percentages, 0 in intermediate format, 0 failed in filters
FAIL: expected: '{14(false) 17 18}'
FAIL: expected covered: '{14(true) 15 18}'
FAIL: gcc.misc-tests/gcov-34.c gcov: 0 failures in line counts, 0 in branch
percentages, 0 in condition/decision, 2 in prime-paths, 0 in return
percentages, 0 in intermediate format, 0 failed in filters

[Bug tree-optimization/120080] [16 regression] ICE when building llvm-20.1.3 (find_bit_tests, at tree-switch-conversion.cc:1799)

2025-05-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120080

--- Comment #3 from Andrew Pinski  ---
Created attachment 61285
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61285&action=edit
Reduced but not cleaned up all the way

[Bug gcov-profile/120086] New: FAIL: gcc.misc-tests/gcov-29.c

2025-05-03 Thread danglin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120086

Bug ID: 120086
   Summary: FAIL: gcc.misc-tests/gcov-29.c
   Product: gcc
   Version: 16.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: gcov-profile
  Assignee: unassigned at gcc dot gnu.org
  Reporter: danglin at gcc dot gnu.org
  Target Milestone: ---
  Host: hppa64-hp-hpux11.11
Target: hppa64-hp-hpux11.11
 Build: hppa64-hp-hpux11.11

Created attachment 61284
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61284&action=edit
gcov file

spawn -ignore SIGHUP /home/dave/gnu/gcc/objdir64/gcc/xgcc
-B/home/dave/gnu/gcc/objdir64/gcc/
/home/dave/gnu/gcc/gcc/gcc/testsuite/gcc.misc-tests/gcov-29.c
-fdiagnostics-plain-output --coverage -fpath-coverage -lm -o ./gcov-29.exe
Executing on host: /home/dave/gnu/gcc/objdir64/gcc/xgcc
-B/home/dave/gnu/gcc/objdir64/gcc/  exceptions_enabled12280.cc   
-fdiagnostics-plain-output  -Wno-complain-wrong-lang -S -o
exceptions_enabled12280.s(timeout = 300)
spawn -ignore SIGHUP /home/dave/gnu/gcc/objdir64/gcc/xgcc
-B/home/dave/gnu/gcc/objdir64/gcc/ exceptions_enabled12280.cc
-fdiagnostics-plain-output -Wno-complain-wrong-lang -S -o
exceptions_enabled12280.s
PASS: gcc.misc-tests/gcov-29.c (test for excess errors)
Setting LD_LIBRARY_PATH to
:/home/dave/gnu/gcc/objdir64/gcc::/home/dave/gnu/gcc/objdir64/gcc::/home/dave/gnu/gcc/objdir64/gcc:/home/dave/gnu/gcc/objdir64/hppa64-hp-hpux11.11/./libatomic/.libs::/home/dave/gnu/gcc/objdir64/gcc:/home/dave/gnu/gcc/objdir64/hppa64-hp-hpux11.11/./libatomic/.libs:/home/dave/gnu/gcc/objdir64/gcc:/home/dave/gnu/gcc/objdir64/hppa64-hp-hpux11.11/libstdc++-v3/src/.libs
Execution timeout is: 300
spawn [open ...]
PASS: gcc.misc-tests/gcov-29.c execution test
Executing on host: /home/dave/gnu/gcc/objdir64/gcc/gcov  --prime-paths-lines
gcov-29.c(timeout = 300)
spawn -ignore SIGHUP /home/dave/gnu/gcc/objdir64/gcc/gcov --prime-paths-lines
gcov-29.c
File '/home/dave/gnu/gcc/gcc/gcc/testsuite/gcc.misc-tests/gcov-29.c'
Lines executed:15.58% of 520
Prime paths covered:4.18% of 479
Creating 'gcov-29.c.gcov'

Lines executed:15.58% of 520
FAIL: expected: '33'
FAIL: expected: '{48(true) 49 52} {48(false) 51 52}'
FAIL: expected: '{63(false) 66 67}'
FAIL: expected: '{78(true) 79 82}'
FAIL: expected: '{112(true) 113 114} {112(false) 114}'
FAIL: expected: '{125(true) 126 129} {125(false) 128 129}'
FAIL: expected: '{141(true) 142 147} {141(false) 143(true) 144 147} {141(false)
143(false) 146 147}'
FAIL: expected: '{162 162(true) 163} {162 162(false) 164} {163 162(true) 163}
{163 162(false) 164} {162(true) 163 162}'
FAIL: expected: '{180 180(true) 181} {180 180(false) 182} {181 180(true) 181}
{181 180(false) 182} {180(true) 181 180}'
FAIL: expected: '{194 197(false) 198} {197(true) 197}'
FAIL: expected: '{213 216(true) 220} {213 216(false) 222} {216(true) 220 216}
{220 216(true) 220} {220 216(false) 222}'
FAIL: expected: '{243(false) 247 247(true) 247(true) 249(true) 250 253}
{243(false) 247 247(true) 247(false) 253} {243(false) 247 247(false) 253}
{243(true) 253} {249(false) 247(true) 247(true) 249} {249(false) 247(true)
247(false) 253} {247(true) 247(true) 249(false) 247} {247(true) 249(false)
247(true) 247} {247(true) 249(false) 247(false) 253}'
FAIL: gcc.misc-tests/gcov-29.c gcov: 0 failures in line counts, 0 in branch
percentages, 0 in condition/decision, 12 in prime-paths, 0 in return
percentages, 0 in intermediate format, 0 failed in filters

[Bug tree-optimization/120080] [16 regression] ICE when building llvm-20.1.3 (find_bit_tests, at tree-switch-conversion.cc:1799)

2025-05-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120080

--- Comment #5 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #3)
> Created attachment 61285 [details]
> Reduced but not cleaned up all the way

-O2 is enough to reproduce this one. Don't need any other options.

[Bug tree-optimization/120080] [16 regression] ICE when building llvm-20.1.3 (find_bit_tests, at tree-switch-conversion.cc:1799)

2025-05-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120080

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2025-05-03
 Status|UNCONFIRMED |NEW
   Keywords|needs-reduction |

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

[Bug c/120087] New: Miscompilation of a short-cut boolean expression in the presence of assume attribute.

2025-05-03 Thread danilov at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120087

Bug ID: 120087
   Summary: Miscompilation of a short-cut boolean expression in
the presence of assume attribute.
   Product: gcc
   Version: 13.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: danilov at gmail dot com
  Target Milestone: ---

Here is a minimal reproducer:

-
struct rung {
int   seq;
void *data;
};

struct path {
struct rung rung[1];
};

static int used;

static char ll(const struct rung *n) {
return *(char *)n->data;
}

int main(int argc, char **argv) {
(void)argc; (void)argv;
struct path p = {};
int result = 0;
used = 0;
__asm__ __volatile__("": : :"memory");
for (int i = 0; i <= used && result == 0; ++i) {
struct rung *r = &p.rung[i];
__attribute__((assume(i <= 0 || ll(r) + 1 == ll(r - 1;
if (!(r->seq == 0 && (i <= 0 || ll(r) + 1 == ll(r - 1 {
result = -1;
}
}
return 0;
}
-

Compile as `gcc -O1 gcc-13-bug.c`, it crashes with SIGSEGV. Note that the loop
iterates only once (used == 0), i == 0 in the body of the loop, so l(r) should
not be called. Yet, l(r) and l(r-1) are both called.

The reproducer is minimal in the sense any small random change eliminates the
effect. For example,

 * Move used = 0 over the asm-barrier (or simply remove the barrier).

 * Remove result == 0 from the loop guard or r->seq == 0 from the conditional.

 * Replace struct path p with struct rung p[1] mutatis mutandis. This one is
especially surprising.

uname -a: Linux tau 6.8.0-52-generic #53~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed
Jan 15 19:18:46 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Below is the output of `gcc -Wall -Wextra -O1 -v -save-temps gcc-13-bug.c`
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
13.1.0-8ubuntu1~22.04' --with-bugurl=file:///usr/share/doc/gcc-13/README.Bugs
--enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2,rust --prefix=/usr
--with-gcc-major-version-only --program-suffix=-13
--program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id
--libexecdir=/usr/libexec --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib
--enable-libphobos-checking=release --with-target-system-zlib=auto
--enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet
--with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32
--enable-multilib --with-tune=generic
--enable-offload-targets=nvptx-none=/build/gcc-13-IvzKaI/gcc-13-13.1.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-13-IvzKaI/gcc-13-13.1.0/debian/tmp-gcn/usr
--enable-offload-defaulted --without-cuda-driver --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
--with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.1.0 (Ubuntu 13.1.0-8ubuntu1~22.04)
COLLECT_GCC_OPTIONS='-Wall' '-Wextra' '-O1' '-v' '-save-temps' '-mtune=generic'
'-march=x86-64' '-dumpdir' 'a-'
 /usr/libexec/gcc/x86_64-linux-gnu/13/cc1 -E -quiet -v -imultiarch
x86_64-linux-gnu gcc-13-bug.c -mtune=generic -march=x86-64 -Wall -Wextra -O1
-fpch-preprocess -fasynchronous-unwind-tables -fstack-protector-strong
-Wformat-security -fstack-clash-protection -fcf-protection -o a-gcc-13-bug.i
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-linux-gnu/13/include-fixed/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/13/include-fixed"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-linux-gnu/13/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-linux-gnu/13/include
 /usr/local/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-Wall' '-Wextra' '-O1' '-v' '-save-temps' '-mtune=generic'
'-march=x86-64' '-dumpdir' 'a-'
 /usr/libexec/gcc/x86_64-linux-gnu/13/cc1 -fpreprocessed a-gcc-13-bug.i -quiet
-dumpdir a- -dumpbase gcc-13-bug.c -dumpbase-ext .c -mtune=

[Bug tree-optimization/117287] [13 Regression] assume attribute related miscompilation

2025-05-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117287

Andrew Pinski  changed:

   What|Removed |Added

 CC||danilov at gmail dot com

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

[Bug tree-optimization/120087] Miscompilation of a short-cut boolean expression in the presence of assume attribute.

2025-05-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120087

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #1 from Andrew Pinski  ---
I am 75% sure this is a dup of bug 117287.

[Bug target/118977] m68k mcf5282 undefined symbol __atomic_test_and_set from atomic_base.h

2025-05-03 Thread joel at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118977

Joel Sherrill  changed:

   What|Removed |Added

   Last reconfirmed||2025-5-3
  Known to fail||14.0
  Known to work||13.0

--- Comment #4 from Joel Sherrill  ---
I managed to narrow down the commit that broke this. RTEMS has some functions
to support libatomic in libatomic/config/rtems. What tiny bit of magic are we
missing for CPUs that don't have the instruction. Help providing
__atomic_test_and_set is appreciated.


commit 8e6757b30d0f3f13d47d0f842801a751ba6293c2 (HEAD)
Author: Hans-Peter Nilsson 
Date:   Sat Sep 23 05:06:52 2023 +0200

__atomic_test_and_set: Fall back to library, not non-atomic code

Make __atomic_test_and_set consistent with other __atomic_ and __sync_
builtins: call a matching library function instead of emitting
non-atomic code when the target has no direct insn support.

There's special-case code handling targetm.atomic_test_and_set_trueval
!= 1 trying a modified maybe_emit_sync_lock_test_and_set.  Previously,
if that worked but its matching emit_store_flag_force returned NULL,
we'd segfault later on.  Now that the caller handles NULL, gcc_assert
here instead.

While the referenced PR:s are ARM-specific, the issue is general.

PR target/107567
PR target/109166
* builtins.cc (expand_builtin) :
Handle failure from expand_builtin_atomic_test_and_set.
* optabs.cc (expand_atomic_test_and_set): When all attempts fail to
generate atomic code through target support, return NULL
instead of emitting non-atomic code.  Also, for code handling
targetm.atomic_test_and_set_trueval != 1, gcc_assert result
from calling emit_store_flag_force instead of returning NULL.

[Bug tree-optimization/120087] Miscompilation of a short-cut boolean expression in the presence of assume attribute.

2025-05-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120087

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #2 from Andrew Pinski  ---
yes this is a dup.

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

[Bug target/120050] [15/16 Regression] ICE bootstrapping on mips64el with --with-arch=gs464 --with-build-config=bootstrap-O3 --enable-checking=yes,extra

2025-05-03 Thread xry111 at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120050

--- Comment #6 from Xi Ruoyao  ---
Before ext-dce:

(insn 421 420 422 43 (set (reg:DI 523 [ i ])
(sign_extend:DI (reg:SI 423 [ _144 ]))) 238 {extendsidi2}
 (expr_list:REG_DEAD (reg:SI 423 [ _144 ])
(nil)))
(insn 440 439 441 45 (set (reg:SI 431 [ i ])
(subreg/s/u:SI (reg:DI 523 [ i ]) 0)) "../../gcc/gcc/genhooks.cc":198:8
323 {*movsi_internal} 
 (nil))
(jump_insn 441 440 442 45 (set (pc)
(if_then_else (eq (reg:SI 430 [ shp_91->pos ])
(reg:SI 431 [ i ]))
(label_ref 448)
(pc))) "../../gcc/gcc/genhooks.cc":198:8 487 {*branch_equalitysi}
 (expr_list:REG_DEAD (reg:SI 431 [ i ])
(expr_list:REG_DEAD (reg:SI 430 [ shp_91->pos ])
(int_list:REG_BR_PROB 548896828 (nil
 -> 448)

After ext-dce, insns 421 and 440 become:

(insn 421 420 422 43 (set (reg:DI 523 [ i ]) 
(subreg:DI (reg:SI 423 [ _144 ]) 0)) 321 {*movdi_64bit}
 (expr_list:REG_DEAD (reg:SI 423 [ _144 ])
(nil)))
(insn 440 439 441 45 (set (reg:SI 431 [ i ])
(subreg/u:SI (reg:DI 523 [ i ]) 0)) "../../gcc/gcc/genhooks.cc":198:8
323 {*movsi_internal}
 (nil))

i.e. the extension in 421 is changed to subreg and "/s" in 440 is removed. 
Anyway 440 is really suspicious regarding MIPS's TARGET_MODE_REP_EXTENDED
mandates SImode to be represented in sign-extended form.  Was 440 already
incorrect before ext-dce?  Or was it correct but then it's broken by ext-dce? 
Or is it still correct after ext-dce but then the later passes would do some
incorrect thing?

[Bug tree-optimization/120081] New: lsplit is not always working

2025-05-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120081

Bug ID: 120081
   Summary: lsplit is not always working
   Product: gcc
   Version: 16.0
Status: UNCONFIRMED
  Keywords: missed-optimization
  Severity: enhancement
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Take at -O3:
```
void f();
void g (unsigned n)
{
  for (unsigned i = n; i < 30; ++i)
if (i > 10)
  f();
}
void g1 (unsigned n)
{
  unsigned i = n;
  for (; i <= 10 && i < 30; ++i)
  ;
  for (; i < 30; ++i)
//if (i > 10)
  f();
}
```

I had assumed g would transform into g1 but currently it is not.

This is derived from gcc.dg/Wrestrict-22.c .

[Bug target/120083] Use vcvtneps2bf16 AVX512BF instruction to convert float to __bf16 on -O3 without needing -Ofast

2025-05-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120083

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #2 from Andrew Pinski  ---
GCC was changed not to emit them on purpose, see r15-5071-gde867e8da30bf5 which
made the change to only allow it at -Ofast.

[Bug testsuite/120082] FAIL: gcc.dg/ipa/pr119318.c execution test

2025-05-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120082

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2025-05-03
  Component|ipa |testsuite
   Keywords||testsuite-fail
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=119318

--- Comment #4 from Andrew Pinski  ---
yes it looks needs a fix for endianness because of the cast between vector
types

[Bug fortran/120049] ICE when using IS_C_ASSOCIATED ()

2025-05-03 Thread jvdelisle at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120049

--- Comment #9 from Jerry DeLisle  ---
(In reply to kargls from comment #8)
> (In reply to Jerry DeLisle from comment #7)
> > That is exactly the patch I was testing Steve.
> 
> I assume that you've found that you'll need to
> deal with both c_ptr_1 and c_ptr_2.  With the
> short-circuit for c_ptr_2 in place, this
> 

Yes, the simple short circuit fails other tests. I am studying this further.

[Bug target/119937] [15/16 Regression] ICE: Error detected at a-sttebu.ads:56:30

2025-05-03 Thread doko at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119937

--- Comment #9 from Matthias Klose  ---
this is only seen with a profiled bootstrap, make profiledbootstrap-lean, not
with the bootstrap target.

[Bug testsuite/120084] FAIL: gcc-dg-lto-pr60779-01.exe scan-ltrans-tree-dump-times optimized "divdc3" 1

2025-05-03 Thread danglin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120084

--- Comment #2 from John David Anglin  ---
This changes test to unsupported on hppa64-hp-hpux11.11.

[Bug libgomp/91917] OpenACC 'acc_set_cuda_stream' return type

2025-05-03 Thread sandra at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91917

sandra at gcc dot gnu.org changed:

   What|Removed |Added

 CC||sandra at gcc dot gnu.org

--- Comment #2 from sandra at gcc dot gnu.org ---
The return type was changed to void in the OpenACC 3.0 specification.  We
aren't claiming to support 3.0 yet, but  there are presently 3 testcases
that do something with the return value of acc_set_cuda_stream:

libgomp.oacc-c-c++-common/lib-84.c
libgomp.oacc-c-c++-common/lib-85.c
libgomp.oacc-c-c++-common/acc_set_cuda_stream-1.c

Since the present return value is undefined, we should fix these test cases not
to depend on it, and the testsuite fixes don't have to wait for us to implement
the change in the function's return type.

[Bug tree-optimization/120080] [16 regression] ICE when building llvm-20.1.3 (find_bit_tests, at tree-switch-conversion.cc:1799)

2025-05-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120080

Andrew Pinski  changed:

   What|Removed |Added

 CC||pinskia at gcc dot gnu.org

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

[Bug fortran/102900] ICE via gfc_class_data_get with alloc_comp_class_4.f03 or proc_ptr_52.f90 using -fcheck=all

2025-05-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102900

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

https://gcc.gnu.org/g:768c8aed07aba2f240b92a7ee05be502cb5681b0

commit r15-9617-g768c8aed07aba2f240b92a7ee05be502cb5681b0
Author: Harald Anlauf 
Date:   Thu Apr 24 21:28:35 2025 +0200

Fortran: fix procedure pointer handling with -fcheck=pointer [PR102900]

PR fortran/102900

gcc/fortran/ChangeLog:

* trans-decl.cc (gfc_generate_function_code): Use sym->result
when generating fake result decl for functions returning
allocatable or pointer results.
* trans-expr.cc (gfc_conv_procedure_call): When checking the
pointer status of an actual argument passed to a non-allocatable,
non-pointer dummy which is of type CLASS, do not check the
class container of the actual if it is just a procedure pointer.
(gfc_trans_pointer_assignment): Fix treatment of assignment to
NULL of a procedure pointer.

gcc/testsuite/ChangeLog:

* gfortran.dg/proc_ptr_52.f90: Add -fcheck=pointer to options.
* gfortran.dg/proc_ptr_57.f90: New test.

(cherry picked from commit cc8d86ee4680d56eefeb76a8f2f752282e2631e3)

[Bug fortran/119986] Complex array part references are being passed incorrectly to a procedure

2025-05-03 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119986

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Keywords||wrong-code
   Assignee|unassigned at gcc dot gnu.org  |anlauf at gcc dot 
gnu.org

--- Comment #9 from anlauf at gcc dot gnu.org ---
Submitted: https://gcc.gnu.org/pipermail/fortran/2025-May/062087.html

[Bug tree-optimization/120080] [16 regression] ICE when building llvm-20.1.3 (find_bit_tests, at tree-switch-conversion.cc:1799)

2025-05-03 Thread mcccs at gmx dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120080

mcccs at gmx dot com changed:

   What|Removed |Added

 CC||mcccs at gmx dot com

--- Comment #6 from mcccs at gmx dot com ---
Bad commit: r16-347-g1381a5114788a2

[Bug c++/119844] Incomplete types are displayed after the import module

2025-05-03 Thread printfne at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119844

--- Comment #3 from printfne at gmail dot com ---
Thank you for the solution you proposed. It is indeed very useful. Besides,
I want to know if the C++ standard has any regulations on the symbols
exported in the module? For example, make them the same as those defined in
the cpp file?

nshead at gcc dot gnu.org  于2025年4月29日周二 21:19写道:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119844
>
> Nathaniel Shead  changed:
>
>What|Removed |Added
>
> 
>Keywords||diagnostic
>  CC||nshead at gcc dot gnu.org
>
> --- Comment #2 from Nathaniel Shead  ---
> I haven't attempted to fully reproduce, but it appears to me you have
> something
> like the following:
>
>   // user.cpp
>   export module User;
>   export struct User {
> int value;
>   };
>
>   // main.cpp
>   struct User;
>   struct MainWindow {
> User* u;
>   };
>   import User;
>   int foo(MainWindow m) {
> return m.u->value;
>   }
>
> $ g++-15 -fmodules -S user.cpp main.cpp
> main.cpp: In function ‘int foo(MainWindow)’:
> main.cpp:7:13: error: invalid use of incomplete type ‘struct User’
> 7 |   return m.u->value;
>   | ^~
> main.cpp:1:8: note: forward declaration of ‘struct User’
> 1 | struct User;
>   |^~~~
>
> This error is expected (though the diagnostic could definitely be
> improved!):
> 'User' (in main.cpp) and 'User@User' (in user.cpp) are unrelated, distinct
> types; the former belonging to the global module, and the latter attached
> to
> the module 'User'.  You can see this by comparing e.g.:
>
>   // main.cpp
>   struct User;
>   import User;
>   User u;
>
> $ g++-15 -fmodules -S user.cpp main.cpp
> main.cpp:3:1: error: reference to ‘User’ is ambiguous
> 3 | User u;
>   | ^~~~
> In module User, imported at main.cpp:2:
> user.cpp:2:15: note: candidates are: ‘struct User@User’
> 2 | export struct User {
>   |   ^~~~
> main.cpp:1:8: note: ‘struct User’
> 1 | struct User;
>   |^~~~
>
> To fix the issue, you could defined user.cpp as something like this:
>
>   // user.cpp
>   export module User;
>   export extern "C++" struct User {
> int value;
>   };
>
> The 'extern "C++"' ensures that 'User' is declared attached to the global
> module.
>
> I'll leave this PR open for now for the diagnostic issue, however, as I
> imagine
> this to be a common mistake, and we should be able to detect this and emit
> some
> kind of note pointing to the conflicting type.
>
> --
> You are receiving this mail because:
> You reported the bug.
> You are watching the reporter of the bug.

[Bug target/120070] [15/16 regression] m68k-linux-gnu-gcc -Os ICE segfault compiling xfs_trans_ail.c

2025-05-03 Thread mikpelinux at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120070

--- Comment #5 from Mikael Pettersson  ---
(In reply to Mikael Pettersson from comment #4)
> Bisected between 14.2.0 (old/good) and 15.1.0 (new/bad).
> 
> 9cebf1234b88e55a04071bd55c9ec4e22c0899e6 is the first new commit
> commit 9cebf1234b88e55a04071bd55c9ec4e22c0899e6 (HEAD)
> Author: Jeff Law 
> Date:   Tue Mar 11 18:01:33 2025 -0600
> 
> Revert "[rtl-optimization/117467] Avoid unnecessarily marking things
> live in ext-dce"
> 
> This reverts commit 4ed07a11ee2845c2085a3cd5cff043209a452441.
> 
>  gcc/ext-dce.cc | 12 

The commit being reverted was committed on April 9, and the revert on April 11,
so something must have sneaked in between those two to trigger this.
Re-bisecting.

[Bug target/120050] [15/16 Regression] ICE bootstrapping on mips64el with --with-arch=gs464 --with-build-config=bootstrap-O3 --enable-checking=yes,extra

2025-05-03 Thread law at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120050

--- Comment #7 from Jeffrey A. Law  ---
I'd forgotten about the MIPS quirks WRT promoted values.

While you can have a value in a register without promotion, you can't *use*
that value validly, even if it may otherwise appear to be safe to do so.

On a target that doesn't set MODE_REP_EXTENDED, the transformation is valid
because nothing should have looked at bits 32..63 of r431.  So transforming the
sign_extend into a simple subreg is safe.  Transforming the sign_extend into a
subreg destroys knowledge of the SUBREG_PROMOTED state of the (subreg/s/u:SI
(reg:DI 523) 0), so we clear the SUBREG_PROMOTED state of that node.

However on a MODE_REP_EXTENDED target the transformation is not safe because
the comparison may look at bits outside the given mode (ie, for an SImode
comparison the hardware may actually look a bits 32..63).

I suspect ext-dce is simply not suitable for a MODE_REP_EXTENDED target and
should be disabled (in ext-dce.cc rather than in the target itself).

[Bug ipa/120082] New: FAIL: gcc.dg/ipa/pr119318.c execution test

2025-05-03 Thread danglin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120082

Bug ID: 120082
   Summary: FAIL: gcc.dg/ipa/pr119318.c execution test
   Product: gcc
   Version: 16.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: ipa
  Assignee: unassigned at gcc dot gnu.org
  Reporter: danglin at gcc dot gnu.org
  Target Milestone: ---
  Host: hppa64-hp-hpux11.11
Target: hppa64-hp-hpux11.11
 Build: hppa64-hp-hpux11.11

spawn -ignore SIGHUP /home/dave/gnu/gcc/objdir64/gcc/xgcc
-B/home/dave/gnu/gcc/o
bjdir64/gcc/ /home/dave/gnu/gcc/gcc/gcc/testsuite/gcc.dg/ipa/pr119318.c
-fdiagno
stics-plain-output -Wno-psabi -w -O2 -lm -o ./pr119318.exe
PASS: gcc.dg/ipa/pr119318.c (test for excess errors)
Setting LD_LIBRARY_PATH to
:/home/dave/gnu/gcc/objdir64/gcc:/home/dave/gnu/gcc/o
bjdir64/hppa64-hp-hpux11.11/./libatomic/.libs::/home/dave/gnu/gcc/objdir64/gcc:/
home/dave/gnu/gcc/objdir64/hppa64-hp-hpux11.11/./libatomic/.libs:/home/dave/gnu/
gcc/objdir64/gcc:/home/dave/gnu/gcc/objdir64/hppa64-hp-hpux11.11/libstdc++-v3/sr
c/.libs
Execution timeout is: 300
spawn [open ...]
FAIL: gcc.dg/ipa/pr119318.c execution test

[Bug ipa/120082] FAIL: gcc.dg/ipa/pr119318.c execution test

2025-05-03 Thread danglin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120082

--- Comment #1 from John David Anglin  ---
Created attachment 61280
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61280&action=edit
Preprocessed source.

[Bug ipa/120082] FAIL: gcc.dg/ipa/pr119318.c execution test

2025-05-03 Thread danglin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120082

--- Comment #2 from John David Anglin  ---
Created attachment 61281
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61281&action=edit
Assembler output

[Bug target/120083] Use vcvtneps2bf16 AVX512BF instruction to convert float to __bf16 on -O3 without needing -Ofast

2025-05-03 Thread mcccs at gmx dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120083

--- Comment #4 from mcccs at gmx dot com ---
By the way Andrew, wouldn't it be more performant to check for sNaN then use
vcvtneps2bf16 instead of completely avoiding vcvtneps2bf16?

[Bug target/120083] Use vcvtneps2bf16 AVX512BF instruction to convert float to __bf16 on -O3 without needing -Ofast

2025-05-03 Thread mcccs at gmx dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120083

--- Comment #5 from mcccs at gmx dot com ---
Ah I see then there's the problem of denormals. I guess I'll report this to
LLVM so that they may cripple naive AI libraries using O3.

[Bug target/120083] Use vcvtneps2bf16 AVX512BF instruction to convert float to __bf16 on -O3 without needing -Ofast

2025-05-03 Thread mcccs at gmx dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120083

--- Comment #6 from mcccs at gmx dot com ---
Thank you, reported https://github.com/llvm/llvm-project/issues/138424

[Bug tree-optimization/120089] [15/16 regression] GCC miscompiles VK-GL-CTS on aarch64 with -O3

2025-05-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120089

--- Comment #5 from Andrew Pinski  ---
Created attachment 61288
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61288&action=edit
Semi more reduced

The copy for vertices is important ...
Also is at.

[Bug tree-optimization/120089] [15/16 regression] GCC miscompiles VK-GL-CTS on aarch64 with -O3

2025-05-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120089

--- Comment #6 from Andrew Pinski  ---
I am starting to think this is an early exit vectorization bug.

THe main reason is the at is important and that causes an early exit

[Bug tree-optimization/120089] [15/16 regression] GCC miscompiles VK-GL-CTS on aarch64 with -O3 since r15-7533-g589d79e6268b05

2025-05-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120089

Andrew Pinski  changed:

   What|Removed |Added

  Attachment #61289|0   |1
is obsolete||

--- Comment #10 from Andrew Pinski  ---
Created attachment 61290
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61290&action=edit
Removed all headers

The only issue is this version is endian depedent still.

[Bug tree-optimization/120089] [15/16 regression] GCC miscompiles VK-GL-CTS on aarch64 with -O3

2025-05-03 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120089

--- Comment #8 from Sam James  ---
I suspect it's r15-7533-g589d79e6268b05.

[Bug tree-optimization/120089] [15/16 regression] GCC miscompiles VK-GL-CTS on aarch64 with -O3 since r15-7533-g589d79e6268b05

2025-05-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120089

Andrew Pinski  changed:

   What|Removed |Added

  Attachment #61287|0   |1
is obsolete||
  Attachment #61290|0   |1
is obsolete||

--- Comment #11 from Andrew Pinski  ---
Created attachment 61291
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61291&action=edit
Self contained endian friendly  version

[Bug tree-optimization/120089] [15/16 regression] GCC miscompiles VK-GL-CTS on aarch64 with -O3 since r15-7533-g589d79e6268b05

2025-05-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120089

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2025-05-04
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW

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

[Bug tree-optimization/120089] [15/16 regression] GCC miscompiles VK-GL-CTS on aarch64 with -O3 since r15-7533-g589d79e6268b05

2025-05-03 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120089

Sam James  changed:

   What|Removed |Added

 Target|aarch64 |aarch64 x86_64

--- Comment #13 from Sam James  ---
(In reply to Andrew Pinski from comment #12)
> Confirmed.

```
$ g++ p2.cxx -O3 -mavx -fno-vect-cost-model -o p2 && ./p2
[i] = 375 expected 875
[i] = 875 expected -625
[i] = 75 expected -75
[i] = 625 expected -375
[i] = 625 expected -875
[i] = 875 expected -125
[i] = 875 expected -625
[i] = 875 expected -125
[i] = 0 expected 375
[i] = 0 expected 875
[i] = 0 expected 75
[i] = 0 expected 625
[i] = 0 expected 625
[i] = 0 expected 875
[i] = 0 expected 875
[i] = 0 expected 875
errors=16
Aborted(core dumped) ./p2
```

[Bug tree-optimization/120089] [15/16 regression] GCC miscompiles VK-GL-CTS on aarch64 with -O3 since r15-7533-g589d79e6268b05

2025-05-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120089

Andrew Pinski  changed:

   What|Removed |Added

  Attachment #61291|0   |1
is obsolete||

--- Comment #14 from Andrew Pinski  ---
Created attachment 61292
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61292&action=edit
Cleaned up some more, removing extra array

[Bug tree-optimization/120089] [15/16 regression] GCC miscompiles VK-GL-CTS on aarch64 with -O3

2025-05-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120089

Andrew Pinski  changed:

   What|Removed |Added

  Attachment #61288|0   |1
is obsolete||

--- Comment #7 from Andrew Pinski  ---
Created attachment 61289
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61289&action=edit
Removal of float

[Bug tree-optimization/120089] [15/16 regression] GCC miscompiles VK-GL-CTS on aarch64 with -O3 since r15-7533-g589d79e6268b05

2025-05-03 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120089

Sam James  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=118852
Summary|[15/16 regression] GCC  |[15/16 regression] GCC
   |miscompiles VK-GL-CTS on|miscompiles VK-GL-CTS on
   |aarch64 with -O3|aarch64 with -O3 since
   ||r15-7533-g589d79e6268b05
 CC||rguenth at gcc dot gnu.org,
   ||tnfchris at gcc dot gnu.org

--- Comment #9 from Sam James  ---
yes

[Bug gcov-profile/120086] FAIL: gcc.misc-tests/gcov-29.c

2025-05-03 Thread j at lambda dot is via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120086

--- Comment #2 from Jørgen Kvalsvik  ---
Interesting. I looked at the attach'd .gcov file and it is filled with these:

paths covered 1 of zu

Does the target not support size_t with printf("%zu")?

[Bug tree-optimization/120089] [15/16 regression] GCC miscompiles VK-GL-CTS (on aarch64) with -O3 since r15-7533-g589d79e6268b05

2025-05-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120089

--- Comment #15 from Andrew Pinski  ---
Connor thanks for the detailed bug report too. It was very very useful.
The reason why I changed it to remove the floating point and most of the C++
code was to make it easier to debug. In this case since the `at` method was
important, it was replaced with:
```
if (vertexIdx > t)
__builtin_trap();
```
Which is the most important part of this loop and is part of the reason why it
is miscompiled.

[Bug target/118008] [14/15/16 regression] ICE when bootstrapping with Go on arm (gen_movdi, at config/arm/arm.md:6296)

2025-05-03 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118008

--- Comment #15 from Sam James  ---
(In reply to mcccs from comment #14)
> I just bootstrapped on aarch64 with --with-arch=armv8-a+fp
> --with-float-abi=hard without any errors

I only saw it on arm(32), not arm64 (aarch64).

[Bug tree-optimization/120089] [15/16 regression] GCC miscompiles VK-GL-CTS (on aarch64) with -O3 since r15-7533-g589d79e6268b05

2025-05-03 Thread cwabbott0 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120089

Connor Abbott  changed:

   What|Removed |Added

 CC||rguenther at suse dot de

--- Comment #16 from Connor Abbott  ---
I've finally finished bisecting this, fwiw.

589d79e6268b055422a7b6c11cd0a8a4f2531a8c is the first bad commit
commit 589d79e6268b055422a7b6c11cd0a8a4f2531a8c
Author: Richard Biener 
Date:   Fri Feb 14 14:48:41 2025 +0100

tree-optimization/118852 - wrong code with 502.gcc_r

502.gcc_r when built with -fprofile-generate exposes a SLP discovery
issue where an IV forced live due to early break is not properly
discovered if its latch def is part of a different IVs SSA cycle.
To mitigate this we have to make sure to create an SLP instance
for the original IV.  Ideally we'd handle all vect_induction_def
the same but this is left for next stage1.

PR tree-optimization/118852
* tree-vect-slp.cc (vect_analyze_slp): For early-break
forced-live IVs make sure we create an appropriate
entry into the SLP graph.

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

 gcc/testsuite/gcc.dg/vect/pr118852.c | 105
+
 gcc/tree-vect-slp.cc |  24 +---
 2 files changed, 126 insertions(+), 3 deletions(-)
 create mode 100644 gcc/testsuite/gcc.dg/vect/pr118852.c

[Bug rust/119641] narrowing Warning during bootstrap in Rust::BIR::PlaceDB::lookup_or_add_variable

2025-05-03 Thread powerboat9.gamer at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119641

--- Comment #4 from Owen A.  ---
(In reply to Thomas Schwinge from comment #3)
> (I haven't checked, but) supposedly fixed in trunk via commit
> r16-237-gbeced835afa3908aa94550d2ca5ee3879a620adb "gccrs: Fix narrowing
> conversion warnings".
> 
> Owen, for next time, to auto-annotate GCC Bugzilla, the correct syntax to
> use in Git log would've been to put "PR rust/119641" into the ChangeLog
> snippet, see .

Ah, alright, sorry about that.

> Given this has been filed with "Version: 15.0", should this be cherry-picked
> into releases/gcc-15 branch as well?

I don't think it would hurt to do so.

[Bug c++/120089] New: GCC miscompiles VK-GL-CTS on aarch64 with -O3

2025-05-03 Thread cwabbott0 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120089

Bug ID: 120089
   Summary: GCC miscompiles VK-GL-CTS on aarch64 with -O3
   Product: gcc
   Version: 15.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: cwabbott0 at gmail dot com
  Target Milestone: ---

Created attachment 61286
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61286&action=edit
reproducer

Since I upgraded to Fedora 42 with GCC 15.1.1, when using -O3 (which is the
default CMake configuration in a release build) GCC miscompiles a function in
https://github.com/KhronosGroup/VK-GL-CTS which results in some Vulkan tests
failing. I've built GCC trunk as of today and it also fails.

I've attached a self-contained reproducer, here's a godbolt link too:
https://godbolt.org/z/arjr31dd1 note that running programs on godbolt compiled
with GCC 15 on aarch64 seems to be broken (even hello world segfaults) so you
can't reproduce the bug on godbolt. However it does show that x86-64 is
unaffected so the bug may be target-specific. The correct output, as seen with
-O2, is:

0 0 0 0 0 0 0 0 0 0 64 191 0 0 96 191 0 0 96 191 0 0 32 191 0 0 32 191 0 0 32
191 0 0 128 190 0 0 96 191 0 0 192 190 0 0 32 191 0 0 0 190 0 0 32 191 0 0 128
62 0 0 96 191 0 0 0 62 0 0 32 191 0 0 192 62 0 0 32 191 0 0 64 63 0 0 96 191 0
0 32 63 0 0 32 191 0 0 96 63 0 0 32 191 0 0 64 191 0 0 192 190 0 0 96 191 0 0 0
190 0 0 32 191 0 0 0 190 0 0 128 190 0 0 192 190 0 0 192 190 0 0 0 190 0 0 0
190 0 0 0 190 0 0 128 62 0 0 192 190 0 0 0 62 0 0 0 190 0 0 192 62 0 0 0 190 0
0 64 63 0 0 192 190 0 0 32 63 0 0 0 190 0 0 96 63 0 0 0 190 0 0 64 191 0 0 0 62
0 0 96 191 0 0 192 62 0 0 32 191 0 0 192 62 0 0 128 190 0 0 0 62 0 0 192 190 0
0 192 62 0 0 0 190 0 0 192 62 0 0 128 62 0 0 0 62 0 0 0 62 0 0 192 62 0 0 192
62 0 0 192 62 0 0 64 63 0 0 0 62 0 0 32 63 0 0 192 62 0 0 96 63 0 0 192 62 0 0
64 191 0 0 32 63 0 0 96 191 0 0 96 63 0 0 32 191 0 0 96 63 0 0 128 190 0 0 32
63 0 0 192 190 0 0 96 63 0 0 0 190 0 0 96 63 0 0 128 62 0 0 32 63 0 0 0 62 0 0
96 63 0 0 192 62 0 0 96 63 0 0 64 63 0 0 32 63 0 0 32 63 0 0 96 63 0 0 96 63 0
0 96 63

but when miscompiled it outputs:

0 0 0 0 0 0 0 0 0 0 64 191 0 0 96 191 0 0 96 191 0 0 32 191 0 0 32 191 0 0 32
191 0 0 128 190 0 0 96 191 0 0 192 190 0 0 32 191 0 0 0 190 0 0 32 191 0 0 128
62 0 0 96 191 0 0 0 62 0 0 32 191 0 0 192 62 0 0 32 191 0 0 64 63 0 0 96 191 0
0 32 63 0 0 32 191 0 0 192 62 0 0 96 63 0 0 64 63 0 0 32 63 0 0 32 63 0 0 96 63
0 0 96 63 0 0 96 63 0 0 128 190 0 0 192 190 0 0 192 190 0 0 0 190 0 0 0 190 0 0
0 190 0 0 128 62 0 0 192 190 0 0 0 62 0 0 0 190 0 0 192 62 0 0 0 190 0 0 64 63
0 0 192 190 0 0 32 63 0 0 0 190 0 0 96 63 0 0 0 190 0 0 64 191 0 0 0 62 0 0 96
191 0 0 192 62 0 0 32 191 0 0 192 62 0 0 128 190 0 0 0 62 0 0 192 190 0 0 192
62 0 0 0 190 0 0 192 62 0 0 128 62 0 0 0 62 0 0 0 62 0 0 192 62 0 0 192 62 0 0
192 62 0 0 64 63 0 0 0 62 0 0 32 63 0 0 192 62 0 0 96 63 0 0 192 62 0 0 64 191
0 0 32 63 0 0 96 191 0 0 96 63 0 0 32 191 0 0 96 63 0 0 128 190 0 0 32 63 0 0
192 190 0 0 96 63 0 0 0 190 0 0 96 63 0 0 128 62 0 0 32 63 0 0 0 62 0 0 96 63 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

with the last few bytes being replaced with 0's.

The reproducer is based on
https://github.com/KhronosGroup/VK-GL-CTS/blob/b2b40c06daf915417234ebbe64b2ec7580a2c1be/external/vulkancts/modules/vulkan/pipeline/vktPipelineInputAttributeOffsetTests.cpp#L178
with inputs taken from one of the failing tests.

[Bug c++/120089] [15/16 regression] GCC miscompiles VK-GL-CTS on aarch64 with -O3

2025-05-03 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120089

Sam James  changed:

   What|Removed |Added

   Keywords||wrong-code
   Target Milestone|--- |15.2
Summary|GCC miscompiles VK-GL-CTS   |[15/16 regression] GCC
   |on aarch64 with -O3 |miscompiles VK-GL-CTS on
   ||aarch64 with -O3

[Bug c++/120089] [15/16 regression] GCC miscompiles VK-GL-CTS on aarch64 with -O3

2025-05-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120089

--- Comment #2 from Andrew Pinski  ---
Created attachment 61287
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61287&action=edit
Self checking

[Bug c++/120089] [15/16 regression] GCC miscompiles VK-GL-CTS on aarch64 with -O3

2025-05-03 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120089

--- Comment #1 from Sam James  ---
$ git diff --word-diff --no-index <(g++ p.cxx -O2 -o p-O2 && ./p-O2) <(g++
p.cxx -O3 -o p-O3 && ./p-O3)
diff --git a/dev/fd/63 b/dev/fd/62
--- a/dev/fd/63
+++ b/dev/fd/62
@@ -1 +1 @@
0 0 0 0 0 0 0 0 0 0 64 191 0 0 96 191 0 0 96 191 0 0 32 191 0 0 32 191 0 0 32
191 0 0 128 190 0 0 96 191 0 0 192 190 0 0 32 191 0 0 0 190 0 0 32 191 0 0 128
62 0 0 96 191 0 0 0 62 0 0 32 191 0 0 192 62 0 0 32 191 0 0 64 63 0 0 96 191 0
0 32 63 0 0 32 191 0 0 [-96 63-]{+192 62+} 0 0 [-32 191-]{+96 63+} 0 0 64 [-191
0 0 192 190-]{+63+} 0 0 [-96 191-]{+32 63+} 0 0 {+32 63+} 0[-190-] 0 {+96 63+}
0[-32 191-] 0 {+96 63+} 0 0 [-190-]{+96 63+} 0 0 128 190 0 0 192 190 0 0 192
190 0 0 0 190 0 0 0 190 0 0 0 190 0 0 128 62 0 0 192 190 0 0 0 62 0 0 0 190 0 0
192 62 0 0 0 190 0 0 64 63 0 0 192 190 0 0 32 63 0 0 0 190 0 0 96 63 0 0 0 190
0 0 64 191 0 0 0 62 0 0 96 191 0 0 192 62 0 0 32 191 0 0 192 62 0 0 128 190 0 0
0 62 0 0 192 190 0 0 192 62 0 0 0 190 0 0 192 62 0 0 128 62 0 0 0 62 0 0 0 62 0
0 192 62 0 0 192 62 0 0 192 62 0 0 64 63 0 0 0 62 0 0 32 63 0 0 192 62 0 0 96
63 0 0 192 62 0 0 64 191 0 0 32 63 0 0 96 191 0 0 96 63 0 0 32 191 0 0 96 63 0
0 128 190 0 0 32 63 0 0 192 190 0 0 96 63 0 0 0 190 0 0 96 63 0 0 128 62 0 0 32
63 0 0 0 62 0 0 96 63 0 0[-192 62-] 0 0[-96 63-] 0 0[-64 63-] 0 0[-32 63-] 0
0[-32 63-] 0 0[-96 63-] 0 0[-96 63-] 0 0 [-96 63-]{+0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0+}

[Bug fortran/120049] ICE when using IS_C_ASSOCIATED ()

2025-05-03 Thread jvdelisle at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120049

--- Comment #10 from Jerry DeLisle  ---
I have a patch now that addresses the original problem and regression tests
fine whcih I will submit to the gfortran list. Before I do that I want to
explore these other cases given in Comment #8.

[Bug libstdc++/120088] New: Use of uninitialized value in constant expression when copy-constructing a std::expected from another copy-assigned non-erroneous std::expected

2025-05-03 Thread eddiejnolan at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120088

Bug ID: 120088
   Summary: Use of uninitialized value in constant expression when
copy-constructing a std::expected from
another copy-assigned non-erroneous std::expected
   Product: gcc
   Version: 15.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: eddiejnolan at gmail dot com
  Target Milestone: ---

Clang and EDG both reject the following when building with libstdc++:

#include 

constexpr bool quux() {
  std::expected foo1{std::unexpected{0}};
  std::expected foo2{};
  foo1 = foo2;
  [[maybe_unused]] std::expected foo3{foo1};
  return true;
}

static_assert(quux());

Both of them complain about accessing an uninitialized object in a constant
expression, which Clang specifically flags as `_Er _M_unex;`.

Compiler Explorer link: https://godbolt.org/z/4ndvWfMMs

[Bug tree-optimization/111276] rewrite_to_defined_overflow rewrites already defined code

2025-05-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111276

Andrew Pinski  changed:

   What|Removed |Added

   Keywords|patch   |
URL|https://gcc.gnu.org/piperma |
   |il/gcc-patches/2023-Septemb |
   |er/629171.html  |

--- Comment #7 from Andrew Pinski  ---
So with my new patch now (since the variable sharing issue is fixed), I am
running into:
+FAIL: gcc.dg/Wrestrict-22.c  (test for warnings, line 8)

r11-4135-ge864d395b4e862 added the testcase:
```
/* { dg-options "-O2 -Wrestrict" } */

void test_memcpy_warn (char *d, unsigned n)
{
  for (unsigned i = n; i < 30; ++i)
if (i > 10)
  __builtin_memcpy (d, d + 2, i); /* { dg-warning "overlaps" } */
}

```

So we started to pull out of the loop `d+2` and (with my patch rewriting it
since it is a conditional) since r16-190-g6901d56fea2132 .

This is why I didn't see it before even. I wonder if the compute_invariantness
change should take into account conditional expressions ...

[Bug ipa/98925] Extend ipa-prop to handle return functions for slot optimization

2025-05-03 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98925

--- Comment #4 from Sam James  ---
(In reply to Jan Hubicka from comment #3)
> Return value range propagation was added in
> r:53ba8d669550d3a1f809048428b97ca607f95cf5
> 
> however it works on scalar return values only for now. Extending it to
> aggregates is a logical next step and should not be terribly hard.
> 

https://inbox.sourceware.org/gcc/f7a09530-adf2-4e32-9799-94c767e19...@nvidia.com/

> The code also misses logic for IPA streaming so it works only in ealry and
> late opts.

r15-9522-geabba7be040e81

[Bug tree-optimization/120089] [15/16 regression] GCC miscompiles VK-GL-CTS on aarch64 with -O3

2025-05-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120089

--- Comment #3 from Andrew Pinski  ---
>note that running programs on godbolt compiled with GCC 15 on aarch64 seems to 
>be broken

Note using -static allows to run on godbolt just fine :).

[Bug tree-optimization/120089] [15/16 regression] GCC miscompiles VK-GL-CTS on aarch64 with -O3

2025-05-03 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120089

--- Comment #4 from Sam James  ---
-fno-tree-vectorize works

[Bug tree-optimization/120074] [15/16 regression] ICE on valid code at -O1 with "-fno-tree-copy-prop -fno-tree-forwprop -fno-tree-ccp" on x86_64-linux-gnu: in decompose, at wide-int.h:1049 since r15-6

2025-05-03 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120074

--- Comment #4 from Jakub Jelinek  ---
I wonder about:
--- gcc/gimple-fold.cc.jj   2025-04-21 17:04:48.0 +0200
+++ gcc/gimple-fold.cc  2025-05-03 12:43:29.643908582 +0200
@@ -8337,7 +8337,8 @@ fold_truth_andor_for_ifcombine (enum tre
  if (!lr_and_mask.get_precision ())
lr_and_mask = sign;
  else
-   lr_and_mask &= sign;
+   lr_and_mask &= wide_int::from (sign, lr_and_mask.get_precision (),
+  UNSIGNED);
  if (l_const.get_precision ())
l_const &= wide_int::from (lr_and_mask,
   l_const.get_precision (), UNSIGNED);
@@ -8358,7 +8359,8 @@ fold_truth_andor_for_ifcombine (enum tre
  if (!rr_and_mask.get_precision ())
rr_and_mask = sign;
  else
-   rr_and_mask &= sign;
+   rr_and_mask &= wide_int::from (sign, rr_and_mask.get_precision (),
+  UNSIGNED);
  if (r_const.get_precision ())
r_const &= wide_int::from (rr_and_mask,
   r_const.get_precision (), UNSIGNED);
@@ -8762,7 +8764,7 @@ fold_truth_andor_for_ifcombine (enum tre
   wide_int lr_mask, rr_mask;
   if (lr_and_mask.get_precision ())
lr_mask = wi::lshift (wide_int::from (lr_and_mask, rnprec, UNSIGNED),
- xlr_bitpos);
+ xlr_bitpos);
   else
lr_mask = wi::shifted_mask (xlr_bitpos, lr_bitsize, false, rnprec);
   if (rr_and_mask.get_precision ())

which fixes the ICE (and we punt later on on the 
  if (ll_bitsize != lr_bitsize || rl_bitsize != rr_bitsize
test because ll_bitsize and rl_bitsize are 16 while lr_bitsize and rr_bitsize
are 32.
The &= sign works only if they have the same bitsize.

[Bug target/120070] [15/16 regression] m68k-linux-gnu-gcc -Os ICE segfault compiling xfs_trans_ail.c

2025-05-03 Thread mikpelinux at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120070

Mikael Pettersson  changed:

   What|Removed |Added

 CC||mikpelinux at gmail dot com

--- Comment #4 from Mikael Pettersson  ---
Bisected between 14.2.0 (old/good) and 15.1.0 (new/bad).

9cebf1234b88e55a04071bd55c9ec4e22c0899e6 is the first new commit
commit 9cebf1234b88e55a04071bd55c9ec4e22c0899e6 (HEAD)
Author: Jeff Law 
Date:   Tue Mar 11 18:01:33 2025 -0600

Revert "[rtl-optimization/117467] Avoid unnecessarily marking things live
in ext-dce"

This reverts commit 4ed07a11ee2845c2085a3cd5cff043209a452441.

 gcc/ext-dce.cc | 12