aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/alpha
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1993-04-04 11:44:08 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1993-04-04 11:44:08 -0400
commitfff9ecff94a0142ddb4b888d4a85d757c0c2eab4 (patch)
tree3b1572249197282459b7f8aab8a2958d48dbd215 /gcc/config/alpha
parentc694003e290b4d48fefc26bb3f9412f7010a5262 (diff)
downloadgcc-fff9ecff94a0142ddb4b888d4a85d757c0c2eab4.zip
gcc-fff9ecff94a0142ddb4b888d4a85d757c0c2eab4.tar.gz
gcc-fff9ecff94a0142ddb4b888d4a85d757c0c2eab4.tar.bz2
(output_prolog): Need LDGP even for static procedure.
From-SVN: r4004
Diffstat (limited to 'gcc/config/alpha')
-rw-r--r--gcc/config/alpha/alpha.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 8753126..f36a604 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -1124,21 +1124,21 @@ output_prolog (file, size)
unsigned reg_mask = 0;
int i;
- /* If we need a GP (we have a LDSYM insn or a CALL_INSN) and we are not
- a static function), load it first. */
+ /* If we need a GP (we have a LDSYM insn or a CALL_INSN), load it first.
+ Even if we are a static function, we still need to do this in case
+ our address is taken and passed to something like qsort. */
alpha_function_needs_gp = 0;
- if (TREE_PUBLIC (current_function_decl))
- for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
- if ((GET_CODE (insn) == CALL_INSN)
- || (GET_RTX_CLASS (GET_CODE (insn)) == 'i'
- && GET_CODE (PATTERN (insn)) != USE
- && GET_CODE (PATTERN (insn)) != CLOBBER
- && get_attr_type (insn) == TYPE_LDSYM))
- {
- alpha_function_needs_gp = 1;
- break;
- }
+ for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
+ if ((GET_CODE (insn) == CALL_INSN)
+ || (GET_RTX_CLASS (GET_CODE (insn)) == 'i'
+ && GET_CODE (PATTERN (insn)) != USE
+ && GET_CODE (PATTERN (insn)) != CLOBBER
+ && get_attr_type (insn) == TYPE_LDSYM))
+ {
+ alpha_function_needs_gp = 1;
+ break;
+ }
if (alpha_function_needs_gp)
fprintf (file, "\tldgp $29,0($27)\n");