From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from paperclip.tbsaunde.org (unknown [IPv6:2600:3c03::f03c:91ff:fe6e:c625]) by sourceware.org (Postfix) with ESMTP id 9D69E3973122 for ; Wed, 14 Jul 2021 08:18:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9D69E3973122 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tbsaunde.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tbsaunde.org Received: from caber.home (pool-108-24-42-131.cmdnnj.fios.verizon.net [108.24.42.131]) by paperclip.tbsaunde.org (Postfix) with ESMTPSA id DDBDBC08A; Wed, 14 Jul 2021 08:18:41 +0000 (UTC) From: Trevor Saunders To: gcc-patches@gcc.gnu.org Cc: Trevor Saunders Subject: [PATCH 2/4] use error_at and warning_at in cfgexpand.c Date: Wed, 14 Jul 2021 04:18:25 -0400 Message-Id: <20210714081827.12185-2-tbsaunde@tbsaunde.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210714081827.12185-1-tbsaunde@tbsaunde.org> References: <20210714081827.12185-1-tbsaunde@tbsaunde.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_ABUSEAT, RCVD_IN_XBL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Wed, 14 Jul 2021 08:18:43 -0000 bootstrapped and regtested on x86_64-linux-gnu, ok? Trev gcc/ChangeLog: * cfgexpand.c (tree_conflicts_with_clobbers_p): Pass location to diagnostics. (expand_asm_stmt): Likewise. --- gcc/cfgexpand.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index fea8c837c80..46f2960c491 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -2954,7 +2954,8 @@ check_operand_nalternatives (const vec &constraints) variable definition for error, NULL_TREE for ok. */ static bool -tree_conflicts_with_clobbers_p (tree t, HARD_REG_SET *clobbered_regs) +tree_conflicts_with_clobbers_p (tree t, HARD_REG_SET *clobbered_regs, + location_t loc) { /* Conflicts between asm-declared register variables and the clobber list are not allowed. */ @@ -2962,9 +2963,8 @@ tree_conflicts_with_clobbers_p (tree t, HARD_REG_SET *clobbered_regs) if (overlap) { - error ("% specifier for variable %qE conflicts with " - "% clobber list", - DECL_NAME (overlap)); + error_at (loc, "% specifier for variable %qE conflicts with " + "% clobber list", DECL_NAME (overlap)); /* Reset registerness to stop multiple errors emitted for a single variable. */ @@ -3087,7 +3087,7 @@ expand_asm_stmt (gasm *stmt) /* ??? Diagnose during gimplification? */ if (ninputs + noutputs + nlabels > MAX_RECOG_OPERANDS) { - error ("more than %d operands in %", MAX_RECOG_OPERANDS); + error_at (locus, "more than %d operands in %", MAX_RECOG_OPERANDS); return; } @@ -3140,7 +3140,8 @@ expand_asm_stmt (gasm *stmt) if (j == -2) { /* ??? Diagnose during gimplification? */ - error ("unknown register name %qs in %", regname); + error_at (locus, "unknown register name %qs in %", + regname); error_seen = true; } else if (j == -4) @@ -3205,7 +3206,8 @@ expand_asm_stmt (gasm *stmt) && HARD_REGISTER_P (DECL_RTL (output_tvec[j])) && output_hregno == REGNO (DECL_RTL (output_tvec[j]))) { - error ("invalid hard register usage between output operands"); + error_at (locus, "invalid hard register usage between output " + "operands"); error_seen = true; } @@ -3231,16 +3233,16 @@ expand_asm_stmt (gasm *stmt) if (i == match && output_hregno != input_hregno) { - error ("invalid hard register usage between output " - "operand and matching constraint operand"); + error_at (locus, "invalid hard register usage between " + "output operand and matching constraint operand"); error_seen = true; } else if (early_clobber_p && i != match && output_hregno == input_hregno) { - error ("invalid hard register usage between " - "earlyclobber operand and input operand"); + error_at (locus, "invalid hard register usage between " + "earlyclobber operand and input operand"); error_seen = true; } } @@ -3319,7 +3321,7 @@ expand_asm_stmt (gasm *stmt) if (! allows_reg && !MEM_P (op)) { - error ("output number %d not directly addressable", i); + error_at (locus, "output number %d not directly addressable", i); error_seen = true; } if ((! allows_mem && MEM_P (op) && GET_MODE (op) != BLKmode) @@ -3415,9 +3417,8 @@ expand_asm_stmt (gasm *stmt) if (allows_reg && TYPE_MODE (type) != BLKmode) op = force_reg (TYPE_MODE (type), op); else if (!allows_mem) - warning (0, "% operand %d probably does not match " - "constraints", - i + noutputs); + warning_at (locus, 0, "% operand %d probably does not match " + "constraints", i + noutputs); else if (MEM_P (op)) { /* We won't recognize either volatile memory or memory @@ -3471,10 +3472,10 @@ expand_asm_stmt (gasm *stmt) bool clobber_conflict_found = 0; for (i = 0; i < noutputs; ++i) - if (tree_conflicts_with_clobbers_p (output_tvec[i], &clobbered_regs)) + if (tree_conflicts_with_clobbers_p (output_tvec[i], &clobbered_regs, locus)) clobber_conflict_found = 1; for (i = 0; i < ninputs - ninout; ++i) - if (tree_conflicts_with_clobbers_p (input_tvec[i], &clobbered_regs)) + if (tree_conflicts_with_clobbers_p (input_tvec[i], &clobbered_regs, locus)) clobber_conflict_found = 1; /* Make vectors for the expression-rtx, constraint strings, -- 2.20.1