From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by sourceware.org (Postfix) with ESMTPS id 588A03858C2B for ; Wed, 20 Sep 2023 14:02:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 588A03858C2B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=ispras.ru Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ispras.ru Received: from [10.10.3.121] (unknown [10.10.3.121]) by mail.ispras.ru (Postfix) with ESMTPS id 7E96540F1DD0; Wed, 20 Sep 2023 14:02:36 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru 7E96540F1DD0 Date: Wed, 20 Sep 2023 17:02:36 +0300 (MSK) From: Alexander Monakov To: Richard Biener cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH][RFC] middle-end/106811 - document GENERIC/GIMPLE undefined behavior In-Reply-To: <20230915115010.D2F8513251@imap2.suse-dmz.suse.de> Message-ID: <03d3441f-973e-5f70-741c-a7cb4db94876@ispras.ru> References: <20230915115010.D2F8513251@imap2.suse-dmz.suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, 15 Sep 2023, Richard Biener via Gcc-patches wrote: > +@itemize @bullet > +@item > +When the result of negation, addition, subtraction or division of two signed > +integers or signed integer vectors not subject to @option{-fwrapv} cannot be > +represented in the type. It would be a bit awkward to add 'or vectors' everywhere it applies, perhaps say something general about elementwise vector operations up front? > + > +@item > +The value of the second operand of any of the division or modulo operators > +is zero. > + > +@item > +When incrementing or decrementing a pointer not subject to > +@option{-fwrapv-pointer} wraps around zero. > + > +@item > +An expression is shifted by a negative number or by an amount greater > +than or equal to the width of the shifted operand. > + > +@item > +Pointers that do not point to the same object are compared using > +relational operators. This does not apply to '==' and '!='. Maybe say Ordered comparison operators are applied to pointers that do not point to the same object. > + > +@item > +An object which has been modified is accessed through a restrict-qualified > +pointer and another pointer that are not both based on the same object. > + > +@item > +The @} that terminates a function is reached, and the value of the function > +call is used by the caller. > + > +@item > +When program execution reaches __builtin_unreachable. > + > +@item > +When an object has its stored value accessed by an lvalue that > +does not have one of the following types: > +@itemize @minus > +@item > +a (qualified) type compatible with the effective type of the object > +@item > +a type that is the (qualified) signed or unsigned type corresponding to > +the effective type of the object > +@item > +a character type, a ref-all qualified type or a type subject to > +@option{-fno-strict-aliasing} > +@item > +a pointer to void with the same level of indirection as the accessed > +pointer object > +@end itemize This list seems to miss a clause that allows aliasing between scalar types and their vector counterparts? Thanks. Alexander