public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/40861]  New: ICE in simplify_subreg, at simplify-rtx.c:4981
@ 2009-07-26 15:15 regehr at cs dot utah dot edu
  2009-07-26 15:16 ` [Bug rtl-optimization/40861] [4.5 Regression] " pinskia at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: regehr at cs dot utah dot edu @ 2009-07-26 15:15 UTC (permalink / raw)
  To: gcc-bugs

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

Seen on Ubuntu Hardy.

regehr@john-home:~/volatile/tmp179$ current-gcc -O3 -c small.c
small.c: In function ‘box’:
small.c:29:3: warning: overflow in implicit constant conversion
small.c:31:1: internal compiler error: in simplify_subreg, at
simplify-rtx.c:4981
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

regehr@john-home:~/volatile/tmp179$ current-gcc -v

Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/home/regehr/z/tmp/gcc-r150096-install
--program-prefix=r150096- --enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20090726 (experimental) (GCC) 

regehr@john-home:~/volatile/tmp179$ cat small.c

int foo (int _left, int _right)
{
  return 1 >= 1 * 8 || 9223372036854775807LL >> _right ? : 0;
}

signed char bar (signed char _ui1, signed char _ui2)
{
  return _ui1;
}

signed char baz (int _ui1, signed char _ui2)
{
  return _ui1 * _ui2;
}

volatile signed char g_35;

int func_16 (int p_17, signed char p_19)
{
  if (foo (1, bar (p_17, 1)))
    if (g_35)
      {
      }
  return 0;
}

void box (signed char p_13, signed char p_14)
{
  signed char l_133 = 0xF5C80580;
  func_16 (baz (l_133, g_35), 1);
}


-- 
           Summary: ICE in simplify_subreg, at simplify-rtx.c:4981
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug rtl-optimization/40861] [4.5 Regression] ICE in simplify_subreg, at simplify-rtx.c:4981
  2009-07-26 15:15 [Bug c/40861] New: ICE in simplify_subreg, at simplify-rtx.c:4981 regehr at cs dot utah dot edu
@ 2009-07-26 15:16 ` pinskia at gcc dot gnu dot org
  2009-07-26 19:16 ` rguenth at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-07-26 15:16 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |rtl-optimization
           Keywords|                            |ice-on-valid-code
            Summary|ICE in simplify_subreg, at  |[4.5 Regression] ICE in
                   |simplify-rtx.c:4981         |simplify_subreg, at
                   |                            |simplify-rtx.c:4981
   Target Milestone|---                         |4.5.0


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


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

* [Bug rtl-optimization/40861] [4.5 Regression] ICE in simplify_subreg, at simplify-rtx.c:4981
  2009-07-26 15:15 [Bug c/40861] New: ICE in simplify_subreg, at simplify-rtx.c:4981 regehr at cs dot utah dot edu
  2009-07-26 15:16 ` [Bug rtl-optimization/40861] [4.5 Regression] " pinskia at gcc dot gnu dot org
@ 2009-07-26 19:16 ` rguenth at gcc dot gnu dot org
  2009-07-29 23:02 ` jsm28 at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-07-26 19:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2009-07-26 19:15 -------
*** Bug 40862 has been marked as a duplicate of this bug. ***


-- 


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


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

* [Bug rtl-optimization/40861] [4.5 Regression] ICE in simplify_subreg, at simplify-rtx.c:4981
  2009-07-26 15:15 [Bug c/40861] New: ICE in simplify_subreg, at simplify-rtx.c:4981 regehr at cs dot utah dot edu
  2009-07-26 15:16 ` [Bug rtl-optimization/40861] [4.5 Regression] " pinskia at gcc dot gnu dot org
  2009-07-26 19:16 ` rguenth at gcc dot gnu dot org
