From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id 352963858C1F for ; Mon, 7 Nov 2022 09:47:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 352963858C1F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-x630.google.com with SMTP id g24so10580535plq.3 for ; Mon, 07 Nov 2022 01:47:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=eEIiejLsqq3bJR5RSe8+h2yQSAOKDl/Z358TQwsj+CY=; b=Dy22xzpS8fXT4/k70c+OidIw+ZX9ArNhIvrQLOfXTSi6Bf+UelGZF88J1LlBalb/J0 Jn4VXdjfxVTeD/uRzdByqqZtDyTCO3V7Dw9GARc549MaRddUWvIk/FmwVqL9Mmb/SazV nJCn8cPgAtph/K38lId0shrqeD89Or0JtY0TAMylWQxULuebKqYuQIjnS8tB1xdGOim1 EANeJ/mP5nVovje9i3qwdBXfNzCtgOPVziuO1i1Va7eMKaermY6JK67kYczx+2hlRa2b cYi3xqJwbtiy1z+K12li7LyTJMbRJpN5xrCqE85j72dkq2Il5TSXbAQG19zzHF0Xi7te BoOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=eEIiejLsqq3bJR5RSe8+h2yQSAOKDl/Z358TQwsj+CY=; b=D5McIZaCqhBoRC3i2xLe9kl14F/zGJOVBoqdYIgugwvIeFObn9ckF1zw3ZGq3yxZZU Qc0e4Fy2w6e4RURDMl16bRhTy8I/3NQ6HgI0z3Mxm0bJERIaVec6GtD+KeDelVUrukEu LLcPb6rbXBKJZyhr2WAnMGr22v7gHJGGxJWxckXyBpVSy5J0h5cT3rdJxT4aRg3Q9Bst 7HVHsjkbWmix6CbI3adHOw5QeFRK826vpVUfbkBXcfZz0WcCddUzvEnLi1n6I8OqUJkm 5TfyOkJEKPZmYr3HKJoPiOhklc9ZXs4hsIRDoyi6+pMeoa6PTWORAxC+QRYpq/roEiYN UQiQ== X-Gm-Message-State: ACrzQf0qbYYUoE46/Wfyd+Z8rm8tSrkOpacrNIVgfsrYD1WDLRekV/nK lHbnPBS39byhuM/n/NzeQXitbct7Yto= X-Google-Smtp-Source: AMsMyM62fcT5yItwbHndiohiV1B0+/6Z0ovZDz+NUfvXr+jB1jcu0Vtp8odn0bTViZBfZCtPEMvA0g== X-Received: by 2002:a17:902:ceca:b0:187:12cc:d6a1 with SMTP id d10-20020a170902ceca00b0018712ccd6a1mr44982224plg.162.1667814433824; Mon, 07 Nov 2022 01:47:13 -0800 (PST) Received: from octofox.hsd1.ca.comcast.net ([2601:641:401:1d20:f042:87a2:c6b:9a6f]) by smtp.gmail.com with ESMTPSA id e4-20020a170902784400b001871acf245csm4557575pln.37.2022.11.07.01.47.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Nov 2022 01:47:12 -0800 (PST) From: Max Filippov To: gcc-patches@gcc.gnu.org Cc: Vladimir Makarov , Max Filippov Subject: [RFA] gcc: fix PR rtl-optimization/107482 Date: Mon, 7 Nov 2022 01:46:45 -0800 Message-Id: <20221107094645.3718427-1-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,GIT_PATCH_0,HK_RANDOM_ENVFROM,HK_RANDOM_FROM,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,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: gcc/ * ira-color.cc (update_costs_from_allocno): Check that allocno is in the consideration_allocno_bitmap before dereferencing ALLOCNO_COLOR_DATA (allocno). --- This fixes the invalid memory access, but I'm not sure if that's sufficient and there's no remaining higher level logical issue. Regtested for target=xtensa-linux-uclibc, no new regressions. gcc/ira-color.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/ira-color.cc b/gcc/ira-color.cc index 4a1a325e8e31..4527eab39bb7 100644 --- a/gcc/ira-color.cc +++ b/gcc/ira-color.cc @@ -1434,6 +1434,8 @@ update_costs_from_allocno (ira_allocno_t allocno, int hard_regno, if (another_allocno == from || (ALLOCNO_COLOR_DATA (another_allocno) != NULL + && bitmap_bit_p (consideration_allocno_bitmap, + ALLOCNO_NUM (allocno)) && (ALLOCNO_COLOR_DATA (allocno)->first_thread_allocno != ALLOCNO_COLOR_DATA (another_allocno)->first_thread_allocno))) continue; -- 2.30.2