public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/43764]  New: -mrelax-pic-calls fails with complex types
@ 2010-04-16  4:00 wilson at gcc dot gnu dot org
  2010-05-20  6:27 ` [Bug target/43764] " wilson at gcc dot gnu dot org
  2010-05-20  6:28 ` wilson at gcc dot gnu dot org
  0 siblings, 2 replies; 5+ messages in thread
From: wilson at gcc dot gnu dot org @ 2010-04-16  4:00 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2426 bytes --]

Compiling code that calls a function that returns a complex type with
-mrelax-pic-calls results in an ICE.

khazaddum$ cat tmp.c
__complex__ double cd;
__complex__ double foo (void) { return cd; }
void bar (void) { cd = foo (); }
khazaddum$ ./xgcc -B./ -mabicalls -G0 -mrelax-pic-calls -mexplicit-relocs -O -S
tmp.c
tmp.c: In function ‘bar’:
tmp.c:3:1: error: could not split insn
(call_insn/i 6 18 7 tmp.c:3 (parallel [
            (set (reg:DF 32 $f0)
                (call (mem:SI (reg/f:SI 25 $25 [195]) [0 S4 A32])
                    (unspec [
                            (const_int 16 [0x10])
                            (symbol_ref:SI ("foo") [flags 0x3] <function_decl
0xb74f4000 foo>)
                        ] 55)))
            (set (reg:DF 34 $f2)
                (call (mem:SI (reg/f:SI 25 $25 [195]) [0 S4 A32])
                    (const_int 16 [0x10])))
            (clobber (reg:SI 31 $31))
        ]) 574 {call_value_multiple_internal} (expr_list:REG_DEAD (reg/f:SI 25
$25 [195])
        (expr_list:REG_EH_REGION (const_int 0 [0x0])
            (nil)))
    (expr_list:REG_DEP_TRUE (use (reg:SI 79 $fakec))
        (nil)))
tmp.c:3:1: internal compiler error: in final_scan_insn, at final.c:2650
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

I used a mipsisa32r2-sde-elf toolchain for this, configured without an
assembler.  If you configure properly with an assembler, then it isn't
necessary to give the -mrelax-pic-calls and -mexplicit-relocs options.  All you
need it -mabicalls and -G 0.

The problem is in mips_annotate_pic_calls.  It looks for a CALL rtx, and then
modifies it.  Unfortunately, a function returning complex has a call insn with
2 CALL rtx.  Because only one was modified, we end up with unrecognizable RTL. 
We either need to disable the optimization in this case, or extend it to work
with a call insn with more than one CALL rtx.  The first one is easier, the
second one is preferable.


-- 
           Summary: -mrelax-pic-calls fails with complex types
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: wilson at gcc dot gnu dot org
GCC target triplet: mips*-*-*


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


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

* [Bug target/43764] -mrelax-pic-calls fails with complex types
  2010-04-16  4:00 [Bug target/43764] New: -mrelax-pic-calls fails with complex types wilson at gcc dot gnu dot org
@ 2010-05-20  6:27 ` wilson at gcc dot gnu dot org
  2010-05-20  6:28 ` wilson at gcc dot gnu dot org
  1 sibling, 0 replies; 5+ messages in thread
From: wilson at gcc dot gnu dot org @ 2010-05-20  6:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from wilson at gcc dot gnu dot org  2010-05-20 06:27 -------
Subject: Bug 43764

Author: wilson
Date: Thu May 20 06:26:52 2010
New Revision: 159610

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159610
Log:
PR target/43764
* mips.c (mips_call_expr_from_insn): New arg second_call.  Set it.
(mips_annotate_pic_calls): Pass new arg to mips_call_expr_from_insn.
Use it.

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


-- 


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


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

* [Bug target/43764] -mrelax-pic-calls fails with complex types
  2010-04-16  4:00 [Bug target/43764] New: -mrelax-pic-calls fails with complex types wilson at gcc dot gnu dot org
  2010-05-20  6:27 ` [Bug target/43764] " wilson at gcc dot gnu dot org
@ 2010-05-20  6:28 ` wilson at gcc dot gnu dot org
  1 sibling, 0 replies; 5+ messages in thread
From: wilson at gcc dot gnu dot org @ 2010-05-20  6:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from wilson at gcc dot gnu dot org  2010-05-20 06:27 -------
Mine.


-- 

wilson at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |wilson at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-05-20 06:27:28
               date|                            |


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


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

* [Bug target/43764] -mrelax-pic-calls fails with complex types
       [not found] <bug-43764-4@http.gcc.gnu.org/bugzilla/>
  2010-09-28 10:05 ` rsandifo at gcc dot gnu.org
@ 2012-12-21 23:56 ` sje at gcc dot gnu.org
  1 sibling, 0 replies; 5+ messages in thread
From: sje at gcc dot gnu.org @ 2012-12-21 23:56 UTC (permalink / raw)
  To: gcc-bugs


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

Steve Ellcey <sje at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
                 CC|                            |sje at gcc dot gnu.org
         Resolution|                            |FIXED

--- Comment #4 from Steve Ellcey <sje at gcc dot gnu.org> 2012-12-21 23:56:28 UTC ---
It looks like this bug was fixed for 4.6 and backported to 4.5 so I am closing
it. I don't see any reason for it still being open.


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

* [Bug target/43764] -mrelax-pic-calls fails with complex types
       [not found] <bug-43764-4@http.gcc.gnu.org/bugzilla/>
@ 2010-09-28 10:05 ` rsandifo at gcc dot gnu.org
  2012-12-21 23:56 ` sje at gcc dot gnu.org
  1 sibling, 0 replies; 5+ messages in thread
From: rsandifo at gcc dot gnu.org @ 2010-09-28 10:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> 2010-09-27 19:48:39 UTC ---
Author: rsandifo
Date: Mon Sep 27 19:48:35 2010
New Revision: 164662

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=164662
Log:
gcc/
    Backport from mainline:

    2010-05-19  James E. Wilson  <wilson@codesourcery.com>

    PR target/43764
    * config/mips/mips.c (mips_call_expr_from_insn): New arg second_call.
    Set it.
    (mips_annotate_pic_calls): Pass new arg to mips_call_expr_from_insn.
    Use it.

Modified:
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/config/mips/mips.c


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

end of thread, other threads:[~2012-12-21 23:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-16  4:00 [Bug target/43764] New: -mrelax-pic-calls fails with complex types wilson at gcc dot gnu dot org
2010-05-20  6:27 ` [Bug target/43764] " wilson at gcc dot gnu dot org
2010-05-20  6:28 ` wilson at gcc dot gnu dot org
     [not found] <bug-43764-4@http.gcc.gnu.org/bugzilla/>
2010-09-28 10:05 ` rsandifo at gcc dot gnu.org
2012-12-21 23:56 ` sje 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).