+2004-06-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/16195
+ * config/rs6000/rs6000.c (rs6000_conditional_register_usage): Make
+ r30 fixed if TARGET_TOC && TARGET_MINIMAL_TOC.
+ (first_reg_to_save): Pretend call_used_regs[30] is 0 if
+ TARGET_TOC && TARGET_MINIMAL_TOC.
+ (rs6000_emit_prologue, rs6000_emit_epilogue): Likewise.
+
2004-06-29 J"orn Rennecke <joern.rennecke@superh.com>
Fix gcc.dg/builtin-apply2.c failures:
= call_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM]
= call_really_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1;
+ if (TARGET_TOC && TARGET_MINIMAL_TOC)
+ fixed_regs[RS6000_PIC_OFFSET_TABLE_REGNUM]
+ = call_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1;
+
if (TARGET_ALTIVEC)
global_regs[VSCR_REGNO] = 1;
&& (! call_used_regs[first_reg]
|| (first_reg == RS6000_PIC_OFFSET_TABLE_REGNUM
&& ((DEFAULT_ABI == ABI_V4 && flag_pic != 0)
- || (DEFAULT_ABI == ABI_DARWIN && flag_pic)))))
+ || (DEFAULT_ABI == ABI_DARWIN && flag_pic)
+ || (TARGET_TOC && TARGET_MINIMAL_TOC)))))
break;
#if TARGET_MACHO
int i;
for (i = 0; i < 32 - info->first_gp_reg_save; i++)
if ((regs_ever_live[info->first_gp_reg_save+i]
- && ! call_used_regs[info->first_gp_reg_save+i])
+ && (! call_used_regs[info->first_gp_reg_save+i]
+ || (i+info->first_gp_reg_save
+ == RS6000_PIC_OFFSET_TABLE_REGNUM
+ && TARGET_TOC && TARGET_MINIMAL_TOC)))
|| (i+info->first_gp_reg_save == RS6000_PIC_OFFSET_TABLE_REGNUM
&& ((DEFAULT_ABI == ABI_V4 && flag_pic != 0)
|| (DEFAULT_ABI == ABI_DARWIN && flag_pic))))
else
for (i = 0; i < 32 - info->first_gp_reg_save; i++)
if ((regs_ever_live[info->first_gp_reg_save+i]
- && ! call_used_regs[info->first_gp_reg_save+i])
+ && (! call_used_regs[info->first_gp_reg_save+i]
+ || (i+info->first_gp_reg_save == RS6000_PIC_OFFSET_TABLE_REGNUM
+ && TARGET_TOC && TARGET_MINIMAL_TOC)))
|| (i+info->first_gp_reg_save == RS6000_PIC_OFFSET_TABLE_REGNUM
&& ((DEFAULT_ABI == ABI_V4 && flag_pic != 0)
|| (DEFAULT_ABI == ABI_DARWIN && flag_pic))))
--- /dev/null
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+/* { dg-options "-mminimal-toc" { target powerpc64-*-* powerpc-ibm-aix* } } */
+
+extern void abort (void);
+extern void exit (int);
+
+double __attribute__((noinline))
+foo (void)
+{
+ return 16441577472.0;
+}
+
+double __attribute__((noinline))
+bar (double x)
+{
+ return x;
+}
+
+int __attribute__((noinline))
+test (void)
+{
+ double x = foo ();
+ x = bar (x);
+ x /= 1024 * 1024 * 1024;
+ x *= 70;
+ x = x < 70 ? x : 70;
+ x += 30;
+ return x;
+}
+
+int main (void)
+{
+ if (test () != 100)
+ abort ();
+ exit (0);
+}