From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E335B3858D33; Thu, 4 May 2023 14:21:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E335B3858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683210113; bh=rqtrChBmKcY3G4ivpA4whNJjlS7shqa4x8TQGzkwdAI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=AT+m/cAwboHC0W55Q62UjuNeeK9YCUlyb49Jib9ULpWQ/rPsczrIJl1rM045x9VFu PKS7ZfwkfRqUueAd0JF+60h9IX6S6m5n0al/GBanuEFggLxnKG3rCIKZEBdlFumIOY YVg2tlXZ4BHce71AffbISGhD7uE9X+TM+IIZe4Eo= From: "marxin at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109732] [14 regression] gcc miscompiles iterator comparison on nlohmann_json since r14-204-gf1f5cbaa3f716f Date: Thu, 04 May 2023 14:21:53 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: marxin at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pinskia at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 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=3D109732 --- Comment #9 from Martin Li=C5=A1ka --- I've got a C++ reduced test-case: $ cat x.ii template struct is_same; template using enable_if_t =3D _Tp; template struct reverse_iterator { _Iterator current; typedef _Iterator iterator_type; reverse_iterator(iterator_type __x) : current(__x) {} iterator_type base() { return current; } }; template bool operator=3D=3D(reverse_iterator<_Iterator> __x, reverse_iterator<_Iterator> __y) { return __x.base() =3D=3D __y.base(); } struct __normal_iterator { int _M_current; }; template struct __new_allocator; template struct allocator_traits; template struct allocator_traits<__new_allocator<_Tp>> { using const_pointer =3D _Tp *; }; template struct vector { typedef __normal_iterator iterator; }; namespace { enum value_t { null, object, array, string }; template