1 Index: gcc-4.2.3/gcc/config/avr32/avr32.c
2 ===================================================================
3 --- gcc-4.2.3.orig/gcc/config/avr32/avr32.c 2008-05-21 13:45:59.762288215 +0200
4 +++ gcc-4.2.3/gcc/config/avr32/avr32.c 2008-05-21 13:46:00.342290304 +0200
8 if (!avr32_const_ok_for_constraint_p (mi_delta, 'I', "Is21")
13 fputs ("\tpushm\tlr\n", file);
19 - if ( (!avr32_const_ok_for_constraint_p (mi_delta, 'I', "Is21")
22 + if (!avr32_const_ok_for_constraint_p (mi_delta, 'I', "Is21")
25 fputs ("\tpopm\tlr\n", file);
30 - /* Load the got into lr and then load the pointer
31 - to the function from the got and put it on the stack.
32 - We can then call the function and restore lr by issuing
33 - a doubleword load from the stack. We do not use a popm/ldm
34 - since it will be treated as a return and might need a flushing
35 - of the return-stack if available. */
36 - rtx label = gen_label_rtx ();
38 - fputs ("\tlddpc\tlr, 0f\n", file);
39 - (*targetm.asm_out.internal_label) (file, "L",
40 - CODE_LABEL_NUMBER (label));
41 - fputs ("\trsub\tlr, pc\n", file);
42 - /* Load the function pointer. */
43 - fputs ("\tld.w\tlr, lr[", file);
44 - assemble_name (file, XSTR (XEXP (DECL_RTL (function), 0), 0));
45 - fputs ("@got]\n", file);
46 - /* Push the function pointer on the stack.*/
47 - fputs ("\tpushm\tlr\n", file);
48 - /* Restore the old lr value and load the function pointer into
50 - fputs ("\tld.d\tlr,sp++\n", file);
51 - fprintf (file, "\t.align 2\n");
52 - fprintf (file, "0:\t.long\t.L%d - _GLOBAL_OFFSET_TABLE_\n", CODE_LABEL_NUMBER (label));
56 - fprintf (file, "\tlddpc\tpc, 0f\n");
57 - fprintf (file, "\t.align 2\n");
58 - fputs ("0:\t.long\t", file);
59 - assemble_name (file, XSTR (XEXP (DECL_RTL (function), 0), 0));
63 + /* Jump to the function. We assume that we can use an rjmp since the
64 + function to jump to is local and probably not too far away from
65 + the thunk. If this assumption proves to be wrong we could implement
66 + this jump by calculating the offset between the jump source and destination
67 + and put this in the constant pool and then perform an add to pc.
68 + This would also be legitimate PIC code. But for now we hope that an rjmp
69 + will be sufficient...
71 + fputs ("\trjmp\t", file);
72 + assemble_name (file, XSTR (XEXP (DECL_RTL (function), 0), 0));
76 /* Implements target hook vector_mode_supported. */
78 if (TREE_CODE (*node) != FUNCTION_DECL)
80 warning ("`%s' attribute only applies to functions",
81 - IDENTIFIER_POINTER (name));
82 + IDENTIFIER_POINTER (name));
85 /* FIXME: the argument if any is checked for type attributes; should it