OSDN Git Service

better warning for section conflict
authorak <ak@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 9 Jun 2011 06:22:17 +0000 (06:22 +0000)
committerak <ak@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 9 Jun 2011 06:22:17 +0000 (06:22 +0000)
gcc/:

2011-06-08  Andi Kleen  <ak@linux.intel.com>

* varasm.c (get_section): Print location of other conflict
for section conflicts.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@174836 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/varasm.c

index 820bcbd..1c9fa02 100644 (file)
@@ -1,5 +1,10 @@
 2011-06-08  Andi Kleen  <ak@linux.intel.com>
 
+       * varasm.c (get_section): Print location of other conflict
+       for section conflicts.
+
+2011-06-08  Andi Kleen  <ak@linux.intel.com>
+
        * config/i386/driver-i386.c (host_detect_local_cpu):
        Add model 0x2d Intel CPU.
 
index 3311c86..a0a0582 100644 (file)
@@ -313,7 +313,11 @@ get_section (const char *name, unsigned int flags, tree decl)
          if (decl == 0)
            decl = sect->named.decl;
          gcc_assert (decl);
-         error ("%+D causes a section type conflict", decl);
+         error ("%+D causes a section type conflict with %D", 
+                       decl, sect->named.decl);
+         if (decl != sect->named.decl)
+            inform (DECL_SOURCE_LOCATION (sect->named.decl), 
+                   "%qD was declared here", sect->named.decl);
          /* Make sure we don't error about one section multiple times.  */
          sect->common.flags |= SECTION_OVERRIDE;
        }