aboutsummaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2012-04-24 06:03:43 +0000
committerJakub Jelinek <jakub@redhat.com>2012-04-24 06:03:43 +0000
commit870e844d34e3a638fcd99782bc0aa3f19069c27e (patch)
tree5a483344d3cecd7b768043f2c33fb78c230bde89 /gcc/varasm.c
parent42377400c1068ff85d919b71cb6593c82905b74c (diff)
PR middle-end/52999
* varasm.c (get_section): Don't ICE for section conflicts with built-in section kinds. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@186741 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index c3d289eb91a..b7939c54a84 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1,7 +1,7 @@
/* Output variables, constants and external declarations, for GNU compiler.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
- 2010, 2011 Free Software Foundation, Inc.
+ 2010, 2011, 2012 Free Software Foundation, Inc.
This file is part of GCC.
@@ -314,11 +314,16 @@ 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 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);
+ if (sect->named.decl == NULL)
+ error ("%+D causes a section type conflict", decl);
+ else
+ {
+ 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;
}