diff mbox

PowerPC prologue and epilogue 6

Message ID 20120530132129.CFD663BE18@mailhost.lps.ens.fr
State New
Headers show

Commit Message

Dominique d'Humières May 30, 2012, 1:21 p.m. UTC
> Yes indeed, and it would be wise to ensure torture-options.exp is
> loaded too.  I'm committing the following as obvious.

Thanks

> Hmm, this will be because darwin is PIC by default.  Does adding
> -static to the dg-options line in savres.c fix the darwin fail?

With the following change


I get an ICE of the form

/opt/gcc/work/gcc/testsuite/gcc.target/powerpc/savres.c: In function 'nb_all':
/opt/gcc/work/gcc/testsuite/gcc.target/powerpc/savres.c:473:3: internal compiler error: in rs6000_emit_prologue, at config/rs6000/rs6000.c:19850

Is the test intended to work on PIC targets?

Cheers,

Dominique

Comments

Alan Modra May 31, 2012, 12:13 a.m. UTC | #1
On Wed, May 30, 2012 at 03:21:28PM +0200, Dominique Dhumieres wrote:
> I get an ICE of the form
> 
> /opt/gcc/work/gcc/testsuite/gcc.target/powerpc/savres.c: In function 'nb_all':
> /opt/gcc/work/gcc/testsuite/gcc.target/powerpc/savres.c:473:3: internal compiler error: in rs6000_emit_prologue, at config/rs6000/rs6000.c:19850
> 
> Is the test intended to work on PIC targets?

No, but see rs6000/darwin.h CC1_SPEC.  "-static" makes you non-PIC.

I've just built a darwin cc1 to reproduce the problem.  The ICE is on
	    START_USE (ptr_regno);
when setting up a reg to use for altivec saves.  The reg clashes with
the static chain pointer (nb_all is a nested function), so this is a
real bug that the register checks have uncovered.  I haven't
determined whether this is a new bug introduced with my prologue
changes, or whether it's a long-standing bug.  I suspect the latter.
Alan Modra May 31, 2012, 1:11 a.m. UTC | #2
On Thu, May 31, 2012 at 09:43:09AM +0930, Alan Modra wrote:
> real bug that the register checks have uncovered.  I haven't
> determined whether this is a new bug introduced with my prologue
> changes, or whether it's a long-standing bug.  I suspect the latter.

Looks like it is one I introduced.  gcc-4.6 uses r12 to save altivec
regs, my new code tries to use r11.  Will fix.
diff mbox

Patch

--- /opt/gcc/_gcc_clean/gcc/testsuite/gcc.target/powerpc/savres.c	2012-05-02 14:25:40.000000000 +0200
+++ /opt/gcc/work/gcc/testsuite/gcc.target/powerpc/savres.c	2012-05-30 13:45:15.000000000 +0200
@@ -1,5 +1,5 @@ 
 /* { dg-do run } */
-/* { dg-options "-fno-inline -fomit-frame-pointer" } */
+/* { dg-options "-fno-inline -fomit-frame-pointer -static" } */
 
 /* -fno-inline -maltivec -m32/-m64 -mmultiple/no-multiple -Os/-O2.  */
 #ifndef NO_BODY