public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/53853] New: FAIL: g++.dg/other/pr53811.C -std=gnu++* (internal compiler error)
@ 2012-07-04 12:25 dominiq at lps dot ens.fr
  2012-07-04 13:06 ` [Bug target/53853] " iains at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: dominiq at lps dot ens.fr @ 2012-07-04 12:25 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53853
           Summary: FAIL: g++.dg/other/pr53811.C -std=gnu++* (internal
                    compiler error)
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: dominiq@lps.ens.fr
                CC: iains@gcc.gnu.org, ubizjak@gmail.com
              Host: x86_64-apple-darwin10
            Target: x86_64-apple-darwin10
             Build: x86_64-apple-darwin10


g++.dg/other/pr53811.C fails on x86_64-apple-darwin10 with -m64:

FAIL: g++.dg/other/pr53811.C -std=gnu++98 (internal compiler error)
FAIL: g++.dg/other/pr53811.C -std=gnu++98 (test for excess errors)
FAIL: g++.dg/other/pr53811.C -std=gnu++11 (internal compiler error)
FAIL: g++.dg/other/pr53811.C -std=gnu++11 (test for excess errors)

The ICE is

Excess errors:
/opt/gcc/work/gcc/testsuite/g++.dg/other/pr53811.C:29:1: error: insn does not
satisfy its constraints:
(insn 3 2 4 (set (reg:DI 59)
        (const:DI (unspec:DI [
                    (symbol_ref:DI ("_ZN12ScriptString12CreateStringEPKc")
[flags 0x403] <function_decl 0x142987100 CreateString>)
                ] UNSPEC_GOTOFF))) 62 {*movdi_internal_rex64}
     (nil))

Note that ' -mcmodel=large' seems to have issues on x86_64-apple-darwin10: see
pr50077.


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

* [Bug target/53853] FAIL: g++.dg/other/pr53811.C -std=gnu++* (internal compiler error)
  2012-07-04 12:25 [Bug target/53853] New: FAIL: g++.dg/other/pr53811.C -std=gnu++* (internal compiler error) dominiq at lps dot ens.fr
@ 2012-07-04 13:06 ` iains at gcc dot gnu.org
  2012-07-05 12:07 ` ubizjak at gmail dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: iains at gcc dot gnu.org @ 2012-07-04 13:06 UTC (permalink / raw)
  To: gcc-bugs

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

Iain Sandoe <iains at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-07-04
     Ever Confirmed|0                           |1

--- Comment #1 from Iain Sandoe <iains at gcc dot gnu.org> 2012-07-04 13:05:45 UTC ---
Also on i686-darwin9 @m64

As commented in 50077, we don't support the large model.

I suppose the best thing to do in the short(ish) term is to make a target test
for large model support and make the tests that require it do that test.

Addition of large model support would be nice - but might be optimistic for 4.8
with the resources available to darwin at present.


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

* [Bug target/53853] FAIL: g++.dg/other/pr53811.C -std=gnu++* (internal compiler error)
  2012-07-04 12:25 [Bug target/53853] New: FAIL: g++.dg/other/pr53811.C -std=gnu++* (internal compiler error) dominiq at lps dot ens.fr
  2012-07-04 13:06 ` [Bug target/53853] " iains at gcc dot gnu.org
@ 2012-07-05 12:07 ` ubizjak at gmail dot com
  2012-07-05 12:10 ` ubizjak at gmail dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ubizjak at gmail dot com @ 2012-07-05 12:07 UTC (permalink / raw)
  To: gcc-bugs

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

Uros Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Uros Bizjak <ubizjak at gmail dot com> 2012-07-05 12:07:31 UTC ---
It turned out that -mcmodel -fPIC also ICEd on x86_64-pc-linux-gnu.

We need additional part to handle CM_LARGE_PIC, basically:

