From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1F416385840A; Mon, 24 Oct 2022 20:38:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1F416385840A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666643926; bh=l6LCKfcSFgDQqj5pq866z+r55hxw2ufEYzQlespPMKE=; h=From:To:Subject:Date:From; b=WzVIJdKY4w33RpuKFNL+Rq2hyjWOi7hMkyWkI0gFMNRuB3Gdra/XalLfzmFhdttEW at1qjt99ZSKMJYwbh3HEyYavoIW1RTMVi6Zcj1cxdgk7yBR1k8cj1T7J/8sCbm4xX8 F4LCyFPSfbfAXlXvHwakPb+aSLOeGthPU6C5ckbI= From: "shaohua.li at inf dot ethz.ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/107387] New: gcc trunk -O2 crashes when enable UBSan Date: Mon, 24 Oct 2022 20:38:45 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: shaohua.li at inf dot ethz.ch X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107387 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=3Dgcc-tk COLLECT_LTO_WRAPPER=3D/zdata/shaoli/compilers/ccbuilder-compilers/gcc-99da5= 23359e9333555585484eb3b8f854a98f1b4/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=3Dc,c++ --prefix=3D/zdata/shaoli/compilers/ccbuilder-compilers/gcc-99da523359e93335= 55585484eb3b8f854a98f1b4 Thread model: posix Supported LTO compression algorithms: zlib gcc version 13.0.0 20221013 (experimental) (GCC) % % gcc-tk -fsanitize=3Dundefined -O2 a.c a.c: In function =E2=80=98m=E2=80=99: 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 =E2=80=98p.isra=E2=80=99: a.c:31:7: internal compiler error: in to_sreal_scale, at profile-count.cc:3= 39 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 for instructions. % % cat a.c int a, b, c, e, k; char *d; struct { short f; short g; } l; static int h =3D 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 =3D n(); } unsigned short q(int s) { if (s) { int i =3D 0; for (; i < 7;) i =3D 7; k =3D n(); } } void *p() { int i, j; char *t[81]; for (; i < 8; i++) for (; j; j++) t[e] =3D d; q(h); if (c) l.g =3D l.f =3D 0; } % Compiler explorer: https://godbolt.org/z/qEWr71vbd=