public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/42894]  New: ICE internal consistency failure
@ 2010-01-28  7:48 raj dot khem at gmail dot com
  2010-01-28  7:49 ` [Bug target/42894] " raj dot khem at gmail dot com
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: raj dot khem at gmail dot com @ 2010-01-28  7:48 UTC (permalink / raw)
  To: gcc-bugs

on arm compiling attached file gcc ICE's

arm-oe-linux-uclibceabi-gcc -mthumb -O0 select.i
work fine at higher O level and also in arm mode.

libc/sysdeps/linux/common/select.c: In function '__syscall_select':             
libc/sysdeps/linux/common/select.c:75:73: error: invalid rtl sharing found in
the insn                                        
(insn 81 80 82 (unspec_volatile [                                               
            (const:SI (unspec:SI [                                              
                        (symbol_ref:SI ("__libc_errno") [flags 0x60] <var_decl
0x7fca82ba61e0 __libc_errno>)                  
                        (const_int 3 [0x3])
                        (const (unspec:SI [
                                    (const_int 0 [0x0])
                                ] 21))
                        (const_int 4 [0x4])
                    ] 20))
        ] 6) -1 (nil))
libc/sysdeps/linux/common/select.c:75:73: error: shared rtx
(const:SI (unspec:SI [
            (symbol_ref:SI ("__libc_errno") [flags 0x60] <var_decl
0x7fca82ba61e0 __libc_errno>)
            (const_int 3 [0x3])
            (const (unspec:SI [
                        (const_int 0 [0x0])
                    ] 21))
            (const_int 4 [0x4])
        ] 20))
libc/sysdeps/linux/common/select.c:75:73: internal compiler error: internal
consistency failure


-- 
           Summary: ICE internal consistency failure
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: raj dot khem at gmail dot com
 GCC build triplet: x86_64-linux
  GCC host triplet: x86_64-linux
GCC target triplet: arm-oe-linux-uclibceabi


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


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

* [Bug target/42894] ICE internal consistency failure
  2010-01-28  7:48 [Bug target/42894] New: ICE internal consistency failure raj dot khem at gmail dot com
@ 2010-01-28  7:49 ` raj dot khem at gmail dot com
  2010-01-29  8:02 ` ramana at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: raj dot khem at gmail dot com @ 2010-01-28  7:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from raj dot khem at gmail dot com  2010-01-28 07:49 -------
Created an attachment (id=19737)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19737&action=view)
testcase


-- 


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


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

* [Bug target/42894] ICE internal consistency failure
  2010-01-28  7:48 [Bug target/42894] New: ICE internal consistency failure raj dot khem at gmail dot com
  2010-01-28  7:49 ` [Bug target/42894] " raj dot khem at gmail dot com
@ 2010-01-29  8:02 ` ramana at gcc dot gnu dot org
  2010-01-29  8:04 ` [Bug target/42894] Invalid rtl sharing in Thumb1 ramana at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: ramana at gcc dot gnu dot org @ 2010-01-29  8:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from ramana at gcc dot gnu dot org  2010-01-29 08:02 -------
Created an attachment (id=19748)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19748&action=view)
Testcase

This is a Thumb1 ICE. For completeness , the architecture flags to be used are
-march=armv5te -mthumb. 

Attached is a reduced testcase. 


-- 


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


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

* [Bug target/42894] Invalid rtl sharing in Thumb1.
  2010-01-28  7:48 [Bug target/42894] New: ICE internal consistency failure raj dot khem at gmail dot com
  2010-01-28  7:49 ` [Bug target/42894] " raj dot khem at gmail dot com
  2010-01-29  8:02 ` ramana at gcc dot gnu dot org
@ 2010-01-29  8:04 ` ramana at gcc dot gnu dot org
  2010-01-29  8:30 ` ramana at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: ramana at gcc dot gnu dot org @ 2010-01-29  8:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from ramana at gcc dot gnu dot org  2010-01-29 08:04 -------
Confirmed. 


-- 

ramana at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |ice-on-valid-code
      Known to fail|                            |4.5.0
      Known to work|                            |4.4.3
   Last reconfirmed|0000-00-00 00:00:00         |2010-01-29 08:04:43
               date|                            |
            Summary|ICE internal consistency    |Invalid rtl sharing in
                   |failure                     |Thumb1.


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


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

