This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug bootstrap/51872] New: [4.7 Regression] Shrink-wrapping with -mminimal-toc causes bootstrap failure
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 16 Jan 2012 16:14:09 +0000
- Subject: [Bug bootstrap/51872] New: [4.7 Regression] Shrink-wrapping with -mminimal-toc causes bootstrap failure
- Auto-submitted: auto-generated
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.