public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/38661]  New: ICE: vector VEC(constructor_elt,base) push domain error, in build_constructors at tree-switch-conversion.c:450
@ 2008-12-29 19:02 cgd at google dot com
  2008-12-29 19:05 ` [Bug tree-optimization/38661] [4.4 Regression] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: cgd at google dot com @ 2008-12-29 19:02 UTC (permalink / raw)
  To: gcc-bugs

compiler:

Using built-in specs.
Target: i686-linux
Configured with: ../trunk/configure --enable-languages=c,c++ --build=i686-linux
--host=i686-linux --target=i686-linux
--prefix=/g/users/cgd/proj/gcc-trunk/bld/../inst
Thread model: posix
gcc version 4.4.0 20081229 (experimental) (GCC) 

(built from trunk sources as of earlier this morning.)

input source x.c:

const char *func(int val) {
 switch (val) {
   case 2147483647: return "foo";
   default: return "";
 }
}

compilation command line: gcc -O2 -c x.c

result:

x.c: In function 'func':
x.c:6: internal compiler error: vector VEC(constructor_elt,base) push domain
error, in build_constructors at tree-switch-conversion.c:450
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

I verified that it compiles correctly with GCC 4.3.2.


-- 
           Summary: ICE: vector VEC(constructor_elt,base) push domain error,
                    in build_constructors at tree-switch-conversion.c:450
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: cgd at google dot com
 GCC build triplet: i686-linux
  GCC host triplet: i686-linux
GCC target triplet: i686-linux


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


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

* [Bug tree-optimization/38661] [4.4 Regression] ICE: vector VEC(constructor_elt,base) push domain error, in build_constructors at tree-switch-conversion.c:450
  2008-12-29 19:02 [Bug c/38661] New: ICE: vector VEC(constructor_elt,base) push domain error, in build_constructors at tree-switch-conversion.c:450 cgd at google dot com
@ 2008-12-29 19:05 ` pinskia at gcc dot gnu dot org
  2008-12-29 19:16 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-29 19:05 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
          Component|c                           |tree-optimization
           Keywords|                            |ice-on-valid-code
            Summary|ICE: vector                 |[4.4 Regression] ICE: vector
                   |VEC(constructor_elt,base)   |VEC(constructor_elt,base)
                   |push domain error, in       |push domain error, in
                   |build_constructors at tree- |build_constructors at tree-
                   |switch-conversion.c:450     |switch-conversion.c:450
   Target Milestone|---                         |4.4.0
            Version|unknown                     |4.4.0


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


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

* [Bug tree-optimization/38661] [4.4 Regression] ICE: vector VEC(constructor_elt,base) push domain error, in build_constructors at tree-switch-conversion.c:450
  2008-12-29 19:02 [Bug c/38661] New: ICE: vector VEC(constructor_elt,base) push domain error, in build_constructors at tree-switch-conversion.c:450 cgd at google dot com
  2008-12-29 19:05 ` [Bug tree-optimization/38661] [4.4 Regression] " pinskia at gcc dot gnu dot org
@ 2008-12-29 19:16 ` pinskia at gcc dot gnu dot org
  2008-12-29 19:42 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-29 19:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2008-12-29 19:15 -------
Confirmed.
In build_constructors an integer value wraps.

Note it might be better if we used 0x7fffffff instead of 2147483647 so there is
less confusion of what is going on here.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-12-29 19:15:04
               date|                            |


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


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

* [Bug tree-optimization/38661] [4.4 Regression] ICE: vector VEC(constructor_elt,base) push domain error, in build_constructors at tree-switch-conversion.c:450
  2008-12-29 19:02 [Bug c/38661] New: ICE: vector VEC(constructor_elt,base) push domain error, in build_constructors at tree-switch-conversion.c:450 cgd at google dot com
  2008-12-29 19:05 ` [Bug tree-optimization/38661] [4.4 Regression] " pinskia at gcc dot gnu dot org
  2008-12-29 19:16 ` pinskia at gcc dot gnu dot org
