This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, committed] error_for_asm and warning_for_asm take const rtx_insn *


The attached patch strengthens various diagnostic-reporting rtx from rtx
to rtx_insn *, and thus falls under the pre-approval granted by Jeff
here:
  https://gcc.gnu.org/ml/gcc-patches/2014-08/msg01310.html

Bootstrapped on x86_64-unknown-linux-gnu (Fedora 20), and has been
rebuilt as part of a config-list.mk build for all working configurations
(albeit with other patches for the latter case).

Committed to trunk as r215133.

Index: gcc/rtl-error.c
===================================================================
--- gcc/rtl-error.c	(revision 215132)
+++ gcc/rtl-error.c	(revision 215133)
@@ -29,12 +29,13 @@
 #include "intl.h"
 #include "diagnostic.h"
 
-static location_t location_for_asm (const_rtx);
-static void diagnostic_for_asm (const_rtx, const char *, va_list *, diagnostic_t) ATTRIBUTE_GCC_DIAG(2,0);
+static location_t location_for_asm (const rtx_insn *);
+static void diagnostic_for_asm (const rtx_insn *, const char *, va_list *,
+				diagnostic_t) ATTRIBUTE_GCC_DIAG(2,0);
 
 /* Figure the location of the given INSN.  */
 static location_t
-location_for_asm (const_rtx insn)
+location_for_asm (const rtx_insn *insn)
 {
   rtx body = PATTERN (insn);
   rtx asmop;
@@ -65,7 +66,7 @@
    of the insn INSN.  This is used only when INSN is an `asm' with operands,
    and each ASM_OPERANDS records its own source file and line.  */
 static void
-diagnostic_for_asm (const_rtx insn, const char *msg, va_list *args_ptr,
+diagnostic_for_asm (const rtx_insn *insn, const char *msg, va_list *args_ptr,
 		    diagnostic_t kind)
 {
   diagnostic_info diagnostic;
@@ -76,7 +77,7 @@
 }
 
 void
-error_for_asm (const_rtx insn, const char *gmsgid, ...)
+error_for_asm (const rtx_insn *insn, const char *gmsgid, ...)
 {
   va_list ap;
 
@@ -86,7 +87,7 @@
 }
 
 void
-warning_for_asm (const_rtx insn, const char *gmsgid, ...)
+warning_for_asm (const rtx_insn *insn, const char *gmsgid, ...)
 {
   va_list ap;
 
Index: gcc/rtl-error.h
===================================================================
--- gcc/rtl-error.h	(revision 215132)
+++ gcc/rtl-error.h	(revision 215133)
@@ -20,5 +20,7 @@
 #include "rtl.h"
 #include "diagnostic-core.h"
 
-extern void error_for_asm (const_rtx, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
-extern void warning_for_asm (const_rtx, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
+extern void error_for_asm (const rtx_insn *, const char *,
+			   ...) ATTRIBUTE_GCC_DIAG(2,3);
+extern void warning_for_asm (const rtx_insn *, const char *,
+			     ...) ATTRIBUTE_GCC_DIAG(2,3);
Index: gcc/final.c
===================================================================
--- gcc/final.c	(revision 215132)
+++ gcc/final.c	(revision 215133)
@@ -151,7 +151,7 @@
 /* Nonzero while outputting an `asm' with operands.
    This means that inconsistencies are the user's fault, so don't die.
    The precise value is the insn being output, to pass to error_for_asm.  */
-rtx this_is_asm_operands;
+const rtx_insn *this_is_asm_operands;
 
 /* Number of operands of this insn, for an `asm' with operands.  */
 static unsigned int insn_noperands;
Index: gcc/ChangeLog
===================================================================
--- gcc/ChangeLog	(revision 215132)
+++ gcc/ChangeLog	(revision 215133)
@@ -1,5 +1,16 @@
 2014-09-10  David Malcolm  <dmalcolm@redhat.com>
 
+	* final.c (this_is_asm_operands): Strengthen this variable from
+	rtx to const rtx_insn *.
+	* output.h (this_is_asm_operands): Likewise.
+	* rtl-error.c (location_for_asm): Strengthen param "insn" from
+	const_rtx to const rtx_insn *.
+	(diagnostic_for_asm): Likewise.
+	* rtl-error.h (error_for_asm): Likewise.
+	(warning_for_asm): Likewise.
+
+2014-09-10  David Malcolm  <dmalcolm@redhat.com>
+
 	* genextract.c (print_header): When writing out insn_extract to
 	insn-extract.c, strengthen the param "insn" from rtx to rtx_insn *.
 	* recog.h (insn_extract): Strengthen the param from rtx to
Index: gcc/output.h
===================================================================
--- gcc/output.h	(revision 215132)
+++ gcc/output.h	(revision 215133)
@@ -328,7 +328,7 @@
 /* Nonzero while outputting an `asm' with operands.
    This means that inconsistencies are the user's fault, so don't die.
    The precise value is the insn being output, to pass to error_for_asm.  */
-extern rtx this_is_asm_operands;
+extern const rtx_insn *this_is_asm_operands;
 
 /* Carry information from ASM_DECLARE_OBJECT_NAME
    to ASM_FINISH_DECLARE_OBJECT.  */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]