public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/46212] New: Segfault in reg_nonzero_bits_for_combine
@ 2010-10-28 17:33 rmansfield at qnx dot com
  2010-10-28 17:37 ` [Bug middle-end/46212] " rmansfield at qnx dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: rmansfield at qnx dot com @ 2010-10-28 17:33 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Segfault in reg_nonzero_bits_for_combine
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rmansfield@qnx.com


$ ./xgcc -v
Using built-in specs.
COLLECT_GCC=./xgcc
Target: i686-pc-linux-gnu
Configured with: ../configure --disable-bootstrap --enable-languages=c
Thread model: posix
gcc version 4.6.0 20101028 (experimental) [trunk revision 166029] (GCC) 

$ ./xgcc -B.   t.c -O3 -Wall  -funroll-all-loops -c -march=i386
xgcc: internal compiler error: Segmentation fault (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ gdb --args ./cc1 -quiet -nostdinc  t.c -O3 -Wall -version -funroll-all-loops
GNU gdb (GDB) 7.2-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/ryan/gnu/gcc/trunk/tmp/gcc/cc1...done.
Breakpoint 1 at 0x81f2b76: file ../../gcc/diagnostic.c, line 881.
Breakpoint 2 at 0x81f2b03: file ../../gcc/diagnostic.c, line 820.
Breakpoint 3 at 0x80b07c8
Breakpoint 4 at 0x80afa98
(gdb) r
Starting program: /home/ryan/gnu/gcc/trunk/tmp/gcc/cc1 -quiet -nostdinc t.c -O3
-Wall -version -funroll-all-loops
GNU C (GCC) version 4.6.0 20101028 (experimental) [trunk revision 166029]
(i686-pc-linux-gnu)
    compiled by GNU C version 4.4.5, GMP version 4.3.2, MPFR version 3.0.0-p3,
MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU C (GCC) version 4.6.0 20101028 (experimental) [trunk revision 166029]
(i686-pc-linux-gnu)
    compiled by GNU C version 4.4.5, GMP version 4.3.2, MPFR version 3.0.0-p3,
MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: bc9857b210e225a4f4bf75c19a868300

Program received signal SIGSEGV, Segmentation fault.
0x087ed03f in reg_nonzero_bits_for_combine (x=0xb7786090, mode=SImode, 
    known_x=0x0, known_mode=VOIDmode, known_ret=0, nonzero=0xbf60007c)
    at ../../gcc/combine.c:9406
9406      tem = get_last_value (x);
(gdb) bt
#0  0x087ed03f in reg_nonzero_bits_for_combine (x=0xb7786090, mode=SImode, 
    known_x=0x0, known_mode=VOIDmode, known_ret=0, nonzero=0xbf60007c)
    at ../../gcc/combine.c:9406
#1  0x083ecb28 in nonzero_bits1 (x=0xb7786090, mode=SImode, 
    known_x=<value optimized out>, known_mode=VOIDmode, known_ret=0)
    at ../../gcc/rtlanal.c:3791
#2  0x083ecfc6 in num_sign_bit_copies1 (x=0xb7786090, 
    mode=<value optimized out>, known_x=<value optimized out>, 
    known_mode=VOIDmode, known_ret=0) at ../../gcc/rtlanal.c:4627
#3  0x087eefbf in if_then_else_cond (x=0xb7786090, 
    ptrue=<value optimized out>, pfalse=<value optimized out>)
    at ../../gcc/combine.c:8653
#4  0x087eee7e in if_then_else_cond (x=0xb76bad50, 
    ptrue=<value optimized out>, pfalse=<value optimized out>)
    at ../../gcc/combine.c:8507
#5  0x087eee7e in if_then_else_cond (x=0xb76bad74, 
    ptrue=<value optimized out>, pfalse=<value optimized out>)
    at ../../gcc/combine.c:8507
#6  0x087ef08e in if_then_else_cond (x=0xb7698a98, 
    ptrue=<value optimized out>, pfalse=<value optimized out>)
    at ../../gcc/combine.c:8620
#7  0x087ef01e in if_then_else_cond (x=0xb76a1368, 
    ptrue=<value optimized out>, pfalse=<value optimized out>)


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

* [Bug middle-end/46212] Segfault in reg_nonzero_bits_for_combine
  2010-10-28 17:33 [Bug middle-end/46212] New: Segfault in reg_nonzero_bits_for_combine rmansfield at qnx dot com
@ 2010-10-28 17:37 ` rmansfield at qnx dot com
  2010-10-28 17:40 ` pinskia at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rmansfield at qnx dot com @ 2010-10-28 17:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Ryan Mansfield <rmansfield at qnx dot com> 2010-10-28 17:37:25 UTC ---
Working on reducing the testcase. I originally encountered the ICE as:

internal compiler error: vector VEC(reg_stat_type,base) index domain error, in
reg_nonzero_bits_for_combine at combine.c:9385

but as I reduce the test case becomes a segfault.


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

* [Bug middle-end/46212] Segfault in reg_nonzero_bits_for_combine
  2010-10-28 17:33 [Bug middle-end/46212] New: Segfault in reg_nonzero_bits_for_combine rmansfield at qnx dot com
  2010-10-28 17:37 ` [Bug middle-end/46212] " rmansfield at qnx dot com
