[Darwin, PPC] Fix PR71496 by marking pic base loads as non-copyable.

Iain Sandoe iain@codesourcery.com
Fri Dec 9 08:45:00 GMT 2016


Hi Segher,

Working through my backlog of Darwin patches …  this one is needed on trunk and 6.x
(although it’s marked as rtl-optimization, it actually prevents bootstrap on the branch with
Java enabled).  Therefore, if possible, I’d like to get this in before the 6.3 freeze.

----

The Darwin pic base loads (and reloads for non-local-gotos) are not validly
copied (since the pic base label would be duplicated).  Thus, this patch marks
them accordingly.

OK for trunk?
OK for GCC-6 branch?

thanks,
Iain

gcc/

2016-12-09  Iain Sandoe  <iain@codesourcery.com>

	PR rtl-optimization/71496
	* config/rs6000/darwin.md (load_macho_picbase_si): Mark as non-
	copyable.  (load_macho_picbase_di, reload_macho_picbase_si,
	reload_macho_picbase_di): Likewise.


---
 gcc/config/rs6000/darwin.md | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/config/rs6000/darwin.md b/gcc/config/rs6000/darwin.md
index 57ce30e..bae8b2b 100644
--- a/gcc/config/rs6000/darwin.md
+++ b/gcc/config/rs6000/darwin.md
@@ -265,6 +265,7 @@ You should have received a copy of the GNU General Public License
   return "bcl 20,31,%0\\n%0:";
 }
   [(set_attr "type" "branch")
+   (set_attr "cannot_copy" "yes")
    (set_attr "length" "4")])
 
 (define_insn "load_macho_picbase_di"
@@ -281,6 +282,7 @@ You should have received a copy of the GNU General Public License
   return "bcl 20,31,%0\\n%0:";
 }
   [(set_attr "type" "branch")
+   (set_attr "cannot_copy" "yes")
    (set_attr "length" "4")])
 
 (define_expand "macho_correct_pic"
@@ -416,6 +418,7 @@ You should have received a copy of the GNU General Public License
     return "bcl 20,31,%0\\n%0:";
 }
   [(set_attr "type" "branch")
+   (set_attr "cannot_copy" "yes")
    (set_attr "length" "4")])
 
 (define_insn "reload_macho_picbase_di"
@@ -439,6 +442,7 @@ You should have received a copy of the GNU General Public License
     return "bcl 20,31,%0\\n%0:";
 }
   [(set_attr "type" "branch")
+   (set_attr "cannot_copy" "yes")
    (set_attr "length" "4")])
 
 ;; We need to restore the PIC register, at the site of nonlocal label.
-- 
2.8.1




More information about the Gcc-patches mailing list