public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/33238]  New: [4.1.2 regression] ICE on statement expression using variable-sized structure in tree_low_cst, at tree.c:4502
@ 2007-08-29 20:07 radford at blackbean dot org
  2007-08-29 21:19 ` [Bug c/33238] " radford at blackbean dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: radford at blackbean dot org @ 2007-08-29 20:07 UTC (permalink / raw)
  To: gcc-bugs

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

The following code gives an internal compiler error using gcc 4.1.2, but
compiles using 3.4.  Remove the ()s around the {}s and it compiles just fine. 

void reverse(void *_p, int nmemb, int size)
{
    struct { char _[size]; } *p = _p, tmp;
    for (int i=nmemb-1, j=0; j<nmemb/2; i--, j++)
        ({ tmp = p[i]; p[i] = p[j]; p[j] = tmp; });
}

bug2.c: In function ‘reverse’:
bug2.c:4: internal compiler error: in tree_low_cst, at tree.c:4502


-- 
           Summary: [4.1.2 regression] ICE on statement expression using
                    variable-sized structure in tree_low_cst, at tree.c:4502
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: radford at blackbean dot org
 GCC build triplet: x86_64-redhat-linux, i386-redhat-linux
  GCC host triplet: x86_64-redhat-linux, i386-redhat-linux
GCC target triplet: x86_64-redhat-linux, i386-redhat-linux


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


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

* [Bug c/33238] [4.1.2 regression] ICE on statement expression using variable-sized structure in tree_low_cst, at tree.c:4502
  2007-08-29 20:07 [Bug c/33238] New: [4.1.2 regression] ICE on statement expression using variable-sized structure in tree_low_cst, at tree.c:4502 radford at blackbean dot org
@ 2007-08-29 21:19 ` radford at blackbean dot org
  2007-08-30 10:06 ` [Bug c/33238] [4.1/4.2/4.3 Regression] " rguenth at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: radford at blackbean dot org @ 2007-08-29 21:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from radford at blackbean dot org  2007-08-29 21:19 -------
Bug is present in 4.2.1 as well.


-- 

radford at blackbean dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.1.2 regression] ICE on   |[4.1.2 regression] ICE on
                   |statement expression using  |statement expression using
                   |variable-sized structure in |variable-sized structure in
                   |tree_low_cst, at tree.c:4502|tree_low_cst, at tree.c:4502


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


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

* [Bug c/33238] [4.1/4.2/4.3 Regression] ICE on statement expression using variable-sized structure in tree_low_cst, at tree.c:4502
  2007-08-29 20:07 [Bug c/33238] New: [4.1.2 regression] ICE on statement expression using variable-sized structure in tree_low_cst, at tree.c:4502 radford at blackbean dot org
  2007-08-29 21:19 ` [Bug c/33238] " radford at blackbean dot org
@ 2007-08-30 10:06 ` rguenth at gcc dot gnu dot org
  2007-09-05  1:10 ` mmitchel at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-08-30 10:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2007-08-30 10:06 -------
4.1 ICEs during expansion of stack vars while 4.2 and 4.3 ICE in
force_constant_size, at gimplify.c:718.

4.1 backtrace:

#1  0x0000000000808124 in tree_low_cst (t=0x2ad57f2a61c0, pos=1)
    at /space//rguenther/src/svn/gcc-4_1-branch/gcc/tree.c:4399
#2  0x000000000082c662 in expand_one_stack_var (var=0x2ad57f7a9840)
    at /space//rguenther/src/svn/gcc-4_1-branch/gcc/cfgexpand.c:583
#3  0x000000000082c9ce in expand_one_var (var=0x2ad57f7a9840, 
    toplevel=1 '\001')
    at /space//rguenther/src/svn/gcc-4_1-branch/gcc/cfgexpand.c:737
#4  0x000000000082cfd2 in expand_used_vars ()
    at /space//rguenther/src/svn/gcc-4_1-branch/gcc/cfgexpand.c:992
#5  0x000000000082ebd7 in tree_expand_cfg ()
    at /space//rguenther/src/svn/gcc-4_1-branch/gcc/cfgexpand.c:1593


trunk backtrace:

#1  0x000000000070bcbc in force_constant_size (var=0x2ac3445f1420)
    at /space/rguenther/src/svn/pointer_plus/gcc/gimplify.c:718
#2  0x000000000070bfc4 in gimple_add_tmp_var (tmp=0x2ac3445f1420)
    at /space/rguenther/src/svn/pointer_plus/gcc/gimplify.c:735