@ 2010-10-28 17:40 ` pinskia at gcc dot gnu.org
  2010-10-28 18:45 ` rmansfield at qnx dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2010-10-28 17:40 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |46034

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2010-10-28 17:40:18 UTC ---
This is most likely a duplicate of bug 46034.


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

* [Bug middle-end/46212] Segfault in reg_nonzero_bits_for_combine
  2010-10-28 17:33 [Bug middle-end/46212] New: Segfault in reg_nonzero_bits_for_combine rmansfield at qnx dot com
  2010-10-28 17:37 ` [Bug middle-end/46212] " rmansfield at qnx dot com
  2010-10-28 17:40 ` pinskia at gcc dot gnu.org
@ 2010-10-28 18:45 ` rmansfield at qnx dot com
  2010-10-29 12:46 ` [Bug rtl-optimization/46212] " ebotcazou at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rmansfield at qnx dot com @ 2010-10-28 18:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Ryan Mansfield <rmansfield at qnx dot com> 2010-10-28 18:45:10 UTC ---
Reduced testcase:

static __inline__ unsigned foo(void *__ptr) {
   unsigned __val = *(volatile unsigned *)(__ptr);
   return (((__val) >> 24) | (((__val) >> 8) & 0xff00) |  (((__val) & 0xff00)
<< 8) | ((__val) << 24));
}

void bar(void *dst, void *src, int pixels) {
  unsigned c;
  while (pixels--) {
   c = foo(src);
   *(unsigned *)dst = (c & 0xf80000) >> 9 | (c & 0xf800) >> 6 | (c & 0xf8) >> 3
| (c & 0x80000000) >> 16;
  }
}

Looks like the same bug. Sorry for the dup. I only searched bugzilla for PRs
about reg_nonzero_bits_for_combine.


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

* [Bug rtl-optimization/46212] Segfault in reg_nonzero_bits_for_combine
  2010-10-28 17:33 [Bug middle-end/46212] New: Segfault in reg_nonzero_bits_for_combine rmansfield at qnx dot com
                   ` (2 preceding siblings ...)
  2010-10-28 18:45 ` rmansfield at qnx dot com
@ 2010-10-29 12:46 ` ebotcazou at gcc dot gnu.org
  2010-10-31 15:50 ` [Bug rtl-optimization/46212] [4.6 regression] segfault " hjl.tools at gmail dot com
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2010-10-29 12:46 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2010.10.29 12:45:59
                 CC|                            |ebotcazou at gcc dot
                   |                            |gnu.org
          Component|middle-end                  |rtl-optimization
         AssignedTo|unassigned at gcc dot       |ebotcazou at gcc dot
                   |gnu.org                     |gnu.org
     Ever Confirmed|0                           |1

--- Comment #4 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2010-10-29 12:45:59 UTC ---
Investigating.


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

* [Bug rtl-optimization/46212] [4.6 regression] segfault in reg_nonzero_bits_for_combine
  2010-10-28 17:33 [Bug middle-end/46212] New: Segfault in reg_nonzero_bits_for_combine rmansfield at qnx dot com
                   ` (3 preceding siblings ...)
  2010-10-29 12:46 ` [Bug rtl-optimization/46212] " ebotcazou at gcc dot gnu.org
