public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/42564]  New: ICE on sparc - unrecognizable insn
@ 2009-12-31 10:20 debian-gcc at lists dot debian dot org
  2009-12-31 10:20 ` [Bug target/42564] " debian-gcc at lists dot debian dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: debian-gcc at lists dot debian dot org @ 2009-12-31 10:20 UTC (permalink / raw)
  To: gcc-bugs

seen with current branches and trunk when building libcap-ng on sparc/sparc64.
the file builds without -fPIC or with -O0.

  Matthias

$ gcc-4.4 -c -O2 -fPIC cap-ng.i 
cap-ng.c: In function 'init':
cap-ng.c:154: error: unrecognizable insn:
(insn 18 17 19 4 cap-ng.c:139 (set (reg:SI 117)
        (lo_sum:SI (reg:SI 117)
            (unspec:SI [
                    (symbol_ref:SI ("m") [flags 0x1a] <var_decl 0xf7bafad0 m>)
                ] 0))) -1 (nil))
cap-ng.c:154: internal compiler error: in extract_insn, at recog.c:2048
Please submit a full bug report,
with preprocessed source if appropriate.


-- 
           Summary: ICE on sparc - unrecognizable insn
           Product: gcc
           Version: 4.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: debian-gcc at lists dot debian dot org
GCC target triplet: sparc-linux-gnu


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


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

* [Bug target/42564] ICE on sparc - unrecognizable insn
  2009-12-31 10:20 [Bug target/42564] New: ICE on sparc - unrecognizable insn debian-gcc at lists dot debian dot org
@ 2009-12-31 10:20 ` debian-gcc at lists dot debian dot org
  2009-12-31 17:37 ` ebotcazou at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: debian-gcc at lists dot debian dot org @ 2009-12-31 10:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from debian-gcc at lists dot debian dot org  2009-12-31 10:20 -------
Created an attachment (id=19429)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19429&action=view)
preprocessed source


-- 


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


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

* [Bug target/42564] ICE on sparc - unrecognizable insn
  2009-12-31 10:20 [Bug target/42564] New: ICE on sparc - unrecognizable insn debian-gcc at lists dot debian dot org
  2009-12-31 10:20 ` [Bug target/42564] " debian-gcc at lists dot debian dot org
@ 2009-12-31 17:37 ` ebotcazou at gcc dot gnu dot org
  2009-12-31 20:43 ` jakub at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2009-12-31 17:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from ebotcazou at gcc dot gnu dot org  2009-12-31 17:36 -------
I cannot reproduce with a cross, neither on mainline nor 4.4 branch.  Could you
post the command line passed to cc1?  Do you have relevant local patches?


-- 

ebotcazou at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |WAITING


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


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

* [Bug target/42564] ICE on sparc - unrecognizable insn
  2009-12-31 10:20 [Bug target/42564] New: ICE on sparc - unrecognizable insn debian-gcc at lists dot debian dot org
  2009-12-31 10:20 ` [Bug target/42564] " debian-gcc at lists dot debian dot org
  2009-12-31 17:37 ` ebotcazou at gcc dot gnu dot org
@ 2009-12-31 20:43 ` jakub at gcc dot gnu dot org
  2010-01-01 11:06 ` debian-gcc at lists dot debian dot org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-12-31 20:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jakub at gcc dot gnu dot org  2009-12-31 20:43 -------
I couldn't reproduce this either.


-- 


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


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

* [Bug target/42564] ICE on sparc - unrecognizable insn
  2009-12-31 10:20 [Bug target/42564] New: ICE on sparc - unrecognizable insn debian-gcc at lists dot debian dot org
                   ` (2 preceding siblings ...)
  2009-12-31 20:43 ` jakub at gcc dot gnu dot org
@ 2010-01-01 11:06 ` debian-gcc at lists dot debian dot org
  2010-01-02 10:42 ` debian-gcc at lists dot debian dot org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: debian-gcc at lists dot debian dot org @ 2010-01-01 11:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from debian-gcc at lists dot debian dot org  2010-01-01 11:06 -------
