From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4090F3858D33; Wed, 22 Feb 2023 16:16:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4090F3858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677082575; bh=yLvMooiIMHuCUGWTn31TxF7KGwsbMLNctBAyrGU/IZM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LXLaOE/i3vQk93E42G5+sEvIdxKNJisYsGycAwTZfKCuSG6WCRWuZZjwzBlTMImou 1b2PE82znohbGgEBKAK++bKXsJ+vSJqTAcda/3eqkNe6idldQs3gpTZ756v7Ww/YMU LnMw5oQxmrMKHLUmcfnNU+DaK1AOn4Li1X4joqcU= From: "mpolacek at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/108880] [11/12/13 Regression] slow compilation with "-fsanitize=undefined" Date: Wed, 22 Feb 2023 16:16:14 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: compile-time-hog X-Bugzilla-Severity: normal X-Bugzilla-Who: mpolacek at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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=3D108880 --- Comment #7 from Marek Polacek --- The C90/C99 difference is due to ubsan_instrument_shift: 193 /* For signed x << y, in C99 and later, the following: 194 (unsigned) x >> (uprecm1 - y) 195 if non-zero, is undefined. */ 196 else if (code =3D=3D LSHIFT_EXPR && flag_isoc99 && cxx_dialect < cxx1= 1) 197 { 198 tree x =3D fold_build2 (MINUS_EXPR, op1_utype, uprecm1, 199 fold_convert (op1_utype, unshare_expr (op1)= ));=