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

            Bug ID: 123803
           Summary: [16 Regression] gmp-6.3.0 ICE during GIMPLE pass:
                    slsr: verify_gimple failed since
                    r16-7002-g8ae508ca5a3cf5
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: slyfox at gcc dot gnu.org
  Target Milestone: ---

Noticed ICE on gmp-6.3.0 on r16-7002-g8ae508ca5a3cf5 (bisected)

cvise came up with this reproducer:

long __gmpn_add___gmp_wp, __gmpn_cpuvec_0_n;
long *__gmpn_cpuvec_0_xp;
void __gmpn_add_n();
__inline__ void __gmpn_add(long *__gmp_xp, long *__gmp_yp) {
  __gmpn_add_n(__gmp_yp);
  if (__gmp_xp) {
    __gmpn_add___gmp_wp = 0;
  }
}
void(__gmpn_cpuvec_0)() {
  __gmpn_add(__gmpn_cpuvec_0_xp + __gmpn_cpuvec_0_n,
             __gmpn_cpuvec_0_xp + 3 * __gmpn_cpuvec_0_n);
}

Crashing:

$ gcc/xgcc -Bgcc -c bug.c -o bug.o -O1  -std=gnu17 -fno-strict-overflow
bug.c: In function ‘__gmpn_cpuvec_0’:
bug.c:10:6: error: type mismatch in ‘pointer_plus_expr’
   10 | void(__gmpn_cpuvec_0)() {
      |      ^~~~~~~~~~~~~~~
long int *

long int *

long int *

_8 = _5 + _15;
during GIMPLE pass: slsr
bug.c:10:6: internal compiler error: verify_gimple failed
0x267c740 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
        ???:0
0x266e922 internal_error(char const*, ...)
        ???:0
0x10fe903 verify_gimple_in_cfg(function*, bool, bool)
        ???:0
0xf48997 execute_function_todo(function*, void*)
        ???:0
0xf48f54 do_per_function(void (*)(function*, void*), void*)
        ???:0
0xf490c9 execute_todo(unsigned int)
        ???:0
gcc/cc1 -quiet -iprefix /tmp/gb/gcc/../lib/gcc/x86_64-pc-linux-gnu/16.0.1/
-isystem gcc/include -isystem gcc/include-fixed bug.c -quiet -dumpbase bug.c
-dumpbase-ext .c -mtune=generic -march=x86-64 -O1 -std=gnu17
-fno-strict-overflow -o /tmp/nix-shell-3883204-4234974516/cc7AiBbp.s
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

Reply via email to