aboutsummaryrefslogtreecommitdiff
blob: 4b42ea96e21620bc94787fa386b8ba6fb230b175 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From ec0ead755e65ba51813aa8b66f4eb5574dd8437c Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Wed, 26 Jun 2024 13:19:42 +0100
Subject: [PATCH 1/2] i386: fix ix86_expand_move

Before r15-1599-g63512c72df09b4, legitimize_pe_coff_symbol would return NULL_RTX
for non-PECOFF targets, so the else branch would get taken.

(This is a hack which doesn't work for PECOFF targets but fixes miscompilations
on ELF.)

Bug: https://gcc.gnu.org/PR115635
Bug: https://gcc.gnu.org/PR115661
---
 gcc/config/i386/i386-expand.cc | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc
index 5dfa7d49f58c..5e0173bc7a84 100644
--- a/gcc/config/i386/i386-expand.cc
+++ b/gcc/config/i386/i386-expand.cc
@@ -412,20 +412,10 @@ ix86_expand_move (machine_mode mode, rtx operands[])
 	}
       else
 	{
-#if TARGET_PECOFF
-	  tmp = legitimize_pe_coff_symbol (op1, addend != NULL_RTX);
-	  if (tmp)
-	    {
-	      op1 = tmp;
-	      if (!addend)
-		break;
-	    }
-	  else
 	    {
 	      op1 = operands[1];
 	      break;
 	    }
-#endif
 	}
 
       if (addend)
-- 
2.45.2