diff options
| author | Richard Purdie <richard@openedhand.com> | 2006-07-21 10:10:31 +0000 |
|---|---|---|
| committer | Richard Purdie <richard@openedhand.com> | 2006-07-21 10:10:31 +0000 |
| commit | b2f192faabe412adce79534e22efe9fb69ee40e2 (patch) | |
| tree | 7076c49d4286f8a1733650bd8fbc7161af200d57 /meta/packages/gcc/gcc-csl-arm | |
| parent | 2cf0eadf9f730027833af802d7e6c90b44248f80 (diff) | |
| download | poky-b2f192faabe412adce79534e22efe9fb69ee40e2.tar.gz | |
Rename /openembedded/ -> /meta/
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@530 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages/gcc/gcc-csl-arm')
| -rw-r--r-- | meta/packages/gcc/gcc-csl-arm/15342.patch | 22 | ||||
| -rw-r--r-- | meta/packages/gcc/gcc-csl-arm/gcc-3.4.0-arm-lib1asm.patch | 24 | ||||
| -rw-r--r-- | meta/packages/gcc/gcc-csl-arm/gcc34-arm-tune.patch | 9 | ||||
| -rw-r--r-- | meta/packages/gcc/gcc-csl-arm/gcc_optab_arm.patch | 95 | ||||
| -rw-r--r-- | meta/packages/gcc/gcc-csl-arm/no-libfloat.patch | 11 | ||||
| -rw-r--r-- | meta/packages/gcc/gcc-csl-arm/pic-without-sl.patch | 303 |
6 files changed, 464 insertions, 0 deletions
diff --git a/meta/packages/gcc/gcc-csl-arm/15342.patch b/meta/packages/gcc/gcc-csl-arm/15342.patch new file mode 100644 index 0000000000..d0f3e72d47 --- /dev/null +++ b/meta/packages/gcc/gcc-csl-arm/15342.patch | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | --- gcc/gcc/regrename.c~ 2004-01-14 17:55:20.000000000 +0000 | ||
| 2 | +++ gcc/gcc/regrename.c 2005-02-28 07:24:25.893015200 +0000 | ||
| 3 | @@ -671,7 +671,8 @@ | ||
| 4 | |||
| 5 | case SET: | ||
| 6 | scan_rtx (insn, &SET_SRC (x), class, action, OP_IN, 0); | ||
| 7 | - scan_rtx (insn, &SET_DEST (x), class, action, OP_OUT, 0); | ||
| 8 | + scan_rtx (insn, &SET_DEST (x), class, action, | ||
| 9 | + GET_CODE (PATTERN (insn)) == COND_EXEC ? OP_INOUT : OP_OUT, 0); | ||
| 10 | return; | ||
| 11 | |||
| 12 | case STRICT_LOW_PART: | ||
| 13 | @@ -696,7 +697,8 @@ | ||
| 14 | abort (); | ||
| 15 | |||
| 16 | case CLOBBER: | ||
| 17 | - scan_rtx (insn, &SET_DEST (x), class, action, OP_OUT, 1); | ||
| 18 | + scan_rtx (insn, &SET_DEST (x), class, action, | ||
| 19 | + GET_CODE (PATTERN (insn)) == COND_EXEC ? OP_INOUT : OP_OUT, 0); | ||
| 20 | return; | ||
| 21 | |||
| 22 | case EXPR_LIST: | ||
diff --git a/meta/packages/gcc/gcc-csl-arm/gcc-3.4.0-arm-lib1asm.patch b/meta/packages/gcc/gcc-csl-arm/gcc-3.4.0-arm-lib1asm.patch new file mode 100644 index 0000000000..cf17da6a02 --- /dev/null +++ b/meta/packages/gcc/gcc-csl-arm/gcc-3.4.0-arm-lib1asm.patch | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | # Fixes errors like the following when building glibc (or any other executable | ||
| 2 | # or shared library) when using gcc 3.4.0 for ARM with softfloat: | ||
| 3 | # | ||
| 4 | # .../libc_pic.os(.text+0x15834): In function `__modf': undefined reference to `__subdf3' | ||
| 5 | # .../libc_pic.os(.text+0x158b8): In function `__modf': undefined reference to `__subdf3' | ||
| 6 | # .../libc_pic.os(.text+0x1590c): In function `scalbn': undefined reference to `__muldf3' | ||
| 7 | # .../libc_pic.os(.text+0x15e94): In function `__ldexpf': undefined reference to `__eqsf2' | ||
| 8 | # .../libc_pic.os(.text+0xcee4c): In function `monstartup': undefined reference to `__fixsfsi' | ||
| 9 | |||
| 10 | diff -urNd gcc-3.4.0-orig/gcc/config/arm/t-linux gcc-3.4.0/gcc/config/arm/t-linux | ||
| 11 | --- gcc-3.4.0-orig/gcc/config/arm/t-linux 2003-09-20 23:09:07.000000000 +0200 | ||
| 12 | +++ gcc-3.4.0/gcc/config/arm/t-linux 2004-05-01 20:31:59.102846400 +0200 | ||
| 13 | @@ -4,7 +4,10 @@ | ||
| 14 | LIBGCC2_DEBUG_CFLAGS = -g0 | ||
| 15 | |||
| 16 | LIB1ASMSRC = arm/lib1funcs.asm | ||
| 17 | -LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx | ||
| 18 | +LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \ | ||
| 19 | + _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \ | ||
| 20 | + _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \ | ||
| 21 | + _fixsfsi _fixunssfsi _floatdidf _floatdisf | ||
| 22 | |||
| 23 | # MULTILIB_OPTIONS = mhard-float/msoft-float | ||
| 24 | # MULTILIB_DIRNAMES = hard-float soft-float | ||
diff --git a/meta/packages/gcc/gcc-csl-arm/gcc34-arm-tune.patch b/meta/packages/gcc/gcc-csl-arm/gcc34-arm-tune.patch new file mode 100644 index 0000000000..cdb20bef9b --- /dev/null +++ b/meta/packages/gcc/gcc-csl-arm/gcc34-arm-tune.patch | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | --- gcc-3.4.0/gcc/config/arm/linux-elf.h.arm-tune 2004-01-31 01:18:11.000000000 -0500 | ||
| 2 | +++ gcc-3.4.0/gcc/config/arm/linux-elf.h 2004-04-24 18:19:10.000000000 -0400 | ||
| 3 | @@ -126,3 +126,6 @@ | ||
| 4 | |||
| 5 | #define LINK_GCC_C_SEQUENCE_SPEC \ | ||
| 6 | "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}" | ||
| 7 | + | ||
| 8 | +/* Tune for XScale. */ | ||
| 9 | +#define TARGET_TUNE_DEFAULT TARGET_CPU_xscale | ||
diff --git a/meta/packages/gcc/gcc-csl-arm/gcc_optab_arm.patch b/meta/packages/gcc/gcc-csl-arm/gcc_optab_arm.patch new file mode 100644 index 0000000000..fa21b26554 --- /dev/null +++ b/meta/packages/gcc/gcc-csl-arm/gcc_optab_arm.patch | |||
| @@ -0,0 +1,95 @@ | |||
| 1 | ARM is the only architecture that has a helper function that returns | ||
| 2 | an unbiased result. This fix is trivial enough that we can show it | ||
| 3 | doesn't effect any of the other arches. Can we consider this a | ||
| 4 | regression fix since it used to work until the helper was added :} | ||
| 5 | |||
| 6 | Tested with no regressions on x86_64-pc-linux-gnu and arm-none-eabi. | ||
| 7 | |||
| 8 | Cheers, | ||
| 9 | Carlos. | ||
| 10 | -- | ||
| 11 | Carlos O'Donell | ||
| 12 | CodeSourcery | ||
| 13 | carlos@codesourcery.com | ||
| 14 | (650) 331-3385 x716 | ||
| 15 | |||
| 16 | gcc/ | ||
| 17 | |||
| 18 | 2006-01-27 Carlos O'Donell <carlos@codesourcery.com> | ||
| 19 | |||
| 20 | * optabs.c (prepare_cmp_insn): If unbaised and unsigned then bias | ||
| 21 | the comparison routine return. | ||
| 22 | |||
| 23 | gcc/testsuite/ | ||
| 24 | |||
| 25 | 2006-01-27 Carlos O'Donell <carlos@codesourcery.com> | ||
| 26 | |||
| 27 | * gcc.dg/unsigned-long-compare.c: New test. | ||
| 28 | |||
| 29 | Index: gcc/optabs.c | ||
| 30 | =================================================================== | ||
| 31 | --- 1/gcc/optabs.c (revision 110300) | ||
| 32 | +++ 2/gcc/optabs.c (working copy) | ||
| 33 | @@ -3711,18 +3711,24 @@ | ||
| 34 | result = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST_MAKE_BLOCK, | ||
| 35 | word_mode, 2, x, mode, y, mode); | ||
| 36 | |||
| 37 | + /* There are two kinds of comparison routines. Biased routines | ||
| 38 | + return 0/1/2, and unbiased routines return -1/0/1. Other parts | ||
| 39 | + of gcc expect that the comparison operation is equivalent | ||
| 40 | + to the modified comparison. For signed comparisons compare the | ||
| 41 | + result against 1 in the unbiased case, and zero in the biased | ||
| 42 | + case. For unsigned comparisons always compare against 1 after | ||
| 43 | + biasing the unbased result by adding 1. This gives us a way to | ||
| 44 | + represent LTU. */ | ||
| 45 | *px = result; | ||
| 46 | *pmode = word_mode; | ||
| 47 | - if (TARGET_LIB_INT_CMP_BIASED) | ||
| 48 | - /* Integer comparison returns a result that must be compared | ||
| 49 | - against 1, so that even if we do an unsigned compare | ||
| 50 | - afterward, there is still a value that can represent the | ||
| 51 | - result "less than". */ | ||
| 52 | - *py = const1_rtx; | ||
| 53 | - else | ||
| 54 | + *py = const1_rtx; | ||
| 55 | + | ||
| 56 | + if (!TARGET_LIB_INT_CMP_BIASED) | ||
| 57 | { | ||
| 58 | - *py = const0_rtx; | ||
| 59 | - *punsignedp = 1; | ||
| 60 | + if (*punsignedp) | ||
| 61 | + *px = plus_constant (result, 1); | ||
| 62 | + else | ||
| 63 | + *py = const0_rtx; | ||
| 64 | } | ||
| 65 | return; | ||
| 66 | } | ||
| 67 | Index: gcc/testsuite/gcc.dg/unsigned-long-compare.c | ||
| 68 | =================================================================== | ||
| 69 | --- 1/gcc/testsuite/gcc.dg/unsigned-long-compare.c (revision 0) | ||
| 70 | +++ 2/gcc/testsuite/gcc.dg/unsigned-long-compare.c (revision 0) | ||
| 71 | @@ -0,0 +1,24 @@ | ||
| 72 | +/* Copyright (C) 2006 Free Software Foundation, Inc. */ | ||
| 73 | +/* Contributed by Carlos O'Donell on 2006-01-27 */ | ||
| 74 | + | ||
| 75 | +/* Test a division corner case where the expression simplifies | ||
| 76 | + to a comparison, and the optab expansion is wrong. The optab | ||
| 77 | + expansion emits a function whose return is unbiased and needs | ||
| 78 | + adjustment. */ | ||
| 79 | +/* Origin: Carlos O'Donell <carlos@codesourcery.com> */ | ||
| 80 | +/* { dg-do run { target arm-*-*eabi* } } */ | ||
| 81 | +/* { dg-options "" } */ | ||
| 82 | +#include <stdlib.h> | ||
| 83 | + | ||
| 84 | +#define BIG_CONSTANT 0xFFFFFFFF80000000ULL | ||
| 85 | + | ||
| 86 | +int main (void) | ||
| 87 | +{ | ||
| 88 | + unsigned long long OneULL = 1ULL; | ||
| 89 | + unsigned long long result; | ||
| 90 | + | ||
| 91 | + result = OneULL / BIG_CONSTANT; | ||
| 92 | + if (result) | ||
| 93 | + abort (); | ||
| 94 | + exit (0); | ||
| 95 | +} | ||
diff --git a/meta/packages/gcc/gcc-csl-arm/no-libfloat.patch b/meta/packages/gcc/gcc-csl-arm/no-libfloat.patch new file mode 100644 index 0000000000..e5d12cfb4f --- /dev/null +++ b/meta/packages/gcc/gcc-csl-arm/no-libfloat.patch | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | --- gcc/gcc/config/arm/linux-elf.h.old 2005-04-20 00:46:28.923375320 +0100 | ||
| 2 | +++ gcc/gcc/config/arm/linux-elf.h 2005-04-20 00:46:34.181575952 +0100 | ||
| 3 | @@ -56,7 +56,7 @@ | ||
| 4 | %{shared:-lc} \ | ||
| 5 | %{!shared:%{profile:-lc_p}%{!profile:-lc}}" | ||
| 6 | |||
| 7 | -#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc" | ||
| 8 | +#define LIBGCC_SPEC "-lgcc" | ||
| 9 | |||
| 10 | /* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add | ||
| 11 | the GNU/Linux magical crtbegin.o file (see crtstuff.c) which | ||
diff --git a/meta/packages/gcc/gcc-csl-arm/pic-without-sl.patch b/meta/packages/gcc/gcc-csl-arm/pic-without-sl.patch new file mode 100644 index 0000000000..9a49794da4 --- /dev/null +++ b/meta/packages/gcc/gcc-csl-arm/pic-without-sl.patch | |||
| @@ -0,0 +1,303 @@ | |||
| 1 | Index: gcc/config/arm/arm-protos.h | ||
| 2 | =================================================================== | ||
| 3 | RCS file: /cvsroot/gcc/gcc/gcc/config/arm/arm-protos.h,v | ||
| 4 | retrieving revision 1.60.4.20 | ||
| 5 | diff -u -r1.60.4.20 arm-protos.h | ||
| 6 | --- gcc/config/arm/arm-protos.h 29 Mar 2005 03:00:11 -0000 1.60.4.20 | ||
| 7 | +++ gcc/config/arm/arm-protos.h 23 Apr 2005 04:41:06 -0000 | ||
| 8 | @@ -64,6 +64,7 @@ | ||
| 9 | extern enum reg_class vfp_secondary_reload_class (enum machine_mode, rtx); | ||
| 10 | extern int tls_symbolic_operand (rtx, enum machine_mode); | ||
| 11 | extern bool arm_tls_operand_p (rtx x); | ||
| 12 | +extern bool arm_pc_pic_operand_p (rtx x); | ||
| 13 | |||
| 14 | /* Predicates. */ | ||
| 15 | extern int s_register_operand (rtx, enum machine_mode); | ||
| 16 | Index: gcc/config/arm/arm.c | ||
| 17 | =================================================================== | ||
| 18 | RCS file: /cvsroot/gcc/gcc/gcc/config/arm/arm.c,v | ||
| 19 | retrieving revision 1.303.2.79 | ||
| 20 | diff -u -r1.303.2.79 arm.c | ||
| 21 | --- gcc/config/arm/arm.c 12 Apr 2005 06:17:07 -0000 1.303.2.79 | ||
| 22 | +++ gcc/config/arm/arm.c 23 Apr 2005 04:41:09 -0000 | ||
| 23 | @@ -1003,7 +1003,7 @@ | ||
| 24 | |||
| 25 | /* If stack checking is disabled, we can use r10 as the PIC register, | ||
| 26 | which keeps r9 available. */ | ||
| 27 | - if (flag_pic) | ||
| 28 | + if (0 && flag_pic) | ||
| 29 | arm_pic_register = TARGET_APCS_STACK ? 9 : 10; | ||
| 30 | |||
| 31 | if (TARGET_APCS_FLOAT) | ||
| 32 | @@ -3120,6 +3120,10 @@ | ||
| 33 | rtx | ||
| 34 | legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) | ||
| 35 | { | ||
| 36 | + if (GET_CODE (orig) == UNSPEC | ||
| 37 | + && XINT (orig, 1) == UNSPEC_GOTSLOTPC) | ||
| 38 | + abort (); | ||
| 39 | + | ||
| 40 | if (GET_CODE (orig) == SYMBOL_REF | ||
| 41 | || GET_CODE (orig) == LABEL_REF) | ||
| 42 | { | ||
| 43 | @@ -3149,27 +3153,80 @@ | ||
| 44 | else | ||
| 45 | address = reg; | ||
| 46 | |||
| 47 | - if (TARGET_ARM) | ||
| 48 | - emit_insn (gen_pic_load_addr_arm (address, orig)); | ||
| 49 | - else | ||
| 50 | - emit_insn (gen_pic_load_addr_thumb (address, orig)); | ||
| 51 | + if (arm_pic_register != INVALID_REGNUM) | ||
| 52 | + { | ||
| 53 | + /* Using GP-based PIC addressing. */ | ||
| 54 | + if (TARGET_ARM) | ||
| 55 | + emit_insn (gen_pic_load_addr_arm (address, orig)); | ||
| 56 | + else | ||
| 57 | + emit_insn (gen_pic_load_addr_thumb (address, orig)); | ||
| 58 | + | ||
| 59 | + if ((GET_CODE (orig) == LABEL_REF | ||
| 60 | + || (GET_CODE (orig) == SYMBOL_REF && | ||
| 61 | + SYMBOL_REF_LOCAL_P (orig))) | ||
| 62 | + && NEED_GOT_RELOC) | ||
| 63 | + pic_ref = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, address); | ||
| 64 | + else | ||
| 65 | + { | ||
| 66 | + pic_ref = gen_rtx_MEM (Pmode, | ||
| 67 | + gen_rtx_PLUS (Pmode, pic_offset_table_rtx, | ||
| 68 | + address)); | ||
| 69 | + RTX_UNCHANGING_P (pic_ref) = 1; | ||
| 70 | + } | ||
| 71 | |||
| 72 | - if ((GET_CODE (orig) == LABEL_REF | ||
| 73 | - || (GET_CODE (orig) == SYMBOL_REF && | ||
| 74 | - SYMBOL_REF_LOCAL_P (orig))) | ||
| 75 | - && NEED_GOT_RELOC) | ||
| 76 | - pic_ref = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, address); | ||
| 77 | + current_function_uses_pic_offset_table = 1; | ||
| 78 | + } | ||
| 79 | else | ||
| 80 | { | ||
| 81 | - pic_ref = gen_rtx_MEM (Pmode, | ||
| 82 | - gen_rtx_PLUS (Pmode, pic_offset_table_rtx, | ||
| 83 | - address)); | ||
| 84 | - RTX_UNCHANGING_P (pic_ref) = 1; | ||
| 85 | + /* Using PC-based PIC addressing. */ | ||
| 86 | + rtx label, tmp; | ||
| 87 | + int offset; | ||
| 88 | + | ||
| 89 | + label = gen_label_rtx (); | ||
| 90 | + offset = TARGET_ARM ? 8 : 4; | ||
| 91 | + | ||
| 92 | + if (GET_CODE (orig) == LABEL_REF | ||
| 93 | + || (GET_CODE (orig) == SYMBOL_REF && SYMBOL_REF_LOCAL_P (orig))) | ||
| 94 | + { | ||
| 95 | + /* This symbol is defined locally. We don't need a GOT entry. */ | ||
| 96 | + tmp = gen_rtx_MINUS (Pmode, gen_rtx_UNSPEC (Pmode, gen_rtvec (1, orig), UNSPEC_PIC_SYM), gen_rtx_PLUS (Pmode, | ||
| 97 | + gen_rtx_LABEL_REF (Pmode, label), | ||
| 98 | + GEN_INT (offset))); | ||
| 99 | + | ||
| 100 | + load_tls_operand (tmp, address); | ||
| 101 | + | ||
| 102 | + if (TARGET_ARM) | ||
| 103 | + emit_insn (gen_pic_add_dot_plus_eight (address, label)); | ||
| 104 | + else | ||
| 105 | + emit_insn (gen_pic_add_dot_plus_four (address, label)); | ||
| 106 | + } | ||
| 107 | + else | ||
| 108 | + { | ||
| 109 | + rtx x = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, orig), UNSPEC_GOTSLOTPC); | ||
| 110 | + rtx dummy_label; | ||
| 111 | + | ||
| 112 | + dummy_label = gen_label_rtx (); | ||
| 113 | + LABEL_PRESERVE_P (dummy_label) = 1; | ||
| 114 | + LABEL_NUSES (dummy_label) = 1; | ||
| 115 | + | ||
| 116 | + tmp = gen_rtx_MINUS (Pmode, x, gen_rtx_PLUS (Pmode, | ||
| 117 | + gen_rtx_LABEL_REF (Pmode, label), | ||
| 118 | + GEN_INT (offset))); | ||
| 119 | + | ||
| 120 | + load_tls_operand (tmp, address); | ||
| 121 | + | ||
| 122 | + if (TARGET_ARM) | ||
| 123 | + emit_insn (gen_tls_load_dot_plus_eight (address, address, label, dummy_label)); | ||
| 124 | + else | ||
| 125 | + emit_insn (gen_tls_load_dot_plus_four (address, address, label, dummy_label)); | ||
| 126 | + } | ||
| 127 | + | ||
| 128 | + pic_ref = address; | ||
| 129 | } | ||
| 130 | |||
| 131 | insn = emit_move_insn (reg, pic_ref); | ||
| 132 | #endif | ||
| 133 | - current_function_uses_pic_offset_table = 1; | ||
| 134 | + | ||
| 135 | /* Put a REG_EQUAL note on this insn, so that it can be optimized | ||
| 136 | by loop. */ | ||
| 137 | REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, orig, | ||
| 138 | @@ -3179,11 +3236,17 @@ | ||
| 139 | else if (GET_CODE (orig) == CONST) | ||
| 140 | { | ||
| 141 | rtx base, offset; | ||
| 142 | + bool minus = FALSE; | ||
| 143 | |||
| 144 | if (GET_CODE (XEXP (orig, 0)) == PLUS | ||
| 145 | && XEXP (XEXP (orig, 0), 0) == pic_offset_table_rtx) | ||
| 146 | return orig; | ||
| 147 | |||
| 148 | + if (GET_CODE (XEXP (orig, 0)) == MINUS | ||
| 149 | + && GET_CODE (XEXP (XEXP (orig, 0), 0)) == UNSPEC | ||
| 150 | + && XINT (XEXP (XEXP (orig, 0), 0), 1) == UNSPEC_GOTSLOTPC) | ||
| 151 | + return orig; | ||
| 152 | + | ||
| 153 | if (GET_CODE (XEXP (orig, 0)) == UNSPEC) | ||
| 154 | return orig; | ||
| 155 | |||
| 156 | @@ -3201,6 +3264,13 @@ | ||
| 157 | offset = legitimize_pic_address (XEXP (XEXP (orig, 0), 1), Pmode, | ||
| 158 | base == reg ? 0 : reg); | ||
| 159 | } | ||
| 160 | + else if (GET_CODE (XEXP (orig, 0)) == MINUS) | ||
| 161 | + { | ||
| 162 | + minus = TRUE; | ||
| 163 | + base = legitimize_pic_address (XEXP (XEXP (orig, 0), 0), Pmode, reg); | ||
| 164 | + offset = legitimize_pic_address (XEXP (XEXP (orig, 0), 1), Pmode, | ||
| 165 | + base == reg ? 0 : reg); | ||
| 166 | + } | ||
| 167 | else | ||
| 168 | abort (); | ||
| 169 | |||
| 170 | @@ -3228,7 +3298,7 @@ | ||
| 171 | return reg; | ||
| 172 | } | ||
| 173 | |||
| 174 | - return gen_rtx_PLUS (Pmode, base, offset); | ||
| 175 | + return minus ? gen_rtx_MINUS (Pmode, base, offset) : gen_rtx_PLUS (Pmode, base, offset); | ||
| 176 | } | ||
| 177 | |||
| 178 | return orig; | ||
| 179 | @@ -3267,7 +3337,7 @@ | ||
| 180 | rtx l1, pic_tmp, pic_tmp2, pic_rtx; | ||
| 181 | rtx global_offset_table; | ||
| 182 | |||
| 183 | - if (current_function_uses_pic_offset_table == 0 || TARGET_SINGLE_PIC_BASE) | ||
| 184 | + if (current_function_uses_pic_offset_table == 0 || TARGET_SINGLE_PIC_BASE || arm_pic_register == INVALID_REGNUM) | ||
| 185 | return; | ||
| 186 | |||
| 187 | if (!flag_pic) | ||
| 188 | @@ -3341,8 +3411,11 @@ | ||
| 189 | static int | ||
| 190 | pcrel_constant_p (rtx x) | ||
| 191 | { | ||
| 192 | + if (GET_CODE (x) == CONST) | ||
| 193 | + return pcrel_constant_p (XEXP (x, 0)); | ||
| 194 | + | ||
| 195 | if (GET_CODE (x) == MINUS) | ||
| 196 | - return symbol_mentioned_p (XEXP (x, 0)) && label_mentioned_p (XEXP (x, 1)); | ||
| 197 | + return (((GET_CODE (XEXP (x, 0)) == UNSPEC && XINT (XEXP (x, 0), 1) == UNSPEC_PIC_SYM)) || symbol_mentioned_p (XEXP (x, 0))) && label_mentioned_p (XEXP (x, 1)); | ||
| 198 | |||
| 199 | if (GET_CODE (x) == UNSPEC | ||
| 200 | && XINT (x, 1) == UNSPEC_TLS | ||
| 201 | @@ -3946,12 +4019,32 @@ | ||
| 202 | return SYMBOL_REF_TLS_MODEL (op); | ||
| 203 | } | ||
| 204 | |||
| 205 | +bool | ||
| 206 | +arm_pc_pic_operand_p (rtx op) | ||
| 207 | +{ | ||
| 208 | + if (GET_CODE (op) == CONST | ||
| 209 | + && GET_CODE (XEXP (op, 0)) == MINUS | ||
| 210 | + && GET_CODE (XEXP (XEXP (op, 0), 0)) == UNSPEC | ||
| 211 | + && XINT (XEXP (XEXP (op, 0), 0), 1) == UNSPEC_GOTSLOTPC) | ||
| 212 | + return 1; | ||
| 213 | + | ||
| 214 | + if (GET_CODE (op) == CONST | ||
| 215 | + && GET_CODE (XEXP (op, 0)) == MINUS | ||
| 216 | + && GET_CODE (XEXP (XEXP (op, 0), 0)) == UNSPEC | ||
| 217 | + && XINT (XEXP (XEXP (op, 0), 0), 1) == UNSPEC_PIC_SYM) | ||
| 218 | + return 1; | ||
| 219 | + | ||
| 220 | + return 0; | ||
| 221 | +} | ||
| 222 | + | ||
| 223 | /* Valid input to a move instruction. */ | ||
| 224 | int | ||
| 225 | move_input_operand (rtx op, enum machine_mode mode) | ||
| 226 | { | ||
| 227 | if (tls_symbolic_operand (op, mode)) | ||
| 228 | return 0; | ||
| 229 | + if (pcrel_constant_p (op)) | ||
| 230 | + return 1; | ||
| 231 | return general_operand (op, mode); | ||
| 232 | } | ||
| 233 | |||
| 234 | @@ -15634,11 +15727,34 @@ | ||
| 235 | return TRUE; | ||
| 236 | } | ||
| 237 | |||
| 238 | +static bool | ||
| 239 | +arm_emit_got_decoration (FILE *fp, rtx x) | ||
| 240 | +{ | ||
| 241 | + rtx val; | ||
| 242 | + | ||
| 243 | + val = XVECEXP (x, 0, 0); | ||
| 244 | + | ||
| 245 | + fputs ("_gotslotpc_(", fp); | ||
| 246 | + | ||
| 247 | + output_addr_const (fp, val); | ||
| 248 | + | ||
| 249 | + fputc (')', fp); | ||
| 250 | + | ||
| 251 | + return TRUE; | ||
| 252 | +} | ||
| 253 | + | ||
| 254 | bool | ||
| 255 | arm_output_addr_const_extra (FILE *fp, rtx x) | ||
| 256 | { | ||
| 257 | if (GET_CODE (x) == UNSPEC && XINT (x, 1) == UNSPEC_TLS) | ||
| 258 | return arm_emit_tls_decoration (fp, x); | ||
| 259 | + else if (GET_CODE (x) == UNSPEC && XINT (x, 1) == UNSPEC_GOTSLOTPC) | ||
| 260 | + return arm_emit_got_decoration (fp, x); | ||
| 261 | + else if (GET_CODE (x) == UNSPEC && XINT (x, 1) == UNSPEC_PIC_SYM) | ||
| 262 | + { | ||
| 263 | + output_addr_const (fp, XVECEXP (x, 0, 0)); | ||
| 264 | + return TRUE; | ||
| 265 | + } | ||
| 266 | else if (GET_CODE (x) == CONST_VECTOR) | ||
| 267 | return arm_emit_vector_const (fp, x); | ||
| 268 | |||
| 269 | Index: gcc/config/arm/arm.md | ||
| 270 | =================================================================== | ||
| 271 | RCS file: /cvsroot/gcc/gcc/gcc/config/arm/arm.md,v | ||
| 272 | retrieving revision 1.145.2.31 | ||
| 273 | diff -u -r1.145.2.31 arm.md | ||
| 274 | --- gcc/config/arm/arm.md 28 Mar 2005 19:04:37 -0000 1.145.2.31 | ||
| 275 | +++ gcc/config/arm/arm.md 23 Apr 2005 04:41:11 -0000 | ||
| 276 | @@ -88,6 +88,7 @@ | ||
| 277 | (UNSPEC_WMADDS 18) ; Used by the intrinsic form of the iWMMXt WMADDS instruction. | ||
| 278 | (UNSPEC_WMADDU 19) ; Used by the intrinsic form of the iWMMXt WMADDU instruction. | ||
| 279 | (UNSPEC_TLS 20) ; A symbol that has been treated properly for TLS usage. | ||
| 280 | + (UNSPEC_GOTSLOTPC 21) | ||
| 281 | ] | ||
| 282 | ) | ||
| 283 | |||
| 284 | @@ -4179,7 +4180,8 @@ | ||
| 285 | && (CONSTANT_P (operands[1]) | ||
| 286 | || symbol_mentioned_p (operands[1]) | ||
| 287 | || label_mentioned_p (operands[1])) | ||
| 288 | - && ! tls_mentioned_p (operands[1])) | ||
| 289 | + && ! tls_mentioned_p (operands[1]) | ||
| 290 | + && ! arm_pc_pic_operand_p (operands[1])) | ||
| 291 | operands[1] = legitimize_pic_address (operands[1], SImode, | ||
| 292 | (no_new_pseudos ? operands[0] : 0)); | ||
| 293 | } | ||
| 294 | @@ -4412,7 +4414,8 @@ | ||
| 295 | (mem:SI (unspec:SI [(plus:SI (match_dup 0) | ||
| 296 | (const (plus:SI (pc) (const_int 8))))] | ||
| 297 | UNSPEC_PIC_BASE))) | ||
| 298 | - (use (label_ref (match_operand 1 "" "")))])] | ||
| 299 | + (use (label_ref (match_operand 1 "" ""))) | ||
| 300 | + (use (label_ref (match_operand 1 "" "")))])] | ||
| 301 | "" | ||
| 302 | ) | ||
| 303 | |||
