public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/51872] New: [4.7 Regression] Shrink-wrapping with -mminimal-toc causes bootstrap failure
@ 2012-01-16 16:25 jakub at gcc dot gnu.org
  2012-01-16 16:18 ` [Bug bootstrap/51872] " jakub at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-01-16 16:25 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51872

             Bug #: 51872
           Summary: [4.7 Regression] Shrink-wrapping with -mminimal-toc
                    causes bootstrap failure
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: bootstrap
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jakub@gcc.gnu.org
                CC: amodra@gcc.gnu.org, bernds@gcc.gnu.org,
                    dje@gcc.gnu.org
            Target: powerpc64-linux


powerpc64-linux doesn't bootstrap with -mminimal-toc in CFLAGS/CXXFLAGS, due to
shrink-wrapping, as crtbegin.o is miscompiled.

Short testcase for -m64 -O2 -mminimal-toc:
static void *var[] __attribute__ ((used, section("jlist"),
aligned(sizeof(void*)))) = { };
extern void bar (void *) __attribute__ ((weak));

static void __attribute__((noinline, noclone))
baz (void)
{
  asm volatile ("" : : : "memory");
}

void
foo (void)
{
  if (var[0])
    {
      void (*register_classes) (void *) = bar;
      __asm ("" : "+r" (register_classes));
      if (register_classes)
       register_classes (var);
    }
  baz ();
}

The problem is that the TOC register (r30) isn't added to the
set_up_by_prologue
regset (flag_pic is 0, TARGET_MINIMAL_TOC is true and the prologue computes the
TOC_REGISTER).  I wonder if we don't need a target hook that will add
additional registers to set_up_by_prologue regset.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-01-17 16:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-16 16:25 [Bug bootstrap/51872] New: [4.7 Regression] Shrink-wrapping with -mminimal-toc causes bootstrap failure jakub at gcc dot gnu.org
2012-01-16 16:18 ` [Bug bootstrap/51872] " jakub at gcc dot gnu.org
2012-01-16 17:39 ` jakub at gcc dot gnu.org
2012-01-16 18:46 ` pinskia at gcc dot gnu.org
2012-01-16 18:56 ` [Bug target/51872] " jakub at gcc dot gnu.org
2012-01-17 16:35 ` jakub at gcc dot gnu.org
2012-01-17 17:03 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).