* [Bug target/42894] Invalid rtl sharing in Thumb1.
  2010-01-28  7:48 [Bug target/42894] New: ICE internal consistency failure raj dot khem at gmail dot com
                   ` (2 preceding siblings ...)
  2010-01-29  8:04 ` [Bug target/42894] Invalid rtl sharing in Thumb1 ramana at gcc dot gnu dot org
@ 2010-01-29  8:30 ` ramana at gcc dot gnu dot org
  2010-01-29  9:14 ` [Bug target/42894] [4.5 Regression] " rguenth at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: ramana at gcc dot gnu dot org @ 2010-01-29  8:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from ramana at gcc dot gnu dot org  2010-01-29 08:30 -------
Marking as P2 .


-- 

ramana at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu dot
                   |                            |org, rearnsha at gcc dot gnu
                   |                            |dot org
 GCC target triplet|arm-oe-linux-uclibceabi     |arm-oe-linux-uclibceabi,
                   |                            |arm-linux-gnueabi
           Priority|P3                          |P2
   Target Milestone|---                         |4.5.0


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


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

* [Bug target/42894] [4.5 Regression] Invalid rtl sharing in Thumb1.
  2010-01-28  7:48 [Bug target/42894] New: ICE internal consistency failure raj dot khem at gmail dot com
                   ` (3 preceding siblings ...)
  2010-01-29  8:30 ` ramana at gcc dot gnu dot org
@ 2010-01-29  9:14 ` rguenth at gcc dot gnu dot org
  2010-02-02 13:42 ` rguenth at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-01-29  9:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rguenth at gcc dot gnu dot org  2010-01-29 09:14 -------
Only RMs may set priority.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-checking
           Priority|P2                          |P3
            Summary|Invalid rtl sharing in      |[4.5 Regression] Invalid rtl
                   |Thumb1.                     |sharing in Thumb1.


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


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

* [Bug target/42894] [4.5 Regression] Invalid rtl sharing in Thumb1.
  2010-01-28  7:48 [Bug target/42894] New: ICE internal consistency failure raj dot khem at gmail dot com
                   ` (4 preceding siblings ...)
  2010-01-29  9:14 ` [Bug target/42894] [4.5 Regression] " rguenth at gcc dot gnu dot org
@ 2010-02-02 13:42 ` rguenth at gcc dot gnu dot org
  2010-02-12 10:25 ` abel at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-02-02 13:42 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
           Priority|P3                          |P1


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


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

* [Bug target/42894] [4.5 Regression] Invalid rtl sharing in Thumb1.
  2010-01-28  7:48 [Bug target/42894] New: ICE internal consistency failure raj dot khem at gmail dot com
                   ` (5 preceding siblings ...)
  2010-02-02 13:42 ` rguenth at gcc dot gnu dot org
@ 2010-02-12 10:25 ` abel at gcc dot gnu dot org
  2010-02-12 19:39 ` raj dot khem at gmail dot com
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: abel at gcc dot gnu dot org @ 2010-02-12 10:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from abel at gcc dot gnu dot org  2010-02-12 10:25 -------
I could take a look at this, but I cannot reproduce the ICE no matter how I
try, both with the full and reduced testcases, both with current trunk and the
one of Jan 29 (host x86-64, target
arm-oe-linux-uclibceabi/arm-unknown-linux-gnueabi).  Can someone tell exactly
how the compiler should be configured?


-- 

abel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |abel at gcc dot gnu dot org


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


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

* [Bug target/42894] [4.5 Regression] Invalid rtl sharing in Thumb1.
  2010-01-28  7:48 [Bug target/42894] New: ICE internal consistency failure raj dot khem at gmail dot com
                   ` (6 preceding siblings ...)
  2010-02-12 10:25 ` abel at gcc dot gnu dot org
@ 2010-02-12 19:39 ` raj dot khem at gmail dot com
  2010-02-16  7:52 ` abel at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: raj dot khem at gmail dot com @ 2010-02-12 19:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from raj dot khem at gmail dot com  2010-02-12 19:39 -------
you could try standalone target 

../sources/gcc-trunk/configure --target=arm-none-eabi
--prefix=/scratch/oss/baremetal/arm-none-eabi/tools --enable-languages=c,c++
--with-newlib

