This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: other/7114: ICE building strcoll.op from glibc-2.2.5
On Wed, Jul 17, 2002 at 12:10:12PM -0700, Geoff Keating wrote:
> The testsuite probably doesn't check that r30 is not clobbered in a
> nested function when profiling is switched on. Actually, Alan, could
> you write a test for that?
Can we assume a profiling library is available?
Implements dje's suggestion re. !TARGET_32BIT
gcc/ChangeLog
* config/rs6000/sysv4.h (ASM_OUTPUT_REG_PUSH): Remove 64-bit support.
(ASM_OUTPUT_REG_POP): Likewise.
gcc/testsuite/ChangeLog
* gcc.dg/nest.c: New.
Rather embarrassingly, this new testcase fails with a segfault on
powerpc64-linux, both before and after my change to the profiling
code. So I have another bug to look into..
--
Alan Modra
IBM OzLabs - Linux Technology Centre
Index: gcc/config/rs6000/sysv4.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/sysv4.h,v
retrieving revision 1.99
diff -u -p -r1.99 sysv4.h
--- gcc/config/rs6000/sysv4.h 18 Jul 2002 00:15:31 -0000 1.99
+++ gcc/config/rs6000/sysv4.h 18 Jul 2002 00:45:01 -0000
@@ -747,9 +747,7 @@ do { \
do { \
if (DEFAULT_ABI == ABI_V4) \
asm_fprintf (FILE, \
- (TARGET_32BIT \
- ? "\t{stu|stwu} %s,-16(%s)\n\t{st|stw} %s,12(%s)\n" \
- : "\tstdu %s,-32(%s)\n\tstd %s,24(%s)\n"), \
+ "\t{stu|stwu} %s,-16(%s)\n\t{st|stw} %s,12(%s)\n", \
reg_names[1], reg_names[1], reg_names[REGNO], \
reg_names[1]); \
} while (0)
@@ -761,9 +759,7 @@ do { \
do { \
if (DEFAULT_ABI == ABI_V4) \
asm_fprintf (FILE, \
- (TARGET_32BIT \
- ? "\t{l|lwz} %s,12(%s)\n\t{ai|addic} %s,%s,16\n" \
- : "\tld %s,24(%s)\n\t{ai|addic} %s,%s,32\n"), \
+ "\t{l|lwz} %s,12(%s)\n\t{ai|addic} %s,%s,16\n", \
reg_names[REGNO], reg_names[1], reg_names[1], \
reg_names[1]); \
} while (0)
Index: gcc/testsuite/gcc.dg/nest.c
===================================================================
RCS file: gcc/testsuite/gcc.dg/nest.c
diff -N gcc/testsuite/gcc.dg/nest.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gcc/testsuite/gcc.dg/nest.c 18 Jul 2002 00:45:10 -0000
@@ -0,0 +1,21 @@
+/* PR 5967, PR 7114 */
+/* { dg-do run } */
+/* { dg-options "-O2 -pg" } */
+
+long foo (long x)
+{
+ long i, sum = 0;
+ long bar (long z) { return z * 2; }
+
+ for (i = 0; i < x; i++)
+ sum += bar (i);
+
+ return sum;
+}
+
+int main (void)
+{
+ if (foo(10) != 90)
+ abort ();
+ return 0;
+}