@ 2010-10-31 15:50 ` hjl.tools at gmail dot com
  2010-11-01 11:24 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: hjl.tools at gmail dot com @ 2010-10-31 15:50 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

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

--- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> 2010-10-31 15:49:57 UTC ---
It is caused by revision 165674:

http://gcc.gnu.org/ml/gcc-cvs/2010-10/msg00859.html


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

* [Bug rtl-optimization/46212] [4.6 regression] segfault in reg_nonzero_bits_for_combine
  2010-10-28 17:33 [Bug middle-end/46212] New: Segfault in reg_nonzero_bits_for_combine rmansfield at qnx dot com
                   ` (4 preceding siblings ...)
  2010-10-31 15:50 ` [Bug rtl-optimization/46212] [4.6 regression] segfault " hjl.tools at gmail dot com
@ 2010-11-01 11:24 ` jakub at gcc dot gnu.org
  2010-11-01 21:22 ` ebotcazou at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-11-01 11:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-11-01 11:24:12 UTC ---
Created attachment 22217
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22217
gcc46-pr46034.patch

Untested fix.


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

* [Bug rtl-optimization/46212] [4.6 regression] segfault in reg_nonzero_bits_for_combine
  2010-10-28 17:33 [Bug middle-end/46212] New: Segfault in reg_nonzero_bits_for_combine rmansfield at qnx dot com
                   ` (5 preceding siblings ...)
  2010-11-01 11:24 ` jakub at gcc dot gnu.org
@ 2010-11-01 21:22 ` ebotcazou at gcc dot gnu.org
  2010-11-03  8:31 ` jakub at gcc dot gnu.org
  2010-11-03  8:45 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2010-11-01 21:22 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

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


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

* [Bug rtl-optimization/46212] [4.6 regression] segfault in reg_nonzero_bits_for_combine
  2010-10-28 17:33 [Bug middle-end/46212] New: Segfault in reg_nonzero_bits_for_combine rmansfield at qnx dot com
                   ` (6 preceding siblings ...)
  2010-11-01 21:22 ` ebotcazou at gcc dot gnu.org
@ 2010-11-03  8:31 ` jakub at gcc dot gnu.org
  2010-11-03  8:45 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-11-03  8:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-11-03 08:30:29 UTC ---
Author: jakub
Date: Wed Nov  3 08:30:21 2010
New Revision: 166231

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=166231
Log:
    PR rtl-optimization/46034
    PR rtl-optimization/46212
    PR rtl-optimization/46248
    * combine.c (try_combine): If added_sets_2 where i0dest_in_i0src
    and i0 feeds i1 and i1 feeds i2 or i0 feeds i2, make a copy of i1src
    before i0dest -> i0src substitution and pass 1 instead of 0 as last
    argument to subst on i2pat.

    * gcc.c-torture/compile/pr46034.c: New test.
    * gcc.c-torture/compile/pr46248.c: New test.
    * gcc.dg/pr46212.c: New test.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr46034.c
    trunk/gcc/testsuite/gcc.c-torture/compile/pr46248.c
    trunk/gcc/testsuite/gcc.dg/pr46212.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/combine.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug rtl-optimization/46212] [4.6 regression] segfault in reg_nonzero_bits_for_combine
  2010-10-28 17:33 [Bug middle-end/46212] New: Segfault in reg_nonzero_bits_for_combine rmansfield at qnx dot com
                   ` (7 preceding siblings ...)
  2010-11-03  8:31 ` jakub at gcc dot gnu.org
@ 2010-11-03  8:45 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-11-03  8:45 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-11-03 08:45:28 UTC ---
Fixed.


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

end of thread, other threads:[~2010-11-03  8:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-28 17:33 [Bug middle-end/46212] New: Segfault in reg_nonzero_bits_for_combine rmansfield at qnx dot com
2010-10-28 17:37 ` [Bug middle-end/46212] " rmansfield at qnx dot com
2010-10-28 17:40 ` pinskia at gcc dot gnu.org
2010-10-28 18:45 ` rmansfield at qnx dot com
2010-10-29 12:46 ` [Bug rtl-optimization/46212] " ebotcazou at gcc dot gnu.org
2010-10-31 15:50 ` [Bug rtl-optimization/46212] [4.6 regression] segfault " hjl.tools at gmail dot com
2010-11-01 11:24 ` jakub at gcc dot gnu.org
2010-11-01 21:22 ` ebotcazou at gcc dot gnu.org
2010-11-03  8:31 ` jakub at gcc dot gnu.org
2010-11-03  8:45 ` jakub 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).