This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Patch, ira] Invalid assert in reload1.c::finish_spills?
- From: <SenthilKumar dot Selvaraj at microchip dot com>
- To: <gcc-patches at gcc dot gnu dot org>
- Cc: <vmakarov at redhat dot com>
- Date: Wed, 7 Aug 2019 11:36:01 +0000
- Subject: [Patch, ira] Invalid assert in reload1.c::finish_spills?
- Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=microchip.com;dmarc=pass action=none header.from=microchip.com;dkim=pass header.d=microchip.com;arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lXKt3o7J1yB4jdzgT7a9Ngw+g1OQpLIRgbfnu0WATLw=; b=NwCxFe78V+RrHbTmE30ekHz5LuGc/dKr9EASQT8z92TSs1Lo5hP1J8MMwAMvIZRZSTRo0uFGcDsGtIIjTy6OxiHwFZ/ilmDQ+fDUrKW1jxC29kaD+n0/Lc/ODgppdu5UmKXwFD6AziUtEKj4yN4Q81x025fTFPeYW+fxr6mTKp4FbSx7nS3o7LAbeqVI7nrj+4Mh8W6+drQRlSF4OXmAAS98yJtDlpLr+UAUzQPIDe8HL2pkgtd+b0NumvAkPxdCpivwbhi59840EzEc9yyHsLd12zY9DfcrrtMZkIJoTMBwj/QUVKpktn0N8J7TXuMlG2VQ8bJV2GWEFED4mJmHiA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P5b2F2/3N34F/Tz116hZwDMlFomhKe9ZgRCWx07JF/F41PUtYw9+fCRCwt5l2T3AjnQU0y3BZVTJe5u2VGEarIHDlwp6g6mafYpe1BIe2OwG5Zv2SUBwai6+A3OsZ2KzX3aTPg+M6GMKYPr54v8HzRF7ijlk2GXU/6HritmBome7DJSwlIIx9JaKnqxsvjE624W8PjkN7zJyKYckkxTPVM/sn78XT2X5LwuFD3s9XVm7TBjmyE/jaoDCsip7XhqZPnFST6U02ZfDtq1/Jkk9OMPjrR6tJ/7LsGrnvOlBLsvPbR6QH8l1UtfpCN1m2wPo23u6RM0yEzCZbjpXTlLv8g==
- Ironport-sdr: wLFQJR5ESJxV7OjMZFTt4QT75syDxYPhp4989AkoO2eOcdobyufAfficMsekLqBxQoUfUUgqUJ Orx7fBxeBrb3ELuzgZJZjKv5diDu3vM3dn2AkVROLFP/ahrhLL7PS/D0ooz4IXX+OF4BYknqZY sS0Z6pI2m8iCmoFSHNBgM5DUHDFOnZoLHyIaCOAzfYO2rjQzAUgDGRBH6qOti7pLn1CZ8milPl 5otcBqlf/FLERLpw0uLoaEe82xyJu9/czEhqaJhQrZ+RDN6IJxEdMgTF7XHsomciisSGr/5/Hc Tdo=
Hi,
gcc/testsuite/c-c++-common/pr60101.c fails with an ICE for the
avr target, because of a gcc_assert firing at reload1.c:4233
The assert (in the patch below) looks bogus to me, as it's in
the if block of
if (! ira_conflicts_p || reg_renumber[i] >= 0)
For this testcase and for the avr target, ira_conflicts_p is
false because build_conflict_bit_table bailed out early
(conflict table too big).
If reg_renumber[i] is now negative, the assert fires and causes
the ICE.
Getting rid of the assert (patch below) makes the ICE go away,
not sure if that's the right fix though.
Comments?
Regards
Senthil
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 38ee356a791..5acba706bee 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -4230,7 +4230,6 @@ finish_spills (int global)
/* Record the current hard register the pseudo is allocated to
in pseudo_previous_regs so we avoid reallocating it to the
same hard reg in a later pass. */
- gcc_assert (reg_renumber[i] >= 0);
SET_HARD_REG_BIT (pseudo_previous_regs[i], reg_renumber[i]);
/* Mark it as no longer having a hard register home. */