the sparc64-linux compiler from the trunk is configured with

         --with-pkgversion='Debian 20091228-2'
         --with-bugurl='file:///usr/share/doc/gcc-snapshot/README.Bugs'
         --enable-languages=c,c++,java,fortran,objc,obj-c++
         --prefix=/usr/lib/gcc-snapshot
         --enable-shared
         --with-system-zlib
         --disable-nls
         --enable-clocale=gnu
         --enable-libstdcxx-debug
         --enable-plugin
         --disable-browser-plugin
         --enable-java-awt=gtk
         --enable-gtk-cairo
         --with-java-home=//usr/lib/jvm/java-1.5.0-gcj-4.5-snap/jre
         --enable-java-home
         --with-jvm-root-dir=//usr/lib/jvm/java-1.5.0-gcj-4.5-snap
         --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.5-snap
         --with-arch-directory=sparc64
         --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
         --enable-objc-gc
         --disable-multilib
         --with-long-double-128
         --disable-werror
         --build=sparc64-linux-gnu
         --host=sparc64-linux-gnu
         --target=sparc64-linux-gnu

COLLECT_GCC_OPTIONS='-v' '-c' '-fPIC' '-O2' '-mcpu=v9'
 /usr/lib/gcc-snapshot/libexec/gcc/sparc64-linux-gnu/4.5.0/cc1 -fpreprocessed
cap-ng.i -quiet -dumpbase cap-ng.i -mcpu=v9 -auxbase cap-ng -O2 -version -fPIC
-o /tmp/ccGcfzUk.s

patches applied are:

pr40521-revert-workaround:
  Revert the dwarf2cfi_asm workaround, obsoleted by PR debug/40521.

gcc-ice-hack:
  Retry the build on an ice, save the calling options and preprocessed
  source when the ice is reproducible.

gcc-ice-apport:
  Report an ICE to apport (if apport is available
  and the environment variable GCC_NOAPPORT is not set)

plus two build patches for libjava and gcc/config/arm.

started a build without the pr40521-revert-workaround


-- 


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


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

* [Bug target/42564] ICE on sparc - unrecognizable insn
  2009-12-31 10:20 [Bug target/42564] New: ICE on sparc - unrecognizable insn debian-gcc at lists dot debian dot org
                   ` (3 preceding siblings ...)
  2010-01-01 11:06 ` debian-gcc at lists dot debian dot org
@ 2010-01-02 10:42 ` debian-gcc at lists dot debian dot org
  2010-01-02 17:33 ` ebotcazou at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: debian-gcc at lists dot debian dot org @ 2010-01-02 10:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from debian-gcc at lists dot debian dot org  2010-01-02 10:42 -------
not applying the pr40521-revert-workaround patch shows the ICE as well.


-- 


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


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

* [Bug target/42564] ICE on sparc - unrecognizable insn
  2009-12-31 10:20 [Bug target/42564] New: ICE on sparc - unrecognizable insn debian-gcc at lists dot debian dot org
                   ` (4 preceding siblings ...)
  2010-01-02 10:42 ` debian-gcc at lists dot debian dot org
@ 2010-01-02 17:33 ` ebotcazou at gcc dot gnu dot org
  2010-01-02 22:26 ` [Bug target/42564] unrecognizable insn with -O -fPIC ebotcazou at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2010-01-02 17:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from ebotcazou at gcc dot gnu dot org  2010-01-02 17:33 -------
I can reproduce on native (and with a cross by stealing the native
auto-host.h).


-- 

ebotcazou at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |ebotcazou at gcc dot gnu dot
                   |dot org                     |org
             Status|WAITING                     |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-01-02 17:33:26
               date|                            |


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


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

* [Bug target/42564] unrecognizable insn with -O -fPIC
  2009-12-31 10:20 [Bug target/42564] New: ICE on sparc - unrecognizable insn debian-gcc at lists dot debian dot org
                   ` (5 preceding siblings ...)
  2010-01-02 17:33 ` ebotcazou at gcc dot gnu dot org
@ 2010-01-02 22:26 ` ebotcazou at gcc dot gnu dot org
  2010-01-02 23:00 ` ebotcazou at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2010-01-02 22:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from ebotcazou at gcc dot gnu dot org  2010-01-02 22:26 -------
Created an attachment (id=19451)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19451&action=view)
Reduced testcase.

Requires TLS support.


-- 


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


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

* [Bug target/42564] unrecognizable insn with -O -fPIC
  2009-12-31 10:20 [Bug target/42564] New: ICE on sparc - unrecognizable insn debian-gcc at lists dot debian dot org
                   ` (6 preceding siblings ...)
  2010-01-02 22:26 ` [Bug target/42564] unrecognizable insn with -O -fPIC ebotcazou at gcc dot gnu dot org
@ 2010-01-02 23:00 ` ebotcazou at gcc dot gnu dot org
  2010-01-05 22:29 ` ebotcazou at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2010-01-02 23:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from ebotcazou at gcc dot gnu dot org  2010-01-02 23:00 -------
The root of the problem is plus_constant wrapping up a TLS symbol in a CONST:

(const:DI (plus:DI (symbol_ref:DI ("m") [flags 0x1a] <var_decl m>)
        (const_int 4 [0x4])))

what the SPARC back-end doesn't like.  So something like this works:

Index: explow.c
===================================================================
--- explow.c    (revision 155516)
+++ explow.c    (working copy)
@@ -137,7 +137,8 @@ plus_constant (rtx x, HOST_WIDE_INT c)

     case SYMBOL_REF:
     case LABEL_REF:
-      all_constant = 1;
+      if (CONSTANT_ADDRESS_P (x))
+       all_constant = 1;
       break;

     case PLUS:

but I presume other back-ends may not necessarily like it.


-- 


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


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

* [Bug target/42564] unrecognizable insn with -O -fPIC
  2009-12-31 10:20 [Bug target/42564] New: ICE on sparc - unrecognizable insn debian-gcc at lists dot debian dot org
                   ` (7 preceding siblings ...)
  2010-01-02 23:00 ` ebotcazou at gcc dot gnu dot org
@ 2010-01-05 22:29 ` ebotcazou at gcc dot gnu dot org
  2010-01-05 22:32 ` ebotcazou at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2010-01-05 22:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from ebotcazou at gcc dot gnu dot org  2010-01-05 22:29 -------
Subject: Bug 42564

Author: ebotcazou
Date: Tue Jan  5 22:29:18 2010
New Revision: 155662

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155662
Log:
        PR target/42564
        * config/sparc/sparc.h (SPARC_SYMBOL_REF_TLS_P): Delete.
        * config/sparc/sparc-protos.h (legitimize_pic_address): Likewise.
        (legitimize_tls_address): Likewise.
        (sparc_tls_referenced_p): Likewise.
        * config/sparc/sparc.c (sparc_expand_move): Use legitimize_tls_address
        and adjust calls to legitimize_pic_address.
        (legitimate_constant_p) Use sparc_tls_referenced_p.
        (legitimate_pic_operand_p): Likewise.
        (sparc_legitimate_address_p): Do not use SPARC_SYMBOL_REF_TLS_P.
        (sparc_tls_symbol_ref_1): Delete.
        (sparc_tls_referenced_p): Make static, recognize specific patterns.
        (legitimize_tls_address): Make static, handle CONST patterns.
        (legitimize_pic_address): Make static, remove unused parameter and
        adjust recursive calls.
        (sparc_legitimize_address): Make static, use sparc_tls_referenced_p
        and adjust call to legitimize_pic_address.
        (sparc_output_mi_thunk): Likewise.

Added:
    trunk/gcc/testsuite/gcc.dg/tls/opt-15.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/sparc/sparc-protos.h
    trunk/gcc/config/sparc/sparc.c
    trunk/gcc/config/sparc/sparc.h
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug target/42564] unrecognizable insn with -O -fPIC
  2009-12-31 10:20 [Bug target/42564] New: ICE on sparc - unrecognizable insn debian-gcc at lists dot debian dot org
                   ` (8 preceding siblings ...)
  2010-01-05 22:29 ` ebotcazou at gcc dot gnu dot org