--cut here--
@@ -33057,6 +33059,10 @@ x86_output_mi_thunk (FILE *file,
     emit_jump_insn (gen_indirect_jump (fnaddr));
   else
     {
+      if (ix86_cmodel == CM_LARGE_PIC
+      && GET_CODE (fnaddr) == SYMBOL_REF)
+    fnaddr = construct_plt_address (fnaddr,
+                    gen_rtx_REG (Pmode, tmp_regno));
       if (!sibcall_insn_operand (fnaddr, word_mode))
     {
       tmp = gen_rtx_REG (word_mode, tmp_regno);
--cut here--

to create:

        .size   _ZN12ScriptString12CreateStringEPKc,
.-_ZN12ScriptString12CreateStringEPKc
        .set    .LTHUNK0,_ZN12ScriptString12CreateStringEPKc
        .p2align 4,,15
        .globl  _ZThn8_N12ScriptString12CreateStringEPKc
        .type   _ZThn8_N12ScriptString12CreateStringEPKc, @function
_ZThn8_N12ScriptString12CreateStringEPKc:
.LFB1:
        .cfi_startproc
        subq    $8, %rdi
        movabsq $.LTHUNK0@PLTOFF, %r10
        addq    %rbx, %r10
        jmp     *%r10
        .cfi_endproc

I'd like to ask Jakub fo opinion here. The generated code otherwise works OK
for a couple of tests (g++.dg/inherit/thunk*.C) when compiled with
-mcmodel=large -fPIC.


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

* [Bug target/53853] FAIL: g++.dg/other/pr53811.C -std=gnu++* (internal compiler error)
  2012-07-04 12:25 [Bug target/53853] New: FAIL: g++.dg/other/pr53811.C -std=gnu++* (internal compiler error) dominiq at lps dot ens.fr
  2012-07-04 13:06 ` [Bug target/53853] " iains at gcc dot gnu.org
  2012-07-05 12:07 ` ubizjak at gmail dot com
@ 2012-07-05 12:10 ` ubizjak at gmail dot com
  2012-07-05 14:07 ` dominiq at lps dot ens.fr
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ubizjak at gmail dot com @ 2012-07-05 12:10 UTC (permalink / raw)
  To: gcc-bugs

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

Uros Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |ubizjak at gmail dot com
                   |gnu.org                     |

--- Comment #3 from Uros Bizjak <ubizjak at gmail dot com> 2012-07-05 12:09:36 UTC ---
Created attachment 27746
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27746
Patch to fix the ICE with -fPIC

The complete patch in testing.


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

* [Bug target/53853] FAIL: g++.dg/other/pr53811.C -std=gnu++* (internal compiler error)
  2012-07-04 12:25 [Bug target/53853] New: FAIL: g++.dg/other/pr53811.C -std=gnu++* (internal compiler error) dominiq at lps dot ens.fr
                   ` (2 preceding siblings ...)
  2012-07-05 12:10 ` ubizjak at gmail dot com
@ 2012-07-05 14:07 ` dominiq at lps dot ens.fr
  2012-07-06  7:45 ` ubizjak at gmail dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dominiq at lps dot ens.fr @ 2012-07-05 14:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2012-07-05 14:07:00 UTC ---
The patch in comment #3 fixes the PR. Full regstrapping scheduled for tonight.


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

* [Bug target/53853] FAIL: g++.dg/other/pr53811.C -std=gnu++* (internal compiler error)
  2012-07-04 12:25 [Bug target/53853] New: FAIL: g++.dg/other/pr53811.C -std=gnu++* (internal compiler error) dominiq at lps dot ens.fr
                   ` (3 preceding siblings ...)
  2012-07-05 14:07 ` dominiq at lps dot ens.fr
@ 2012-07-06  7:45 ` ubizjak at gmail dot com
  2012-07-06 10:03 ` ubizjak at gmail dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ubizjak at gmail dot com @ 2012-07-06  7:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Uros Bizjak <ubizjak at gmail dot com> 2012-07-06 07:45:21 UTC ---
We can leave all the magic to legitimize_pic_address, so following alternative
patch is much clearer:

--cut here--
Index: i386.c
===================================================================
--- i386.c      (revision 189310)
+++ i386.c      (working copy)
@@ -33057,6 +33057,10 @@ x86_output_mi_thunk (FILE *file,
     emit_jump_insn (gen_indirect_jump (fnaddr));
   else
     {
+      if (flag_pic && SYMBOLIC_CONST (fnaddr))
+       fnaddr = legitimize_pic_address (fnaddr,
+                                        gen_rtx_REG (Pmode, tmp_regno));
+
       if (!sibcall_insn_operand (fnaddr, word_mode))
        {
          tmp = gen_rtx_REG (word_mode, tmp_regno);
--cut here--

With this patch, we get:

        .size   _ZN1D4foo2Ev, .-_ZN1D4foo2Ev
        .set    .LTHUNK0,_ZN1D4foo2Ev
        .p2align 4,,15
        .globl  _ZThn16_N1D4foo2Ev
        .type   _ZThn16_N1D4foo2Ev, @function
_ZThn16_N1D4foo2Ev:
.LFB15:
        .cfi_startproc
        subq    $16, %rdi
        movabsq $.LTHUNK0@GOTOFF, %r10
        addq    %rbx, %r10
        jmp     *%r10
        .cfi_endproc
.LFE15:
        .size   _ZThn16_N1D4foo2Ev, .-_ZThn16_N1D4foo2Ev

So, load off GOTOFF table, which works as well.


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

* [Bug target/53853] FAIL: g++.dg/other/pr53811.C -std=gnu++* (internal compiler error)
  2012-07-04 12:25 [Bug target/53853] New: FAIL: g++.dg/other/pr53811.C -std=gnu++* (internal compiler error) dominiq at lps dot ens.fr
                   ` (4 preceding siblings ...)
  2012-07-06  7:45 ` ubizjak at gmail dot com
@ 2012-07-06 10:03 ` ubizjak at gmail dot com
  2012-07-10 17:54 ` uros at gcc dot gnu.org
  2012-07-10 17:56 ` ubizjak at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: ubizjak at gmail dot com @ 2012-07-06 10:03 UTC (permalink / raw)
  To: gcc-bugs

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

Uros Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.7.2

--- Comment #6 from Uros Bizjak <ubizjak at gmail dot com> 2012-07-06 10:02:38 UTC ---
Author: uros
Date: Fri Jul  6 10:00:11 2012
New Revision: 189315

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189315
Log:
    PR target/53853
    * config/i386/i386.c (x86_output_mi_thunk): For CM_LARGE_PIC model,
    emit PIC sequence for fnaddr symbol reference in advance.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386.c


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

* [Bug target/53853] FAIL: g++.dg/other/pr53811.C -std=gnu++* (internal compiler error)
  2012-07-04 12:25 [Bug target/53853] New: FAIL: g++.dg/other/pr53811.C -std=gnu++* (internal compiler error) dominiq at lps dot ens.fr
                   ` (5 preceding siblings ...)
  2012-07-06 10:03 ` ubizjak at gmail dot com
@ 2012-07-10 17:54 ` uros at gcc dot gnu.org
  2012-07-10 17:56 ` ubizjak at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: uros at gcc dot gnu.org @ 2012-07-10 17:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from uros at gcc dot gnu.org 2012-07-10 17:53:56 UTC ---
Author: uros
Date: Tue Jul 10 17:53:48 2012
New Revision: 189412

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189412
Log:
    Backport from mainline
    2012-07-03  Uros Bizjak  <ubizjak@gmail.com>

    PR target/53811
    * config/i386/i386.c (x86_output_mi_thunk): Check if fnaddr satisfies
    sibcall_insn_operand.  Move it to a temporary register if not.

    2012-07-06  Uros Bizjak  <ubizjak@gmail.com>

    PR target/53853
    * config/i386/i386.c (x86_output_mi_thunk): For CM_LARGE_PIC model,
    emit PIC sequence for fnaddr symbol reference in advance.

testsuite/ChangeLog:

    Backport from mainline
    2012-07-03  Uros Bizjak  <ubizjak@gmail.com>

    PR target/53811
    * g++.dg/other/pr53811.C: New test.


Added:
    branches/gcc-4_7-branch/gcc/testsuite/g++.dg/other/pr53811.C
Modified:
    branches/gcc-4_7-branch/gcc/ChangeLog
    branches/gcc-4_7-branch/gcc/config/i386/i386.c
    branches/gcc-4_7-branch/gcc/testsuite/ChangeLog


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

* [Bug target/53853] FAIL: g++.dg/other/pr53811.C -std=gnu++* (internal compiler error)
  2012-07-04 12:25 [Bug target/53853] New: FAIL: g++.dg/other/pr53811.C -std=gnu++* (internal compiler error) dominiq at lps dot ens.fr
                   ` (6 preceding siblings ...)
  2012-07-10 17:54 ` uros at gcc dot gnu.org
@ 2012-07-10 17:56 ` ubizjak at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: ubizjak at gmail dot com @ 2012-07-10 17:56 UTC (permalink / raw)
  To: gcc-bugs

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

Uros Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #8 from Uros Bizjak <ubizjak at gmail dot com> 2012-07-10 17:56:32 UTC ---
Fixed.


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

end of thread, other threads:[~2012-07-10 17:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-04 12:25 [Bug target/53853] New: FAIL: g++.dg/other/pr53811.C -std=gnu++* (internal compiler error) dominiq at lps dot ens.fr
2012-07-04 13:06 ` [Bug target/53853] " iains at gcc dot gnu.org
2012-07-05 12:07 ` ubizjak at gmail dot com
2012-07-05 12:10 ` ubizjak at gmail dot com
2012-07-05 14:07 ` dominiq at lps dot ens.fr
2012-07-06  7:45 ` ubizjak at gmail dot com
2012-07-06 10:03 ` ubizjak at gmail dot com
2012-07-10 17:54 ` uros at gcc dot gnu.org
2012-07-10 17:56 ` ubizjak at gmail dot com

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