and make sure that you pass -O0 -mthumb -march=armv5te
to gcc when compiling the testcase.


-- 


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


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

* [Bug target/42894] [4.5 Regression] Invalid rtl sharing in Thumb1.
  2010-01-28  7:48 [Bug target/42894] New: ICE internal consistency failure raj dot khem at gmail dot com
                   ` (7 preceding siblings ...)
  2010-02-12 19:39 ` raj dot khem at gmail dot com
@ 2010-02-16  7:52 ` abel at gcc dot gnu dot org
  2010-02-24 11:15 ` rearnsha at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: abel at gcc dot gnu dot org @ 2010-02-16  7:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from abel at gcc dot gnu dot org  2010-02-16 07:51 -------
I needed explicit --enable-tls to reproduce this.  The problem seems to be in
dump_minipool.  We are gathering values to fix in the Mnode structures and then
we are issuing insns with those values.  However, when a value is a constant,
we get two insns with the same CONST: parts of the pattern, which is not
permitted and is caught by the verifier.  

To fix this, it is enough to unshare the values before emitting.  The below
patch does this only for CONSTANT_P rtxes and fixes the bug.  Is it fine or do
we want to unconditionally unshare the rtx to be absolutely sure this will not
happen again?  I do not know ARM backend good enough to judge.

diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 466981a..2edae15 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -10917,6 +10917,8 @@ dump_minipool (rtx scan)
     {
       if (mp->refcount > 0)
        {
+         rtx value;
+
          if (dump_file)
            {
              fprintf (dump_file,
@@ -10927,35 +10929,36 @@ dump_minipool (rtx scan)
              fputc ('\n', dump_file);
            }

+         value = CONSTANT_P (mp->value) ? copy_rtx (mp->value) : mp->value;
          switch (mp->fix_size)
            {
 #ifdef HAVE_consttable_1
            case 1:
-             scan = emit_insn_after (gen_consttable_1 (mp->value), scan);
+             scan = emit_insn_after (gen_consttable_1 (value), scan);
              break;

 #endif
 #ifdef HAVE_consttable_2
            case 2:
-             scan = emit_insn_after (gen_consttable_2 (mp->value), scan);
+             scan = emit_insn_after (gen_consttable_2 (value), scan);
              break;

 #endif
 #ifdef HAVE_consttable_4
            case 4:
-             scan = emit_insn_after (gen_consttable_4 (mp->value), scan);
+             scan = emit_insn_after (gen_consttable_4 (value), scan);
              break;

 #endif
 #ifdef HAVE_consttable_8
            case 8:
-             scan = emit_insn_after (gen_consttable_8 (mp->value), scan);
+             scan = emit_insn_after (gen_consttable_8 (value), scan);
              break;

 #endif
 #ifdef HAVE_consttable_16
            case 16:
-              scan = emit_insn_after (gen_consttable_16 (mp->value), scan);
+              scan = emit_insn_after (gen_consttable_16 (value), scan);
               break;

 #endif


-- 


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


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

* [Bug target/42894] [4.5 Regression] Invalid rtl sharing in Thumb1.
  2010-01-28  7:48 [Bug target/42894] New: ICE internal consistency failure raj dot khem at gmail dot com
                   ` (8 preceding siblings ...)
  2010-02-16  7:52 ` abel at gcc dot gnu dot org
@ 2010-02-24 11:15 ` rearnsha at gcc dot gnu dot org
  2010-02-24 11:20 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: rearnsha at gcc dot gnu dot org @ 2010-02-24 11:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from rearnsha at gcc dot gnu dot org  2010-02-24 11:15 -------
I think the real problem here is that shared_const_p thinks that _this_ const
expression can't be shared (though I can't see any reason why it couldn't).

The comment in that function says, "CONST can be shared if it contains a
SYMBOL_REF.  If it contains a LABEL_REF, it isn't sharable", but it then
proceeds to check only that the expression is sym+const_int and assumes all
other cases are non-shareable.  That's really too restrictive.  A better check
would be that the expression contains no 'label-ref' node.

However, there might be some other port that relies on the existing
behaviour...


-- 


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


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

* [Bug target/42894] [4.5 Regression] Invalid rtl sharing in Thumb1.
  2010-01-28  7:48 [Bug target/42894] New: ICE internal consistency failure raj dot khem at gmail dot com
                   ` (9 preceding siblings ...)
  2010-02-24 11:15 ` rearnsha at gcc dot gnu dot org
@ 2010-02-24 11:20 ` pinskia at gcc dot gnu dot org
  2010-03-15 13:26 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-02-24 11:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from pinskia at gcc dot gnu dot org  2010-02-24 11:19 -------
> shared_const_p

Funny I was just helping with a PowerPC issue dealing with that function: see
PR 42431.  shared_const_p was introduced by the merge of the Dataflow branch
but the code was outlined and the original code was introduced by Richard
Kenner back in 1992.  I don't know any more history about that function besides
that.


-- 


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


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

* [Bug target/42894] [4.5 Regression] Invalid rtl sharing in Thumb1.
  2010-01-28  7:48 [Bug target/42894] New: ICE internal consistency failure raj dot khem at gmail dot com
                   ` (10 preceding siblings ...)
  2010-02-24 11:20 ` pinskia at gcc dot gnu dot org
@ 2010-03-15 13:26 ` rguenth at gcc dot gnu dot org
  2010-04-06 11:26 ` rguenth at gcc dot gnu dot org
  2010-07-31  9:33 ` [Bug target/42894] [4.5/4.6 " rguenth at gcc dot gnu dot org
  13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-03-15 13:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from rguenth at gcc dot gnu dot org  2010-03-15 13:26 -------
It sounds to me that this is a verifier issue, not a possible wrong-code issue.
Downgrading to P2 also because the predicate is the same since 4.3.0.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P2


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


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

* [Bug target/42894] [4.5 Regression] Invalid rtl sharing in Thumb1.
  2010-01-28  7:48 [Bug target/42894] New: ICE internal consistency failure raj dot khem at gmail dot com
                   ` (11 preceding siblings ...)
  2010-03-15 13:26 ` rguenth at gcc dot gnu dot org
@ 2010-04-06 11:26 ` rguenth at gcc dot gnu dot org
  2010-07-31  9:33 ` [Bug target/42894] [4.5/4.6 " rguenth at gcc dot gnu dot org
  13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-04-06 11:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from rguenth at gcc dot gnu dot org  2010-04-06 11:20 -------
GCC 4.5.0 is being released.  Deferring to 4.5.1.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.5.0                       |4.5.1


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


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

* [Bug target/42894] [4.5/4.6 Regression] Invalid rtl sharing in Thumb1.
  2010-01-28  7:48 [Bug target/42894] New: ICE internal consistency failure raj dot khem at gmail dot com
                   ` (12 preceding siblings ...)
  2010-04-06 11:26 ` rguenth at gcc dot gnu dot org
@ 2010-07-31  9:33 ` rguenth at gcc dot gnu dot org
  13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-07-31  9:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from rguenth at gcc dot gnu dot org  2010-07-31 09:29 -------
GCC 4.5.1 is being released, adjusting target milestone.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.5.1                       |4.5.2


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


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

end of thread, other threads:[~2010-07-31  9:33 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-28  7:48 [Bug target/42894] New: ICE internal consistency failure raj dot khem at gmail dot com
2010-01-28  7:49 ` [Bug target/42894] " raj dot khem at gmail dot com
2010-01-29  8:02 ` ramana at gcc dot gnu dot org
2010-01-29  8:04 ` [Bug target/42894] Invalid rtl sharing in Thumb1 ramana at gcc dot gnu dot org
2010-01-29  8:30 ` ramana at gcc dot gnu dot org
2010-01-29  9:14 ` [Bug target/42894] [4.5 Regression] " rguenth at gcc dot gnu dot org
2010-02-02 13:42 ` rguenth at gcc dot gnu dot org
2010-02-12 10:25 ` abel at gcc dot gnu dot org
2010-02-12 19:39 ` raj dot khem at gmail dot com
2010-02-16  7:52 ` abel at gcc dot gnu dot org
2010-02-24 11:15 ` rearnsha at gcc dot gnu dot org
2010-02-24 11:20 ` pinskia at gcc dot gnu dot org
2010-03-15 13:26 ` rguenth at gcc dot gnu dot org
2010-04-06 11:26 ` rguenth at gcc dot gnu dot org
2010-07-31  9:33 ` [Bug target/42894] [4.5/4.6 " rguenth 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).