aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/spu/spu.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/spu/spu.c')
-rw-r--r--gcc/config/spu/spu.c41
1 files changed, 24 insertions, 17 deletions
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index f86bda6..37488b2 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -4944,8 +4944,7 @@ array_to_constant (enum machine_mode mode, unsigned char arr[16])
static void
reloc_diagnostic (rtx x)
{
- tree loc_decl, decl = 0;
- const char *msg;
+ tree decl = 0;
if (!flag_pic || !(TARGET_WARN_RELOC || TARGET_ERROR_RELOC))
return;
@@ -4959,24 +4958,32 @@ reloc_diagnostic (rtx x)
if (decl && !DECL_P (decl))
decl = 0;
- /* We use last_assemble_variable_decl to get line information. It's
- not always going to be right and might not even be close, but will
- be right for the more common cases. */
- if (!last_assemble_variable_decl || in_section == ctors_section)
- loc_decl = decl;
- else
- loc_decl = last_assemble_variable_decl;
-
/* The decl could be a string constant. */
if (decl && DECL_P (decl))
- msg = "%Jcreating run-time relocation for %qD";
- else
- msg = "creating run-time relocation";
+ {
+ location_t loc;
+ /* We use last_assemble_variable_decl to get line information. It's
+ not always going to be right and might not even be close, but will
+ be right for the more common cases. */
+ if (!last_assemble_variable_decl || in_section == ctors_section)
+ loc = DECL_SOURCE_LOCATION (decl);
+ else
+ loc = DECL_SOURCE_LOCATION (last_assemble_variable_decl);
- if (TARGET_WARN_RELOC)
- warning (0, msg, loc_decl, decl);
- else
- error (msg, loc_decl, decl);
+ if (TARGET_WARN_RELOC)
+ warning_at (loc, 0,
+ "creating run-time relocation for %qD", decl);
+ else
+ error_at (loc,
+ "creating run-time relocation for %qD", decl);
+ }
+ else
+ {
+ if (TARGET_WARN_RELOC)
+ warning_at (input_location, 0, "creating run-time relocation");
+ else
+ error_at (input_location, "creating run-time relocation");
+ }
}
/* Hook into assemble_integer so we can generate an error for run-time