Message ID | ZW2CrlKlvGbe8zpT@tucnak |
---|---|
State | Unresolved |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp2605325vqy; Sun, 3 Dec 2023 23:42:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IHRCUeHBXlBaV7Uo4OpT9kTcPCLtN99qtj9ULAp4Z6AJUYNLvaUYGFdy7U1nAhPn3ASJA+V X-Received: by 2002:a05:622a:1485:b0:41e:2037:72b6 with SMTP id t5-20020a05622a148500b0041e203772b6mr6232361qtx.40.1701675724205; Sun, 03 Dec 2023 23:42:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701675724; cv=pass; d=google.com; s=arc-20160816; b=Qp8sbLrYuHbCnRq42SC2bDhIYIv9WwicDsPFhmE2LatesVVXsFytRkY/OWE5HcsOL4 uDy92W6lwb6HD0v8rIHVQtVlTVBU8quxpopAy5+CuTFKmKq8RO7xhWLyW2OfqbXFxqqW SfLVQhqZUIPcGRymJFgHOLc+x0c00f6ZFKu0moZkWy0Sp4eot5RiwR/aBr4OtASm2JZm dC+7Q5+xS5R9RwtphmHPYOuRASHQ7L5SekjgJDqhPqwbbs61lnor3v6+S77QXRA18b44 DrTSPNeTO1bQjkq7h4I2b2Jw7GzfaMyaE+jYyqviROYeExMEiWJSJUfKpKpI6FyDhzfP 43Og== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:reply-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=ctHrdyWqHM/06jxsabjAGBFNwZC0heExRRZJxBE3Dtw=; fh=h2iPLTLlSKmpj4PWOaJAO8af6hiH/htLInOT1vU8M+E=; b=0Q52qPmK+u4EuRqdDwJvzueVgTOpBJlOsVRoKSOm34GRUaGOWzH1ux9SFExjX/jhGI 6Avs9SCrFRZQHh61/Lbj8a58lkBlzIVcceY0vx81gsjQbADqbooUdgjb+3qcoh18Elgy tlzCNgB1Wl5HZm3Px6Pwlf07f0tHUv23tEh06Lll2/fXXjwzP8UgeOrjm9WKtZwSSqWC VASoK+eAPrGpZM9G1zpqv4wuTsau9cRWWc+TNeEGktrMHL+NAz6pO3PP3B0Ff0bmtEKK NuthbuZnEdT1JnTWDZiILrvTMnMLMblZLKOt1tBPt5i4Xog8pEaZJHUsNA3V9fwDcyqQ RAbQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Q76I/Qya"; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id o12-20020ac841cc000000b004181ca98679si8383887qtm.259.2023.12.03.23.42.04 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Dec 2023 23:42:04 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Q76I/Qya"; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F387A385E001 for <ouuuleilei@gmail.com>; Mon, 4 Dec 2023 07:42:03 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 65D01385C317 for <gcc-patches@gcc.gnu.org>; Mon, 4 Dec 2023 07:41:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 65D01385C317 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 65D01385C317 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701675700; cv=none; b=vhWBkibYXKt5IHjTnX9Hp8UUEFEsNOqZUgLdVQCPunKc91v4Z8OCcEOmFuugmCCJ7C18qkwG0HP09F281yZTK7G9Mo7efiGNgVsF0H4XPIlLRCDtTjJhdGPLCBnfq7ukgOiQIC2LtFaLS8jwXG+Av1P8L8XIJCKwwwFNd/xwy3g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701675700; c=relaxed/simple; bh=3oTqtMS/m8sanjPMe5eAlWEtgGGTii/uwVtfA3udlYQ=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=rcg2yFWHu2qRQqjW3J8FU2Gen5IZq7PmmoelusjX/uMRLCZHAsVSOtyv0NSmWV7SQb029A9Ppsvnabi8R3u8WR9G7WkA+Ha3fSd64m4tvUyr3CPS7wYVoL8x4Nssa8RwzPQojBIQPNFnoGEzKtcu/IfwGl7NYMjz2vtZo0c2tR8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701675699; 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; bh=ctHrdyWqHM/06jxsabjAGBFNwZC0heExRRZJxBE3Dtw=; b=Q76I/QyaGwMffeTu9u1VoUw/Z42OvJMLfoacOXTK0MX+g1BoeGBs0oEpypvdVOOkcnuekk gCRW2janvGtVL4H0XMlL13jl6vamC/ZpWTZNySwd9vr0LNI7T30PwOfT/6JiwSYQfCzujC ERL7cdKbO7243aRvq3lamiywEl8aP+k= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-86-HCEVVetcM0S90hbx38zhXA-1; Mon, 04 Dec 2023 02:41:37 -0500 X-MC-Unique: HCEVVetcM0S90hbx38zhXA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7E7B680D721; Mon, 4 Dec 2023 07:41:37 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.195.157]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 420F61C060B5; Mon, 4 Dec 2023 07:41:37 +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 3B47fY2J2150134 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 4 Dec 2023 08:41:35 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 3B47fY2A2150133; Mon, 4 Dec 2023 08:41:34 +0100 Date: Mon, 4 Dec 2023 08:41:34 +0100 From: Jakub Jelinek <jakub@redhat.com> To: Uros Bizjak <ubizjak@gmail.com> Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] i386: Fix rtl checking ICE in ix86_elim_entry_set_got [PR112837] Message-ID: <ZW2CrlKlvGbe8zpT@tucnak> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Reply-To: Jakub Jelinek <jakub@redhat.com> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784336324022641599 X-GMAIL-MSGID: 1784336324022641599 |
Series |
i386: Fix rtl checking ICE in ix86_elim_entry_set_got [PR112837]
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | warning | Git am fail log |
Commit Message
Jakub Jelinek
Dec. 4, 2023, 7:41 a.m. UTC
Hi! The following testcase ICEs with RTL checking, because it sets if XINT (SET_SRC (set), 1) is UNSPEC_SET_GOT without checking if SET_SRC (set) is actually an UNSPEC, so any time we see any other insn with PARALLEL and a SET in it which is not an UNSPEC we ICE during RTL checking or access there some other union member as if it was an rt_int. The rest is just small cleanup. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2023-12-04 Jakub Jelinek <jakub@redhat.com> PR target/112837 * config/i386/i386.cc (ix86_elim_entry_set_got): Before checking for UNSPEC_SET_GOT check that SET_SRC is UNSPEC. Use SET_SRC and SET_DEST macros instead of XEXP, rename vec variable to set. * gcc.dg/pr112837.c: New test. Jakub
Comments
On Mon, Dec 4, 2023 at 8:41 AM Jakub Jelinek <jakub@redhat.com> wrote: > > Hi! > > The following testcase ICEs with RTL checking, because it sets if > XINT (SET_SRC (set), 1) is UNSPEC_SET_GOT without checking if SET_SRC (set) > is actually an UNSPEC, so any time we see any other insn with PARALLEL > and a SET in it which is not an UNSPEC we ICE during RTL checking or > access there some other union member as if it was an rt_int. > The rest is just small cleanup. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > > 2023-12-04 Jakub Jelinek <jakub@redhat.com> > > PR target/112837 > * config/i386/i386.cc (ix86_elim_entry_set_got): Before checking > for UNSPEC_SET_GOT check that SET_SRC is UNSPEC. Use SET_SRC and > SET_DEST macros instead of XEXP, rename vec variable to set. > > * gcc.dg/pr112837.c: New test. OK. Thanks, Uros. > > --- gcc/config/i386/i386.cc.jj 2023-12-03 17:44:51.837530235 +0100 > +++ gcc/config/i386/i386.cc 2023-12-03 23:20:31.117005983 +0100 > @@ -8607,10 +8607,11 @@ ix86_elim_entry_set_got (rtx reg) > rtx pat = PATTERN (c_insn); > if (GET_CODE (pat) == PARALLEL) > { > - rtx vec = XVECEXP (pat, 0, 0); > - if (GET_CODE (vec) == SET > - && XINT (XEXP (vec, 1), 1) == UNSPEC_SET_GOT > - && REGNO (XEXP (vec, 0)) == REGNO (reg)) > + rtx set = XVECEXP (pat, 0, 0); > + if (GET_CODE (set) == SET > + && GET_CODE (SET_SRC (set)) == UNSPEC > + && XINT (SET_SRC (set), 1) == UNSPEC_SET_GOT > + && REGNO (SET_DEST (set)) == REGNO (reg)) > delete_insn (c_insn); > } > } > --- gcc/testsuite/gcc.dg/pr112837.c.jj 2023-12-03 23:25:04.803208457 +0100 > +++ gcc/testsuite/gcc.dg/pr112837.c 2023-12-03 23:25:41.194703497 +0100 > @@ -0,0 +1,11 @@ > +/* PR target/112837 */ > +/* { dg-do compile } */ > +/* { dg-options "-fcompare-elim -fprofile" } */ > +/* { dg-additional-options "-fpie" { target pie } } */ > +/* { dg-require-profiling "-fprofile" } */ > + > +void > +foo (int i) > +{ > + foo (i); > +} > > Jakub >
--- gcc/config/i386/i386.cc.jj 2023-12-03 17:44:51.837530235 +0100 +++ gcc/config/i386/i386.cc 2023-12-03 23:20:31.117005983 +0100 @@ -8607,10 +8607,11 @@ ix86_elim_entry_set_got (rtx reg) rtx pat = PATTERN (c_insn); if (GET_CODE (pat) == PARALLEL) { - rtx vec = XVECEXP (pat, 0, 0); - if (GET_CODE (vec) == SET - && XINT (XEXP (vec, 1), 1) == UNSPEC_SET_GOT - && REGNO (XEXP (vec, 0)) == REGNO (reg)) + rtx set = XVECEXP (pat, 0, 0); + if (GET_CODE (set) == SET + && GET_CODE (SET_SRC (set)) == UNSPEC + && XINT (SET_SRC (set), 1) == UNSPEC_SET_GOT + && REGNO (SET_DEST (set)) == REGNO (reg)) delete_insn (c_insn); } } --- gcc/testsuite/gcc.dg/pr112837.c.jj 2023-12-03 23:25:04.803208457 +0100 +++ gcc/testsuite/gcc.dg/pr112837.c 2023-12-03 23:25:41.194703497 +0100 @@ -0,0 +1,11 @@ +/* PR target/112837 */ +/* { dg-do compile } */ +/* { dg-options "-fcompare-elim -fprofile" } */ +/* { dg-additional-options "-fpie" { target pie } } */ +/* { dg-require-profiling "-fprofile" } */ + +void +foo (int i) +{ + foo (i); +}