@ 2009-07-29 23:02 ` jsm28 at gcc dot gnu dot org
  2009-08-26 13:37 ` [Bug rtl-optimization/40861] [4.4/4.5 " reichelt at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-07-29 23:02 UTC (permalink / raw)
  To: gcc-bugs



-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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


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

* [Bug rtl-optimization/40861] [4.4/4.5 Regression] ICE in simplify_subreg, at simplify-rtx.c:4981
  2009-07-26 15:15 [Bug c/40861] New: ICE in simplify_subreg, at simplify-rtx.c:4981 regehr at cs dot utah dot edu
                   ` (2 preceding siblings ...)
  2009-07-29 23:02 ` jsm28 at gcc dot gnu dot org
@ 2009-08-26 13:37 ` reichelt at gcc dot gnu dot org
  2009-08-27 16:22 ` ubizjak at gmail dot com
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2009-08-26 13:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from reichelt at gcc dot gnu dot org  2009-08-26 13:37 -------
Confirmed.
Shorter testcase (crashes with "-O -m32" on x86_64-unknown-linux-gnu):

==================================
int foo(volatile int i)
{
  return (1LL >> 128 * i) && i;
}
==================================

The crash already occurs with GCC 4.4.0, but not with GCC 4.3.x.


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |reichelt at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-08-26 13:37:23
               date|                            |
            Summary|[4.5 Regression] ICE in     |[4.4/4.5 Regression] ICE in
                   |simplify_subreg, at         |simplify_subreg, at
                   |simplify-rtx.c:4981         |simplify-rtx.c:4981


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


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

* [Bug rtl-optimization/40861] [4.4/4.5 Regression] ICE in simplify_subreg, at simplify-rtx.c:4981
  2009-07-26 15:15 [Bug c/40861] New: ICE in simplify_subreg, at simplify-rtx.c:4981 regehr at cs dot utah dot edu
                   ` (3 preceding siblings ...)
  2009-08-26 13:37 ` [Bug rtl-optimization/40861] [4.4/4.5 " reichelt at gcc dot gnu dot org
@ 2009-08-27 16:22 ` ubizjak at gmail dot com
  2009-08-27 17:20 ` ubizjak at gmail dot com
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ubizjak at gmail dot com @ 2009-08-27 16:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from ubizjak at gmail dot com  2009-08-27 16:21 -------
Backtrace with current SVN:

#1  0x000000000076991d in simplify_subreg (outermode=SImode, 
    op=0x7ffff28a68a0, innermode=DImode, byte=4294967280)
    at ../../gcc-svn/trunk/gcc/simplify-rtx.c:4982
#2  0x0000000000769b3e in simplify_gen_subreg (outermode=12901752, op=0x1376, 
    innermode=12905920, byte=4) at ../../gcc-svn/trunk/gcc/simplify-rtx.c:5286
#3  0x0000000000769b3e in simplify_gen_subreg (outermode=12901752, op=0x1376, 
    innermode=12905920, byte=4) at ../../gcc-svn/trunk/gcc/simplify-rtx.c:5286
#4  0x0000000000b07848 in if_then_else_cond (x=0x7ffff28a69c0, 
    ptrue=0x7fffffffdb90, pfalse=0x7fffffffdb80)
    at ../../gcc-svn/trunk/gcc/combine.c:7979
#5  0x0000000000b07619 in if_then_else_cond (x=0x7ffff28a6a20, 
    ptrue=0x7fffffffdc28, pfalse=0x7fffffffdc38)
    at ../../gcc-svn/trunk/gcc/combine.c:7864
#6  0x0000000000b0f037 in combine_simplify_rtx (x=0x7ffff28a6a20, 
    op0_mode=SImode, in_dest=0) at ../../gcc-svn/trunk/gcc/combine.c:4629
#7  0x0000000000b115ed in subst (x=0x8, from=<value optimized out>, 
    to=0x7ffff28a68e0, in_dest=0, unique_copy=17)
    at ../../gcc-svn/trunk/gcc/combine.c:4568
#8  0x0000000000b113a8 in subst (x=0x7ffff28a6a40, from=0x7ffff28a6860, 
    to=0x7ffff28a68e0, in_dest=<value optimized out>, 
