public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/51872] [4.7 Regression] Shrink-wrapping with -mminimal-toc causes bootstrap failure
  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 ` jakub at gcc dot gnu.org
  2012-01-16 17:39 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-01-16 16:18 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
   Target Milestone|---                         |4.7.0


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

* [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

* [Bug bootstrap/51872] [4.7 Regression] Shrink-wrapping with -mminimal-toc causes bootstrap failure
  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
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-01-16 17:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-01-16 17:07:48 UTC ---
Created attachment 26342
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26342
gcc47-pr51872.patch

Untested fix.


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

* [Bug bootstrap/51872] [4.7 Regression] Shrink-wrapping with -mminimal-toc causes bootstrap failure
  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
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-01-16 18:46 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-01-16
     Ever Confirmed|0                           |1

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-01-16 18:39:51 UTC ---
(In reply to comment #1)
> Created attachment 26342 [details]
> gcc47-pr51872.patch
> 
> Untested fix.

The documentation for this new target hook should really be in target.def
rather in tm.texi.in.


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

* [Bug target/51872] [4.7 Regression] Shrink-wrapping with -mminimal-toc causes bootstrap failure
  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
                   ` (2 preceding siblings ...)
  2012-01-16 18:46 ` pinskia at gcc dot gnu.org
@ 2012-01-16 18:56 ` 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
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-01-16 18:56 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #26342|0                           |1
        is obsolete|                            |

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-01-16 18:55:09 UTC ---
Created attachment 26345
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26345
gcc47-pr51872.patch

Patch that moves the documentation over.


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

* [Bug target/51872] [4.7 Regression] Shrink-wrapping with -mminimal-toc causes bootstrap failure
  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
                   ` (3 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-01-17 16:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-01-17 16:21:56 UTC ---
Author: jakub
Date: Tue Jan 17 16:21:49 2012
New Revision: 183254

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=183254
Log:
    PR bootstrap/51872
    * hard-reg-set.h (struct hard_reg_set_container): New type.
    * target.h (struct hard_reg_set_container): Forward declare.
    * target.def (set_up_by_prologue): New target hook.
    * doc/tm.texi.in (TARGET_SET_UP_BY_PROLOGUE): Document it.
    * doc/tm.texi: Regenerated.
    * function.c (thread_prologue_and_epilogue_insns): Change
    set_up_by_prologue HARD_REG_SET into struct hard_reg_set_container.
    Call targetm.set_up_by_prologue on it.
    * config/rs6000/rs6000.c (rs6000_set_up_by_prologue): New function.
    (TARGET_SET_UP_BY_PROLOGUE): Redefine to it.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/rs6000/rs6000.c
    trunk/gcc/doc/tm.texi
    trunk/gcc/doc/tm.texi.in
    trunk/gcc/function.c
    trunk/gcc/hard-reg-set.h
    trunk/gcc/target.def
    trunk/gcc/target.h


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

* [Bug target/51872] [4.7 Regression] Shrink-wrapping with -mminimal-toc causes bootstrap failure
  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
                   ` (4 preceding siblings ...)
  2012-01-17 16:35 ` jakub at gcc dot gnu.org
@ 2012-01-17 17:03 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-01-17 17:03 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
         AssignedTo|unassigned at gcc dot       |jakub at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-01-17 16:34:41 UTC ---
Fixed.


^ 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).