#3  0x0000000000726a78 in gimplify_target_expr (expr_p=0x2ac344f3a1d0, 
    pre_p=0x7fff665d2fc8, post_p=0x7fff665d2fc0)
    at /space/rguenther/src/svn/pointer_plus/gcc/gimplify.c:4377
#4  0x00000000007311a3 in gimplify_expr (expr_p=0x2ac344f3a1d0, 
    pre_p=0x7fff665d2fc8, post_p=0x7fff665d2fc0, 
    gimple_test_f=0x8b6bc3 <is_gimple_stmt>, fallback=fb_none)
    at /space/rguenther/src/svn/pointer_plus/gcc/gimplify.c:5876
#5  0x000000000072702d in gimplify_stmt (stmt_p=0x2ac344f3a1d0)
    at /space/rguenther/src/svn/pointer_plus/gcc/gimplify.c:4425


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |ice-on-valid-code
      Known to fail|                            |4.0.0 4.1.2 4.2.1 4.3.0
      Known to work|                            |3.4.6
   Last reconfirmed|0000-00-00 00:00:00         |2007-08-30 10:06:47
               date|                            |
            Summary|[4.2.1 regression] ICE on   |[4.1/4.2/4.3 Regression] ICE
                   |statement expression using  |on statement expression
                   |variable-sized structure in |using variable-sized
                   |tree_low_cst, at tree.c:4502|structure in tree_low_cst,
                   |                            |at tree.c:4502
   Target Milestone|---                         |4.1.3


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


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

* [Bug c/33238] [4.1/4.2/4.3 Regression] ICE on statement expression using variable-sized structure in tree_low_cst, at tree.c:4502
  2007-08-29 20:07 [Bug c/33238] New: [4.1.2 regression] ICE on statement expression using variable-sized structure in tree_low_cst, at tree.c:4502 radford at blackbean dot org
  2007-08-29 21:19 ` [Bug c/33238] " radford at blackbean dot org
  2007-08-30 10:06 ` [Bug c/33238] [4.1/4.2/4.3 Regression] " rguenth at gcc dot gnu dot org
@ 2007-09-05  1:10 ` mmitchel at gcc dot gnu dot org
  2007-09-19 11:21 ` jakub at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-09-05  1:10 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


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


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

* [Bug c/33238] [4.1/4.2/4.3 Regression] ICE on statement expression using variable-sized structure in tree_low_cst, at tree.c:4502
  2007-08-29 20:07 [Bug c/33238] New: [4.1.2 regression] ICE on statement expression using variable-sized structure in tree_low_cst, at tree.c:4502 radford at blackbean dot org
                   ` (2 preceding siblings ...)
  2007-09-05  1:10 ` mmitchel at gcc dot gnu dot org
@ 2007-09-19 11:21 ` jakub at gcc dot gnu dot org
  2007-09-20 21:20 ` jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-09-19 11:21 UTC (permalink / raw)
  To: gcc-bugs



-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
                URL|                            |http://gcc.gnu.org/ml/gcc-
                   |                            |patches/2007-
                   |                            |09/msg01531.html
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-08-30 10:06:47         |2007-09-19 11:21:43
               date|                            |


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


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

* [Bug c/33238] [4.1/4.2/4.3 Regression] ICE on statement expression using variable-sized structure in tree_low_cst, at tree.c:4502
  2007-08-29 20:07 [Bug c/33238] New: [4.1.2 regression] ICE on statement expression using variable-sized structure in tree_low_cst, at tree.c:4502 radford at blackbean dot org
                   ` (3 preceding siblings ...)
  2007-09-19 11:21 ` jakub at gcc dot gnu dot org
@ 2007-09-20 21:20 ` jakub at gcc dot gnu dot org
  2007-09-21  9:50 ` [Bug c/33238] [4.1/4.2 " jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-09-20 21:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jakub at gcc dot gnu dot org  2007-09-20 21:19 -------
Subject: Bug 33238

Author: jakub
Date: Thu Sep 20 21:19:36 2007
New Revision: 128629

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128629
Log:
        PR c/33238
        PR c/27301
        * gimplify.c (gimplify_vla_decl): New function.
        (gimplify_decl_expr): Move VLA decl handling to gimplify_vla_decl.
        Call it.
        (gimplify_target_expr): Handle variable length TARGET_EXPRs.

        * gcc.c-torture/execute/20070919-1.c: New test.
        * gcc.dg/pr33238.c: New test.
        * gcc.dg/pr27301.c: New test.

Added:
    trunk/gcc/testsuite/gcc.c-torture/execute/20070919-1.c
    trunk/gcc/testsuite/gcc.dg/pr27301.c
    trunk/gcc/testsuite/gcc.dg/pr33238.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/gimplify.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c/33238] [4.1/4.2 Regression] ICE on statement expression using variable-sized structure in tree_low_cst, at tree.c:4502
  2007-08-29 20:07 [Bug c/33238] New: [4.1.2 regression] ICE on statement expression using variable-sized structure in tree_low_cst, at tree.c:4502 radford at blackbean dot org
                   ` (4 preceding siblings ...)
  2007-09-20 21:20 ` jakub at gcc dot gnu dot org
