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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-06-10
          Component|target                      |tree-optimization

--- Comment #4 from Uroš Bizjak <ubizjak at gmail dot com> ---
I can hit ICE with the following testcase:

--cut here--
#include <stddef.h>
#include <stdint.h>

char *
test (char *string, size_t maxlen)
{
  string[0] = '\0';
  uintptr_t end;

  if (__builtin_add_overflow ((uintptr_t) string, maxlen, &end))
    end = -1;

  return (char *) end;
}
--cut here--

gcc -O2:

saddt.c: In function ‘test’:
saddt.c:18:1: error: definition in block 4 follows the use
   18 | test (char *string, size_t maxlen)
      | ^~~~
for SSA_NAME: _4 in statement:
prephitmp_13 = (char *) _4;
during GIMPLE pass: widening_mul
saddt.c:18:1: internal compiler error: verify_ssa failed
0x12850a0 verify_ssa(bool, bool)
        ../../git/gcc/gcc/tree-ssa.cc:1203
0xed8255 execute_function_todo
        ../../git/gcc/gcc/passes.cc:2096
0xed86be execute_todo
        ../../git/gcc/gcc/passes.cc:2143

xgcc (GCC) 15.0.0 20240610 (experimental) [master r15-1126-gc1429e3a8da]

Confirmed as a tree-optimization problem with the new .SAT_ADD conversion pass.

Reply via email to