summaryrefslogtreecommitdiff
path: root/gcc/reginfo.c
diff options
context:
space:
mode:
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2010-08-17 12:25:24 +0000
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2010-08-17 12:25:24 +0000
commit6e29e9fac01f267bc8a93c57def05f27000d1c61 (patch)
tree96abe492a5c663c3d4d71b55c14ef2b3b23e4498 /gcc/reginfo.c
parent7aab1427bfadb3b82927fdba6509e75afad55eec (diff)
downloadgcc-6e29e9fac01f267bc8a93c57def05f27000d1c61.tar.gz
PR target/45296
* reginfo.c (globalize_reg): Reject stack registers. testsuite/ChangeLog: PR target/45296 * gcc.target/i386/pr45296.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163303 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/reginfo.c')
-rw-r--r--gcc/reginfo.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/reginfo.c b/gcc/reginfo.c
index 55d2b5b6f9d..1510ce84ec5 100644
--- a/gcc/reginfo.c
+++ b/gcc/reginfo.c
@@ -798,6 +798,14 @@ fix_register (const char *name, int fixed, int call_used)
void
globalize_reg (int i)
{
+#ifdef STACK_REGS
+ if (IN_RANGE (i, FIRST_STACK_REG, LAST_STACK_REG))
+ {
+ error ("stack register used for global register variable");
+ return;
+ }
+#endif
+
if (fixed_regs[i] == 0 && no_global_reg_vars)
error ("global register variable follows a function definition");