@ 2007-09-21  9:50 ` jakub at gcc dot gnu dot org
  2008-07-04 22:16 ` [Bug c/33238] [4.2 " jsm28 at gcc dot gnu dot org
  2009-03-30 22:17 ` jsm28 at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-09-21  9:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jakub at gcc dot gnu dot org  2007-09-21 09:50 -------
Fixed so far for 4.3.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|4.0.0 4.1.2 4.2.1 4.3.0     |4.0.0 4.1.2 4.2.1
      Known to work|3.4.6                       |3.4.6 4.3.0
            Summary|[4.1/4.2/4.3 Regression] ICE|[4.1/4.2 Regression] ICE on
                   |on statement expression     |statement expression using
                   |using variable-sized        |variable-sized structure in
                   |structure in tree_low_cst,  |tree_low_cst, at tree.c:4502
                   |at tree.c:4502              |


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


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

* [Bug c/33238] [4.2 Regression] ICE on statement expression using variable-sized structure in tree_low_cst, at tree.c:4502
  2007-08-29 20:07 [Bug c/33238] New: [4.1.2 regression] ICE on statement expression using variable-sized structure in tree_low_cst, at tree.c:4502 radford at blackbean dot org
                   ` (5 preceding siblings ...)
  2007-09-21  9:50 ` [Bug c/33238] [4.1/4.2 " jakub at gcc dot gnu dot org
@ 2008-07-04 22:16 ` jsm28 at gcc dot gnu dot org
  2009-03-30 22:17 ` jsm28 at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-07-04 22:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jsm28 at gcc dot gnu dot org  2008-07-04 22:16 -------
Closing 4.1 branch.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.1/4.2 Regression] ICE on |[4.2 Regression] ICE on
                   |statement expression using  |statement expression using
                   |variable-sized structure in |variable-sized structure in
                   |tree_low_cst, at tree.c:4502|tree_low_cst, at tree.c:4502
   Target Milestone|4.1.3                       |4.2.5


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


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

* [Bug c/33238] [4.2 Regression] ICE on statement expression using variable-sized structure in tree_low_cst, at tree.c:4502
  2007-08-29 20:07 [Bug c/33238] New: [4.1.2 regression] ICE on statement expression using variable-sized structure in tree_low_cst, at tree.c:4502 radford at blackbean dot org
                   ` (6 preceding siblings ...)
  2008-07-04 22:16 ` [Bug c/33238] [4.2 " jsm28 at gcc dot gnu dot org
@ 2009-03-30 22:17 ` jsm28 at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-03-30 22:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jsm28 at gcc dot gnu dot org  2009-03-30 22:17 -------
Closing 4.2 branch, fixed in 4.3.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
      Known to fail|4.0.0 4.1.2 4.2.1           |4.0.0 4.1.2 4.2.1 4.2.5
         Resolution|                            |FIXED
   Target Milestone|4.2.5                       |4.3.0


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


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

end of thread, other threads:[~2009-03-30 22:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-29 20:07 [Bug c/33238] New: [4.1.2 regression] ICE on statement expression using variable-sized structure in tree_low_cst, at tree.c:4502 radford at blackbean dot org
2007-08-29 21:19 ` [Bug c/33238] " radford at blackbean dot org
2007-08-30 10:06 ` [Bug c/33238] [4.1/4.2/4.3 Regression] " rguenth at gcc dot gnu dot org
2007-09-05  1:10 ` mmitchel at gcc dot gnu dot org
2007-09-19 11:21 ` jakub at gcc dot gnu dot org
2007-09-20 21:20 ` jakub at gcc dot gnu dot org
2007-09-21  9:50 ` [Bug c/33238] [4.1/4.2 " jakub at gcc dot gnu dot org
2008-07-04 22:16 ` [Bug c/33238] [4.2 " jsm28 at gcc dot gnu dot org
2009-03-30 22:17 ` jsm28 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).