From 6d2538f5f9eeaf3851c35101c8586ac51c772389 Mon Sep 17 00:00:00 2001 From: Julian Brown Date: Wed, 25 Feb 2009 07:18:01 +0000 Subject: [PATCH] re PR target/35965 ([4.3 only] -fstack-protector produces segfaulting binaries on arm/armel) 2009-02-24 Julian Brown PR target/35965 * config/arm/arm.c (require_pic_register): Only set cfun->machine->pic_reg once per function. Patch commited by Doug Kwan From-SVN: r144424 --- gcc/ChangeLog | 6 ++++++ gcc/config/arm/arm.c | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fb344c856929..64eded241b88 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2009-02-24 Julian Brown + + PR target/35965 + * config/arm/arm.c (require_pic_register): Only set + cfun->machine->pic_reg once per function. + 2009-02-24 Sandra Loosemore * doc/invoke.texi (Link Options): Document an easier way to pass diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index c25fc29e411e..662e7de1e491 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -3563,7 +3563,8 @@ require_pic_register (void) gcc_assert (can_create_pseudo_p ()); if (arm_pic_register != INVALID_REGNUM) { - cfun->machine->pic_reg = gen_rtx_REG (Pmode, arm_pic_register); + if (!cfun->machine->pic_reg) + cfun->machine->pic_reg = gen_rtx_REG (Pmode, arm_pic_register); /* Play games to avoid marking the function as needing pic if we are being called as part of the cost-estimation @@ -3575,7 +3576,8 @@ require_pic_register (void) { rtx seq; - cfun->machine->pic_reg = gen_reg_rtx (Pmode); + if (!cfun->machine->pic_reg) + cfun->machine->pic_reg = gen_reg_rtx (Pmode); /* Play games to avoid marking the function as needing pic if we are being called as part of the cost-estimation -- 2.47.2