public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/107387] New: gcc trunk -O2 crashes when enable UBSan
@ 2022-10-24 20:38 shaohua.li at inf dot ethz.ch
  2022-10-24 20:42 ` [Bug c/107387] [13 Regression] " mpolacek at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: shaohua.li at inf dot ethz.ch @ 2022-10-24 20:38 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107387
           Summary: gcc trunk -O2 crashes when enable UBSan
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: shaohua.li at inf dot ethz.ch
  Target Milestone: ---

% gcc-tk -v
Using built-in specs.
COLLECT_GCC=gcc-tk
COLLECT_LTO_WRAPPER=/zdata/shaoli/compilers/ccbuilder-compilers/gcc-99da523359e9333555585484eb3b8f854a98f1b4/libexec/gcc/x86_64-pc-linux-gnu/13.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --disable-multilib --disable-bootstrap
--enable-languages=c,c++
--prefix=/zdata/shaoli/compilers/ccbuilder-compilers/gcc-99da523359e9333555585484eb3b8f854a98f1b4
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 13.0.0 20221013 (experimental) (GCC)
%
% gcc-tk -fsanitize=undefined -O2 a.c
a.c: In function ‘m’:
a.c:8:59: warning: division by zero [-Wdiv-by-zero]
    8 | static inline __attribute__((always_inline)) void m() { 0 / 0; }
      |                                                           ^
during GIMPLE pass: slp
a.c: In function ‘p.isra’:
a.c:31:7: internal compiler error: in to_sreal_scale, at profile-count.cc:339
   31 | void *p() {
      |       ^
0x2059aee internal_error(char const*, ...)
        ???:0
0x99f3c4 fancy_abort(char const*, int, char const*)
        ???:0
0x1310657 vect_optimize_slp_pass::start_choosing_layouts()
        ???:0
0x13118af vect_optimize_slp_pass::run()
        ???:0
0x1319cd9 vect_slp_function(function*)
        ???:0
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.
%
% cat a.c
int a, b, c, e, k;
char *d;
struct {
  short f;
  short g;
} l;
static int h = 1;
static inline __attribute__((always_inline)) void m() { 0 / 0; }
static int n() { return a && b && a < b ?: b; }
static int *o();
static void *p();
static unsigned short q(int);
void r() {
  p();
  o(&a);
  m();
}

int *o(int *s) {
    *s = n();
}

unsigned short q(int s) {
  if (s) {
    int i = 0;
    for (; i < 7;)
      i = 7;
    k = n();
  }
}
void *p() {
  int i, j;
  char *t[81];
  for (; i < 8; i++)
    for (; j; j++)
      t[e] = d;
  q(h);
  if (c)
    l.g = l.f = 0;
}
%

Compiler explorer: https://godbolt.org/z/qEWr71vbd

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-10-26  9:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-24 20:38 [Bug c/107387] New: gcc trunk -O2 crashes when enable UBSan shaohua.li at inf dot ethz.ch
2022-10-24 20:42 ` [Bug c/107387] [13 Regression] " mpolacek at gcc dot gnu.org
2022-10-24 20:44 ` [Bug tree-optimization/107387] " mpolacek at gcc dot gnu.org
2022-10-25  7:01 ` [Bug tree-optimization/107387] [13 Regression] gcc trunk -O2 crashes when enable UBSan since r13-2288-g61c4c989034548 rguenth at gcc dot gnu.org
2022-10-25  9:06 ` rsandifo at gcc dot gnu.org
2022-10-26  9:07 ` rsandifo at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).