aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2013-08-14 11:09:58 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2013-08-14 11:09:58 +0200
commit27ed665fd6bcaaef0593532a0519d167a6f8c8e4 (patch)
treea61232b9f497bbf182d22353f056ee019d3d9d7a /gcc
parent61c1a609ee0019524d94b384eaf8159eadb9a555 (diff)
downloadgcc-27ed665fd6bcaaef0593532a0519d167a6f8c8e4.zip
gcc-27ed665fd6bcaaef0593532a0519d167a6f8c8e4.tar.gz
gcc-27ed665fd6bcaaef0593532a0519d167a6f8c8e4.tar.bz2
re PR target/58067 (ICE in GFortran recog.c:2158)
PR target/58067 * config/i386/i386.c (ix86_delegitimize_address): For CM_MEDIUM_PIC and CM_LARGE_PIC ix86_cmodel fall thru into the -m32 code, handle there also UNSPEC_PLTOFF. Co-Authored-By: Alexandre Oliva <aoliva@redhat.com> From-SVN: r201720
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/i386/i386.c40
2 files changed, 33 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8dc071d..0715f74 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2013-08-14 Jakub Jelinek <jakub@redhat.com>
+ Alexandre Oliva <aoliva@redhat.com>
+
+ PR target/58067
+ * config/i386/i386.c (ix86_delegitimize_address): For CM_MEDIUM_PIC
+ and CM_LARGE_PIC ix86_cmodel fall thru into the -m32 code, handle
+ there also UNSPEC_PLTOFF.
+
2013-08-14 Marek Polacek <polacek@redhat.com>
* ipa-inline-analysis.c (add_clause): Avoid shifting integer
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index e3f345a..dd1a6a8 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -14124,21 +14124,29 @@ ix86_delegitimize_address (rtx x)
x = replace_equiv_address_nv (orig_x, x);
return x;
}
- if (GET_CODE (x) != CONST
- || GET_CODE (XEXP (x, 0)) != UNSPEC
- || (XINT (XEXP (x, 0), 1) != UNSPEC_GOTPCREL
- && XINT (XEXP (x, 0), 1) != UNSPEC_PCREL)
- || (!MEM_P (orig_x) && XINT (XEXP (x, 0), 1) != UNSPEC_PCREL))
- return ix86_delegitimize_tls_address (orig_x);
- x = XVECEXP (XEXP (x, 0), 0, 0);
- if (GET_MODE (orig_x) != GET_MODE (x) && MEM_P (orig_x))
+
+ if (GET_CODE (x) == CONST
+ && GET_CODE (XEXP (x, 0)) == UNSPEC
+ && (XINT (XEXP (x, 0), 1) == UNSPEC_GOTPCREL
+ || XINT (XEXP (x, 0), 1) == UNSPEC_PCREL)
+ && (MEM_P (orig_x) || XINT (XEXP (x, 0), 1) == UNSPEC_PCREL))
{
- x = simplify_gen_subreg (GET_MODE (orig_x), x,
- GET_MODE (x), 0);
- if (x == NULL_RTX)
- return orig_x;
+ x = XVECEXP (XEXP (x, 0), 0, 0);
+ if (GET_MODE (orig_x) != GET_MODE (x) && MEM_P (orig_x))
+ {
+ x = simplify_gen_subreg (GET_MODE (orig_x), x,
+ GET_MODE (x), 0);
+ if (x == NULL_RTX)
+ return orig_x;
+ }
+ return x;
}
- return x;
+
+ if (ix86_cmodel != CM_MEDIUM_PIC && ix86_cmodel != CM_LARGE_PIC)
+ return ix86_delegitimize_tls_address (orig_x);
+
+ /* Fall thru into the code shared with -m32 for -mcmodel=large -fpic
+ and -mcmodel=medium -fpic. */
}
if (GET_CODE (x) != PLUS
@@ -14175,10 +14183,12 @@ ix86_delegitimize_address (rtx x)
if (GET_CODE (x) == UNSPEC
&& ((XINT (x, 1) == UNSPEC_GOT && MEM_P (orig_x) && !addend)
- || (XINT (x, 1) == UNSPEC_GOTOFF && !MEM_P (orig_x))))
+ || (XINT (x, 1) == UNSPEC_GOTOFF && !MEM_P (orig_x))
+ || (XINT (x, 1) == UNSPEC_PLTOFF && ix86_cmodel == CM_LARGE_PIC
+ && !MEM_P (orig_x) && !addend)))
result = XVECEXP (x, 0, 0);
- if (TARGET_MACHO && darwin_local_data_pic (x)
+ if (!TARGET_64BIT && TARGET_MACHO && darwin_local_data_pic (x)
&& !MEM_P (orig_x))
result = XVECEXP (x, 0, 0);