aboutsummaryrefslogtreecommitdiff
path: root/gcc/ira.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ira.c')
-rw-r--r--gcc/ira.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/ira.c b/gcc/ira.c
index 41e05f4..ee6010a 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -5532,6 +5532,18 @@ do_reload (void)
if (need_dce && optimize)
run_fast_dce ();
+ /* Diagnose uses of the hard frame pointer when it is used as a global
+ register. Often we can get away with letting the user appropriate
+ the frame pointer, but we should let them know when code generation
+ makes that impossible. */
+ if (global_regs[HARD_FRAME_POINTER_REGNUM] && frame_pointer_needed)
+ {
+ tree decl = global_regs_decl[HARD_FRAME_POINTER_REGNUM];
+ error_at (DECL_SOURCE_LOCATION (current_function_decl),
+ "frame pointer required, but reserved");
+ inform (DECL_SOURCE_LOCATION (decl), "for %qD", decl);
+ }
+
timevar_pop (TV_IRA);
}