From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id B3CA53858D29 for ; Tue, 15 Dec 2020 23:20:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B3CA53858D29 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-357-YkiPdsZcN6OnCiuux28vDw-1; Tue, 15 Dec 2020 18:20:37 -0500 X-MC-Unique: YkiPdsZcN6OnCiuux28vDw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 42A03801B2B; Tue, 15 Dec 2020 23:20:36 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-161.phx2.redhat.com [10.3.112.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0B9695D6A1; Tue, 15 Dec 2020 23:20:34 +0000 (UTC) Subject: Re: [PATCH] genemit: Handle `const_double_zero' rtx To: "Maciej W. Rozycki" , gcc-patches@gcc.gnu.org Cc: Paul Koning , =?UTF-8?Q?Martin_Li=c5=a1ka?= References: From: Jeff Law Message-ID: <16ae1e4f-df95-b403-95d4-68708508c858@redhat.com> Date: Tue, 15 Dec 2020 16:20:34 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2020 23:20:43 -0000 On 12/15/20 1:38 PM, Maciej W. Rozycki wrote: > Complement commit 20ab43b5cad6 ("RTL: Add `const_double_zero' syntactic > rtx") and remove a commit c60d0736dff7 ("PDP11: Use `const_double_zero' > to express double zero constant") build regression observed with the > `pdp11-aout' target: > > genemit: Internal error: abort in gen_exp, at genemit.c:202 > make[2]: *** [Makefile:2427: s-emit] Error 1 > > where a: > > (const_double 0 [0] 0 [0] 0 [0] 0 [0]) > > rtx coming from: > > (parallel [ > (set (reg:CC 16) > (compare:CC (abs:DF (match_operand:DF 1 ("general_operand") ("0,0"))) > (const_double 0 [0] 0 [0] 0 [0] 0 [0]))) > (set (match_operand:DF 0 ("nonimmediate_operand") ("=fR,Q")) > (abs:DF (match_dup 1))) > ]) > > and ultimately `(const_double_zero)' referred in a named RTL insn cannot > be interpreted. Handle the rtx then by supplying the constant 0 double > operand requested, resulting in the following update to insn-emit.c code > produced for the `pdp11-aout' target, relative to before the triggering > commit: > > @@ -1514,7 +1514,7 @@ gen_absdf2_cc (rtx operand0 ATTRIBUTE_UN > gen_rtx_COMPARE (CCmode, > gen_rtx_ABS (DFmode, > operand1), > - const0_rtx)), > + CONST_DOUBLE_ATOF ("0", VOIDmode))), > gen_rtx_SET (operand0, > gen_rtx_ABS (DFmode, > copy_rtx (operand1))))); > @@ -1555,7 +1555,7 @@ gen_negdf2_cc (rtx operand0 ATTRIBUTE_UN > gen_rtx_COMPARE (CCmode, > gen_rtx_NEG (DFmode, > operand1), > - const0_rtx)), > + CONST_DOUBLE_ATOF ("0", VOIDmode))), > gen_rtx_SET (operand0, > gen_rtx_NEG (DFmode, > copy_rtx (operand1))))); > @@ -1790,7 +1790,7 @@ gen_muldf3_cc (rtx operand0 ATTRIBUTE_UN > gen_rtx_MULT (DFmode, > operand1, > operand2), > - const0_rtx)), > + CONST_DOUBLE_ATOF ("0", VOIDmode))), > gen_rtx_SET (operand0, > gen_rtx_MULT (DFmode, > copy_rtx (operand1), > @@ -1942,7 +1942,7 @@ gen_divdf3_cc (rtx operand0 ATTRIBUTE_UN > gen_rtx_DIV (DFmode, > operand1, > operand2), > - const0_rtx)), > + CONST_DOUBLE_ATOF ("0", VOIDmode))), > gen_rtx_SET (operand0, > gen_rtx_DIV (DFmode, > copy_rtx (operand1), > > gcc/ > * genemit.c (gen_exp) : Handle `const_double_zero' > rtx. > --- > Hi, > > I have verified this with a bootstrap of a `powerpc64le-linux-gnu' native > compiler, and that it builds a `pdp11-aout' cross-compiler up to the point > of failing to find target headers. I have no means to verify it further, > the target configuration is too exotic to me, so I will appreciate help. > > NB this only triggers with insn-emit.c code produced from named RTL insns > for the purpose of calling them directly, which does not apply for the VAX > backend, as it does not give names to any insns using `const_double_zero'. > Which is why I didn't spot this issue with all my VAX verification. > > Thanks to Martin for bringing my attention to this regression, and sorry > to miss this in testing. > > OK to apply? Presumably you can't use CONST0_RTX (mode) here?  Assuming that's the case, then this is fine. jeff