@ 2010-01-05 22:32 ` ebotcazou at gcc dot gnu dot org
  2010-01-05 22:34 ` ebotcazou at gcc dot gnu dot org
  2010-01-05 22:43 ` ebotcazou at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2010-01-05 22:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from ebotcazou at gcc dot gnu dot org  2010-01-05 22:32 -------
Subject: Bug 42564

Author: ebotcazou
Date: Tue Jan  5 22:32:25 2010
New Revision: 155663

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155663
Log:
        PR target/42564
        * config/sparc/sparc.h (SPARC_SYMBOL_REF_TLS_P): Delete.
        * config/sparc/sparc-protos.h (legitimize_pic_address): Likewise.
        (legitimize_tls_address): Likewise.
        (sparc_tls_referenced_p): Likewise.
        * config/sparc/sparc.c (sparc_expand_move): Use legitimize_tls_address
        and adjust calls to legitimize_pic_address.
        (legitimate_constant_p) Use sparc_tls_referenced_p.
        (legitimate_pic_operand_p): Likewise.
        (sparc_legitimate_address_p): Do not use SPARC_SYMBOL_REF_TLS_P.
        (sparc_tls_symbol_ref_1): Delete.
        (sparc_tls_referenced_p): Make static, recognize specific patterns.
        (legitimize_tls_address): Make static, handle CONST patterns.
        (legitimize_pic_address): Make static, remove unused parameter and
        adjust recursive calls.
        (sparc_legitimize_address): Make static, use sparc_tls_referenced_p
        and adjust call to legitimize_pic_address.
        (sparc_output_mi_thunk): Likewise.

Added:
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/tls/opt-15.c
Modified:
    branches/gcc-4_4-branch/gcc/ChangeLog
    branches/gcc-4_4-branch/gcc/config/sparc/sparc-protos.h
    branches/gcc-4_4-branch/gcc/config/sparc/sparc.c
    branches/gcc-4_4-branch/gcc/config/sparc/sparc.h
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug target/42564] unrecognizable insn with -O -fPIC
  2009-12-31 10:20 [Bug target/42564] New: ICE on sparc - unrecognizable insn debian-gcc at lists dot debian dot org
                   ` (9 preceding siblings ...)
  2010-01-05 22:32 ` ebotcazou at gcc dot gnu dot org
@ 2010-01-05 22:34 ` ebotcazou at gcc dot gnu dot org
  2010-01-05 22:43 ` ebotcazou at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2010-01-05 22:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from ebotcazou at gcc dot gnu dot org  2010-01-05 22:34 -------
Subject: Bug 42564

Author: ebotcazou
Date: Tue Jan  5 22:34:01 2010
New Revision: 155664

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155664
Log:
        PR target/42564
        * config/sparc/sparc.h (SPARC_SYMBOL_REF_TLS_P): Delete.
        * config/sparc/sparc-protos.h (legitimize_pic_address): Likewise.
        (legitimize_tls_address): Likewise.
        (sparc_tls_referenced_p): Likewise.
        * config/sparc/sparc.c (sparc_expand_move): Use legitimize_tls_address
        and adjust calls to legitimize_pic_address.
        (legitimate_constant_p) Use sparc_tls_referenced_p.
        (legitimate_pic_operand_p): Likewise.
        (sparc_legitimate_address_p): Do not use SPARC_SYMBOL_REF_TLS_P.
        (sparc_tls_symbol_ref_1): Delete.
        (sparc_tls_referenced_p): Make static, recognize specific patterns.
        (legitimize_tls_address): Make static, handle CONST patterns.
        (legitimize_pic_address): Make static, remove unused parameter and
        adjust recursive calls.
        (sparc_legitimize_address): Make static, use sparc_tls_referenced_p
        and adjust call to legitimize_pic_address.
        (sparc_output_mi_thunk): Likewise.

Added:
    branches/gcc-4_3-branch/gcc/testsuite/gcc.dg/tls/opt-15.c
Modified:
    branches/gcc-4_3-branch/gcc/ChangeLog
    branches/gcc-4_3-branch/gcc/config/sparc/sparc-protos.h
    branches/gcc-4_3-branch/gcc/config/sparc/sparc.c
    branches/gcc-4_3-branch/gcc/config/sparc/sparc.h
    branches/gcc-4_3-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug target/42564] unrecognizable insn with -O -fPIC
  2009-12-31 10:20 [Bug target/42564] New: ICE on sparc - unrecognizable insn debian-gcc at lists dot debian dot org
                   ` (10 preceding siblings ...)
  2010-01-05 22:34 ` ebotcazou at gcc dot gnu dot org
@ 2010-01-05 22:43 ` ebotcazou at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2010-01-05 22:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from ebotcazou at gcc dot gnu dot org  2010-01-05 22:43 -------
On all active branches.


-- 

ebotcazou at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.3.5


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


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

end of thread, other threads:[~2010-01-05 22:43 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-31 10:20 [Bug target/42564] New: ICE on sparc - unrecognizable insn debian-gcc at lists dot debian dot org
2009-12-31 10:20 ` [Bug target/42564] " debian-gcc at lists dot debian dot org
2009-12-31 17:37 ` ebotcazou at gcc dot gnu dot org
2009-12-31 20:43 ` jakub at gcc dot gnu dot org
2010-01-01 11:06 ` debian-gcc at lists dot debian dot org
2010-01-02 10:42 ` debian-gcc at lists dot debian dot org
2010-01-02 17:33 ` ebotcazou at gcc dot gnu dot org
2010-01-02 22:26 ` [Bug target/42564] unrecognizable insn with -O -fPIC ebotcazou at gcc dot gnu dot org
2010-01-02 23:00 ` ebotcazou at gcc dot gnu dot org
2010-01-05 22:29 ` ebotcazou at gcc dot gnu dot org
2010-01-05 22:32 ` ebotcazou at gcc dot gnu dot org
2010-01-05 22:34 ` ebotcazou at gcc dot gnu dot org
2010-01-05 22:43 ` ebotcazou at gcc dot gnu dot 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).