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 [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 297003858C53 for ; Mon, 10 Oct 2022 07:40:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 297003858C53 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665387622; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OQlpDDpG92HsSZBonR/gF7l/JxnsZm8Y88OcNowENlA=; b=HKKah9mb3C/ltqWhFa2sDwctybBQtDCK9CIC59OeXgZ/NFdNpr3wuiaQoPZcY5aTmrDOic 1tuJ9zjYMCsATjxnjslJsGfZMu59V63VaIYVkScX4hMtUiwfWntGM+y1J4aiCK+bkFPVpm uDo8oqN0cMS8u07oqhROdTPXk+xm3x0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-347-Jgc_IhCoMK-OzsdhzeoJsQ-1; Mon, 10 Oct 2022 03:40:19 -0400 X-MC-Unique: Jgc_IhCoMK-OzsdhzeoJsQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2FBD695D685; Mon, 10 Oct 2022 07:40:19 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.55]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E2D5F145D825; Mon, 10 Oct 2022 07:40:18 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 29A7eFwi3162524 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 10 Oct 2022 09:40:16 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 29A7eEUo3162523; Mon, 10 Oct 2022 09:40:14 +0200 Date: Mon, 10 Oct 2022 09:40:14 +0200 From: Jakub Jelinek To: Tobias Burnus Cc: gcc-patches , fortran Subject: [committed] openmp, fortran: Fix up IFN_ASSUME call Message-ID: Reply-To: Jakub Jelinek References: <81064796-39af-cf76-d551-e990e48920ed@codesourcery.com> MIME-Version: 1.0 In-Reply-To: <81064796-39af-cf76-d551-e990e48920ed@codesourcery.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=unavailable 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 Thu, Oct 06, 2022 at 06:15:52PM +0200, Tobias Burnus wrote: > Like as attached? – It did survive regtesting. Like in other spots in trans-openmp.cc that create a TARGET_EXPR, the slot has to be created with create_tmp_var_raw, because gfc_create_var adds the var to BLOCK_VARS and that ICEs during expansion because gimple_add_tmp_var_fn has: gcc_assert (!DECL_CHAIN (tmp) && !DECL_SEEN_IN_BIND_EXPR_P (tmp)); assertion. Also, both C/C++ ensure the argument to IFN_ASSUME has boolean_type_node, it is easier if Fortran does that too. Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk. 2022-10-10 Jakub Jelinek * trans-openmp.cc (gfc_trans_omp_assume): Use create_tmp_var_raw instead of gfc_create_var for TARGET_EXPR slot creation. Create it with boolean_type_node and convert. --- gcc/fortran/trans-openmp.cc.jj 2022-10-07 00:13:12.508191601 +0200 +++ gcc/fortran/trans-openmp.cc 2022-10-09 14:17:55.430364168 +0200 @@ -4588,11 +4588,14 @@ gfc_trans_omp_assume (gfc_code *code) t = se.expr; else { - tree var = gfc_create_var (TREE_TYPE (se.expr), NULL); + tree var = create_tmp_var_raw (boolean_type_node); + DECL_CONTEXT (var) = current_function_decl; stmtblock_t block2; gfc_init_block (&block2); gfc_add_block_to_block (&block2, &se.pre); - gfc_add_modify_loc (loc, &block2, var, se.expr); + gfc_add_modify_loc (loc, &block2, var, + fold_convert_loc (loc, boolean_type_node, + se.expr)); gfc_add_block_to_block (&block2, &se.post); t = gfc_finish_block (&block2); t = build4 (TARGET_EXPR, boolean_type_node, var, t, NULL, NULL); Jakub