---Type <return> to continue, or q <return> to quit--- 
    unique_copy=<value optimized out>)
    at ../../gcc-svn/trunk/gcc/combine.c:4506
#9  0x0000000000b1129a in subst (x=0x7ffff2a67d10, from=0x7ffff28a6860, 
    to=0x7ffff28a68e0, in_dest=<value optimized out>, 
    unique_copy=<value optimized out>)
    at ../../gcc-svn/trunk/gcc/combine.c:4433

"byte" argument, passed to simplify_subreg in frame #1 is a bit high for
current state of the art.


-- 


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


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

* [Bug rtl-optimization/40861] [4.4/4.5 Regression] ICE in simplify_subreg, at simplify-rtx.c:4981
  2009-07-26 15:15 [Bug c/40861] New: ICE in simplify_subreg, at simplify-rtx.c:4981 regehr at cs dot utah dot edu
                   ` (4 preceding siblings ...)
  2009-08-27 16:22 ` ubizjak at gmail dot com
@ 2009-08-27 17:20 ` ubizjak at gmail dot com
  2009-08-27 20:54 ` uros at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ubizjak at gmail dot com @ 2009-08-27 17:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from ubizjak at gmail dot com  2009-08-27 17:19 -------
Patch in testing:

--cut here--
Index: simplify-rtx.c
===================================================================
--- simplify-rtx.c      (revision 151142)
+++ simplify-rtx.c      (working copy)
@@ -5263,6 +5263,7 @@ simplify_subreg (enum machine_mode outer
       && GET_MODE_BITSIZE (innermode) >= (2 * GET_MODE_BITSIZE (outermode))
       && CONST_INT_P (XEXP (op, 1))
       && (INTVAL (XEXP (op, 1)) & (GET_MODE_BITSIZE (outermode) - 1)) == 0
+      && INTVAL (XEXP (op, 1)) >= 0
       && INTVAL (XEXP (op, 1)) < GET_MODE_BITSIZE (innermode)      
       && byte == subreg_lowpart_offset (outermode, innermode))
     {
--cut here--


-- 


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


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

* [Bug rtl-optimization/40861] [4.4/4.5 Regression] ICE in simplify_subreg, at simplify-rtx.c:4981
  2009-07-26 15:15 [Bug c/40861] New: ICE in simplify_subreg, at simplify-rtx.c:4981 regehr at cs dot utah dot edu
                   ` (5 preceding siblings ...)
  2009-08-27 17:20 ` ubizjak at gmail dot com
@ 2009-08-27 20:54 ` uros at gcc dot gnu dot org
  2009-09-07 19:16 ` [Bug rtl-optimization/40861] [4.4 " reichelt at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: uros at gcc dot gnu dot org @ 2009-08-27 20:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from uros at gcc dot gnu dot org  2009-08-27 20:54 -------
Subject: Bug 40861

Author: uros
Date: Thu Aug 27 20:54:28 2009
New Revision: 151149

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=151149
Log:
        PR rtl-optimization/40861
        * simplify-rtx.c (simplify_subreg): Do not call simplify_gen_subreg to
        extract word from a multi-word subreg for negative byte positions.

testsuite/ChangeLog:

        PR rtl-optimization/40861
        * gcc.dg/pr40861.c: New test.


Added:
    trunk/gcc/testsuite/gcc.dg/pr40861.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/simplify-rtx.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug rtl-optimization/40861] [4.4 Regression] ICE in simplify_subreg, at simplify-rtx.c:4981
  2009-07-26 15:15 [Bug c/40861] New: ICE in simplify_subreg, at simplify-rtx.c:4981 regehr at cs dot utah dot edu
                   ` (6 preceding siblings ...)
  2009-08-27 20:54 ` uros at gcc dot gnu dot org
@ 2009-09-07 19:16 ` reichelt at gcc dot gnu dot org
  2009-09-07 20:26 ` uros at gcc dot gnu dot org
  2009-09-07 20:27 ` ubizjak at gmail dot com
  9 siblings, 0 replies; 11+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2009-09-07 19:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from reichelt at gcc dot gnu dot org  2009-09-07 19:15 -------
Fixed for GCC 4.5.0.

Uros, are you going to backport the fix to the 4.4 branch?


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |uros at gcc dot gnu dot org
            Summary|[4.4/4.5 Regression] ICE in |[4.4 Regression] ICE in
                   |simplify_subreg, at         |simplify_subreg, at
                   |simplify-rtx.c:4981         |simplify-rtx.c:4981
   Target Milestone|4.5.0                       |4.4.2


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


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

* [Bug rtl-optimization/40861] [4.4 Regression] ICE in simplify_subreg, at simplify-rtx.c:4981
  2009-07-26 15:15 [Bug c/40861] New: ICE in simplify_subreg, at simplify-rtx.c:4981 regehr at cs dot utah dot edu
                   ` (7 preceding siblings ...)
  2009-09-07 19:16 ` [Bug rtl-optimization/40861] [4.4 " reichelt at gcc dot gnu dot org
@ 2009-09-07 20:26 ` uros at gcc dot gnu dot org
  2009-09-07 20:27 ` ubizjak at gmail dot com
  9 siblings, 0 replies; 11+ messages in thread
From: uros at gcc dot gnu dot org @ 2009-09-07 20:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from uros at gcc dot gnu dot org  2009-09-07 20:26 -------
Subject: Bug 40861

Author: uros
Date: Mon Sep  7 20:25:52 2009
New Revision: 151489

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=151489
Log:
        Backport from mainline:
        2009-08-27  Uros Bizjak  <ubizjak@gmail.com>

        PR rtl-optimization/40861
        * simplify-rtx.c (simplify_subreg): Do not call simplify_gen_subreg to
        extract word from a multi-word subreg for negative byte positions.

testsuite/ChangeLog:

        Backport from mainline:
        2009-08-27  Uros Bizjak  <ubizjak@gmail.com>

        PR rtl-optimization/40861
        * gcc.dg/pr40861.c: New test.


Added:
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr40861.c
Modified:
    branches/gcc-4_4-branch/gcc/ChangeLog
    branches/gcc-4_4-branch/gcc/simplify-rtx.c
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug rtl-optimization/40861] [4.4 Regression] ICE in simplify_subreg, at simplify-rtx.c:4981
  2009-07-26 15:15 [Bug c/40861] New: ICE in simplify_subreg, at simplify-rtx.c:4981 regehr at cs dot utah dot edu
                   ` (8 preceding siblings ...)
  2009-09-07 20:26 ` uros at gcc dot gnu dot org
@ 2009-09-07 20:27 ` ubizjak at gmail dot com
  9 siblings, 0 replies; 11+ messages in thread
From: ubizjak at gmail dot com @ 2009-09-07 20:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from ubizjak at gmail dot com  2009-09-07 20:27 -------
Thanks for the reminder, I forgot on this patch...

Fixed.


-- 

ubizjak at gmail dot com changed:

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


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


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

end of thread, other threads:[~2009-09-07 20:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-26 15:15 [Bug c/40861] New: ICE in simplify_subreg, at simplify-rtx.c:4981 regehr at cs dot utah dot edu
2009-07-26 15:16 ` [Bug rtl-optimization/40861] [4.5 Regression] " pinskia at gcc dot gnu dot org
2009-07-26 19:16 ` rguenth at gcc dot gnu dot org
2009-07-29 23:02 ` jsm28 at gcc dot gnu dot org
2009-08-26 13:37 ` [Bug rtl-optimization/40861] [4.4/4.5 " reichelt at gcc dot gnu dot org
2009-08-27 16:22 ` ubizjak at gmail dot com
2009-08-27 17:20 ` ubizjak at gmail dot com
2009-08-27 20:54 ` uros at gcc dot gnu dot org
2009-09-07 19:16 ` [Bug rtl-optimization/40861] [4.4 " reichelt at gcc dot gnu dot org
2009-09-07 20:26 ` uros at gcc dot gnu dot org
2009-09-07 20:27 ` 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).