From 38dce2c34c72c8292775fdd2099517143b86da33 Mon Sep 17 00:00:00 2001 From: Iain Sandoe Date: Sun, 11 Dec 2016 19:24:46 +0000 Subject: [PATCH] [Darwin, PPC] Fix PR71496 by marking pic base loads as non-copyable. The Darwin pic base loads (and reloads for non-local-gotos) are not validly copied (since the pic base label would be duplicated). Thus, mark the pic base {re-}loads as non-copyable. gcc/ 2016-12-11 Iain Sandoe 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. From-SVN: r243532 --- gcc/ChangeLog | 7 +++++++ gcc/config/rs6000/darwin.md | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 54558cd..e2809f0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-12-11 Iain Sandoe + + 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. + 2012-12-11 John David Anglin * config/pa/pa.c (pa_callee_copies): New function. diff --git a/gcc/config/rs6000/darwin.md b/gcc/config/rs6000/darwin.md index 5870e0a..9fbccd4 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.7.4