@ 2008-12-29 19:42 ` pinskia at gcc dot gnu dot org
  2008-12-29 23:22 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-29 19:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2008-12-29 19:41 -------
I think I have a simple fix:
Index: ../../gcc/tree-switch-conversion.c
===================================================================
--- ../../gcc/tree-switch-conversion.c  (revision 142944)
+++ ../../gcc/tree-switch-conversion.c  (working copy)
@@ -440,9 +440,10 @@ build_constructors (gimple swtch)
        {
          gimple phi = gsi_stmt (gsi);
          tree val = PHI_ARG_DEF_FROM_EDGE (phi, e);
+         tree low = CASE_LOW (cs);
          pos = CASE_LOW (cs);

-         while (!tree_int_cst_lt (high, pos))
+         do 
            {
              constructor_elt *elt;

@@ -452,7 +453,7 @@ build_constructors (gimple swtch)
              elt->value = val;

              pos = int_const_binop (PLUS_EXPR, pos, integer_one_node, 0);
-           }
+           } while (!tree_int_cst_lt (high, pos) && tree_int_cst_lt (low,
pos));
          j++;
        }
     }


-- 

pinskia at gcc dot gnu dot org changed:

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


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


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

* [Bug tree-optimization/38661] [4.4 Regression] ICE: vector VEC(constructor_elt,base) push domain error, in build_constructors at tree-switch-conversion.c:450
  2008-12-29 19:02 [Bug c/38661] New: ICE: vector VEC(constructor_elt,base) push domain error, in build_constructors at tree-switch-conversion.c:450 cgd at google dot com
                   ` (2 preceding siblings ...)
  2008-12-29 19:42 ` pinskia at gcc dot gnu dot org
@ 2008-12-29 23:22 ` rguenth at gcc dot gnu dot org
  2008-12-30 16:30 ` pinskia at gcc dot gnu dot org
  2008-12-30 16:30 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-12-29 23:22 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

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


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


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

* [Bug tree-optimization/38661] [4.4 Regression] ICE: vector VEC(constructor_elt,base) push domain error, in build_constructors at tree-switch-conversion.c:450
  2008-12-29 19:02 [Bug c/38661] New: ICE: vector VEC(constructor_elt,base) push domain error, in build_constructors at tree-switch-conversion.c:450 cgd at google dot com
                   ` (4 preceding siblings ...)
  2008-12-30 16:30 ` pinskia at gcc dot gnu dot org
@ 2008-12-30 16:30 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-30 16:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2008-12-30 16:28 -------
Fixed.


-- 

pinskia at gcc dot gnu dot org changed:

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


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


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

* [Bug tree-optimization/38661] [4.4 Regression] ICE: vector VEC(constructor_elt,base) push domain error, in build_constructors at tree-switch-conversion.c:450
  2008-12-29 19:02 [Bug c/38661] New: ICE: vector VEC(constructor_elt,base) push domain error, in build_constructors at tree-switch-conversion.c:450 cgd at google dot com
                   ` (3 preceding siblings ...)
  2008-12-29 23:22 ` rguenth at gcc dot gnu dot org
@ 2008-12-30 16:30 ` pinskia at gcc dot gnu dot org
  2008-12-30 16:30 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-30 16:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2008-12-30 16:28 -------
Subject: Bug 38661

Author: pinskia
Date: Tue Dec 30 16:27:29 2008
New Revision: 142964

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142964
Log:
2008-12-30  Andrew Pinski  <pinskia@gmail.com>

        PR middle-end/38661
        * tree-switch-conversion.c (build_constructors): Test for wrapping of
        pos case.

2008-12-30  Andrew Pinski  <pinskia@gmail.com>

        PR middle-end/38661
        * gcc.c-torture/compile/pr38661.c: New testcase. 
        * gcc.c-torture/compile/pr38661-1.c: New testcase.


Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr38661-1.c
    trunk/gcc/testsuite/gcc.c-torture/compile/pr38661.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-switch-conversion.c


-- 


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


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

end of thread, other threads:[~2008-12-30 16:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-29 19:02 [Bug c/38661] New: ICE: vector VEC(constructor_elt,base) push domain error, in build_constructors at tree-switch-conversion.c:450 cgd at google dot com
2008-12-29 19:05 ` [Bug tree-optimization/38661] [4.4 Regression] " pinskia at gcc dot gnu dot org
2008-12-29 19:16 ` pinskia at gcc dot gnu dot org
2008-12-29 19:42 ` pinskia at gcc dot gnu dot org
2008-12-29 23:22 ` rguenth at gcc dot gnu dot org
2008-12-30 16:30 ` pinskia at gcc dot gnu dot org
2008-12-30 16:30 ` pinskia 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).