public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/32295]  New: An invalid c code causes an ICE in create_tmp_var, at gimplify.c:489
@ 2007-06-12  0:29 kkojima at gcc dot gnu dot org
  2007-06-12  1:18 ` [Bug c/32295] " pinskia at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: kkojima at gcc dot gnu dot org @ 2007-06-12  0:29 UTC (permalink / raw)
  To: gcc-bugs

The following invalid code snippet fails with
  foo.c:4: internal compiler error: in create_tmp_var, at gimplify.c:489


static enum warn overflow;
int foo (int code, tree stmt)
{
  if (code == 0 || code > (int) overflow)
    code = overflow;
  return code;
}


-- 
           Summary: An invalid c code causes an ICE in create_tmp_var, at
                    gimplify.c:489
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kkojima at gcc dot gnu dot org
 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=32295


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

* [Bug c/32295] An invalid c code causes an ICE in create_tmp_var, at gimplify.c:489
  2007-06-12  0:29 [Bug c/32295] New: An invalid c code causes an ICE in create_tmp_var, at gimplify.c:489 kkojima at gcc dot gnu dot org
@ 2007-06-12  1:18 ` pinskia at gcc dot gnu dot org
  2007-06-12  1:20 ` [Bug c/32295] [4.1/4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-06-12  1:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2007-06-12 01:18 -------
Reduced testcase:
static enum warn overflow;
int foo (void)
{
 return overflow;
}

I think this is valid GNU C, though invalid standard C.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|ice-on-invalid-code         |
   Last reconfirmed|0000-00-00 00:00:00         |2007-06-12 01:18:14
               date|                            |


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


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

* [Bug c/32295] [4.1/4.2/4.3 Regression] An invalid c code causes an ICE in create_tmp_var, at gimplify.c:489
  2007-06-12  0:29 [Bug c/32295] New: An invalid c code causes an ICE in create_tmp_var, at gimplify.c:489 kkojima at gcc dot gnu dot org
  2007-06-12  1:18 ` [Bug c/32295] " pinskia at gcc dot gnu dot org
@ 2007-06-12  1:20 ` pinskia at gcc dot gnu dot org
  2007-06-29 18:43 ` mmitchel at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-06-12  1:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2007-06-12 01:20 -------
Actually I take that back, this is even invalid GNU C.
3.3 gave:
t.c:1: error: storage size of `overflow' isn't known

While 4.0.4 gave an ICE.  We should have gave an error here.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  GCC build triplet|i686-pc-linux-gnu           |
   GCC host triplet|i686-pc-linux-gnu           |
 GCC target triplet|i686-pc-linux-gnu           |
           Keywords|                            |ice-on-invalid-code
      Known to work|4.0.4                       |3.3.3
            Summary|An invalid c code causes an |[4.1/4.2/4.3 Regression] An
                   |ICE in create_tmp_var, at   |invalid c code causes an ICE
                   |gimplify.c:489              |in create_tmp_var, at
                   |                            |gimplify.c:489
   Target Milestone|---                         |4.1.3


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


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

* [Bug c/32295] [4.1/4.2/4.3 Regression] An invalid c code causes an ICE in create_tmp_var, at gimplify.c:489
  2007-06-12  0:29 [Bug c/32295] New: An invalid c code causes an ICE in create_tmp_var, at gimplify.c:489 kkojima at gcc dot gnu dot org
  2007-06-12  1:18 ` [Bug c/32295] " pinskia at gcc dot gnu dot org
  2007-06-12  1:20 ` [Bug c/32295] [4.1/4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
@ 2007-06-29 18:43 ` mmitchel at gcc dot gnu dot org
  2007-08-23 12:38 ` jakub at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-06-29 18:43 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

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


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


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

* [Bug c/32295] [4.1/4.2/4.3 Regression] An invalid c code causes an ICE in create_tmp_var, at gimplify.c:489
  2007-06-12  0:29 [Bug c/32295] New: An invalid c code causes an ICE in create_tmp_var, at gimplify.c:489 kkojima at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-06-29 18:43 ` mmitchel at gcc dot gnu dot org
@ 2007-08-23 12:38 ` jakub at gcc dot gnu dot org
  2007-09-16 15:09 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-08-23 12:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jakub at gcc dot gnu dot org  2007-08-23 12:38 -------
Another testcase:
extern enum warn overflow;
int
foo (void)
{
  return overflow;
}

Here 3.4.x silently compiled it and used SImode for the variable, eventhough
TYPE_SIZE on the enum warn type nor DECL_SIZE on overflow DECL_EXTERNAL
variable
was set.


-- 


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


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

* [Bug c/32295] [4.1/4.2/4.3 Regression] An invalid c code causes an ICE in create_tmp_var, at gimplify.c:489
  2007-06-12  0:29 [Bug c/32295] New: An invalid c code causes an ICE in create_tmp_var, at gimplify.c:489 kkojima at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-08-23 12:38 ` jakub at gcc dot gnu dot org
@ 2007-09-16 15:09 ` pinskia at gcc dot gnu dot org
  2007-09-24 17:36 ` jsm28 at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-09-16 15:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2007-09-16 15:09 -------
*** Bug 33448 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |debian-gcc at lists dot
                   |                            |debian dot org


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


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

* [Bug c/32295] [4.1/4.2/4.3 Regression] An invalid c code causes an ICE in create_tmp_var, at gimplify.c:489
  2007-06-12  0:29 [Bug c/32295] New: An invalid c code causes an ICE in create_tmp_var, at gimplify.c:489 kkojima at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2007-09-16 15:09 ` pinskia at gcc dot gnu dot org
@ 2007-09-24 17:36 ` jsm28 at gcc dot gnu dot org
  2007-09-25 15:05 ` jsm28 at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2007-09-24 17:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jsm28 at gcc dot gnu dot org  2007-09-24 17:36 -------
Working on a patch.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jsm28 at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-06-12 01:18:14         |2007-09-24 17:36:28
               date|                            |


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


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

* [Bug c/32295] [4.1/4.2/4.3 Regression] An invalid c code causes an ICE in create_tmp_var, at gimplify.c:489
  2007-06-12  0:29 [Bug c/32295] New: An invalid c code causes an ICE in create_tmp_var, at gimplify.c:489 kkojima at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2007-09-24 17:36 ` jsm28 at gcc dot gnu dot org
@ 2007-09-25 15:05 ` jsm28 at gcc dot gnu dot org
  2007-09-27 12:20 ` [Bug c/32295] [4.1/4.2 " jsm28 at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2007-09-25 15:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jsm28 at gcc dot gnu dot org  2007-09-25 15:05 -------
Subject: Bug 32295

Author: jsm28
Date: Tue Sep 25 15:04:58 2007
New Revision: 128765

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128765
Log:
        PR c/32295
        * c-typeck.c (default_conversion): Call require_complete_type
        before perform_integral_promotions.
        (build_unary_op): Call require_complete_type except for ADDR_EXPR.
        (build_c_cast): Call require_complete_type except for casts to
        void types.
        (convert_for_assignment): Call require_complete_type.

testsuite:
        * gcc.dg/enum-incomplete-1.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/enum-incomplete-1.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-typeck.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c/32295] [4.1/4.2 Regression] An invalid c code causes an ICE in create_tmp_var, at gimplify.c:489
  2007-06-12  0:29 [Bug c/32295] New: An invalid c code causes an ICE in create_tmp_var, at gimplify.c:489 kkojima at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2007-09-25 15:05 ` jsm28 at gcc dot gnu dot org
@ 2007-09-27 12:20 ` jsm28 at gcc dot gnu dot org
  2007-10-10 18:24 ` jsm28 at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2007-09-27 12:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jsm28 at gcc dot gnu dot org  2007-09-27 12:20 -------
Fixed for 4.3.0.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.1/4.2/4.3 Regression] An |[4.1/4.2 Regression] An
                   |invalid c code causes an ICE|invalid c code causes an ICE
                   |in create_tmp_var, at       |in create_tmp_var, at
                   |gimplify.c:489              |gimplify.c:489


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


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

* [Bug c/32295] [4.1/4.2 Regression] An invalid c code causes an ICE in create_tmp_var, at gimplify.c:489
  2007-06-12  0:29 [Bug c/32295] New: An invalid c code causes an ICE in create_tmp_var, at gimplify.c:489 kkojima at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2007-09-27 12:20 ` [Bug c/32295] [4.1/4.2 " jsm28 at gcc dot gnu dot org
@ 2007-10-10 18:24 ` jsm28 at gcc dot gnu dot org
  2007-10-10 18:32 ` [Bug c/32295] [4.1 " jsm28 at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2007-10-10 18:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jsm28 at gcc dot gnu dot org  2007-10-10 18:24 -------
Subject: Bug 32295

Author: jsm28
Date: Wed Oct 10 18:24:29 2007
New Revision: 129215

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129215
Log:
        PR c/32295
        * c-typeck.c (default_conversion): Call require_complete_type
        before perform_integral_promotions.
        (build_unary_op): Call require_complete_type except for ADDR_EXPR.
        (build_c_cast): Call require_complete_type except for casts to
        void types.
        (convert_for_assignment): Call require_complete_type.

testsuite:
        * gcc.dg/enum-incomplete-1.c: New test.

Added:
    branches/gcc-4_2-branch/gcc/testsuite/gcc.dg/enum-incomplete-1.c
Modified:
    branches/gcc-4_2-branch/gcc/ChangeLog
    branches/gcc-4_2-branch/gcc/c-typeck.c
    branches/gcc-4_2-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c/32295] [4.1 Regression] An invalid c code causes an ICE in create_tmp_var, at gimplify.c:489
  2007-06-12  0:29 [Bug c/32295] New: An invalid c code causes an ICE in create_tmp_var, at gimplify.c:489 kkojima at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2007-10-10 18:24 ` jsm28 at gcc dot gnu dot org
@ 2007-10-10 18:32 ` jsm28 at gcc dot gnu dot org
  2008-01-16 21:20 ` pinskia at gcc dot gnu dot org
  2008-07-04 16:10 ` jsm28 at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2007-10-10 18:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from jsm28 at gcc dot gnu dot org  2007-10-10 18:31 -------
Fixed for 4.2.3.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|jsm28 at gcc dot gnu dot org|unassigned at gcc dot gnu
                   |                            |dot org
             Status|ASSIGNED                    |NEW
            Summary|[4.1/4.2 Regression] An     |[4.1 Regression] An invalid
                   |invalid c code causes an ICE|c code causes an ICE in
                   |in create_tmp_var, at       |create_tmp_var, at
                   |gimplify.c:489              |gimplify.c:489


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


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

* [Bug c/32295] [4.1 Regression] An invalid c code causes an ICE in create_tmp_var, at gimplify.c:489
  2007-06-12  0:29 [Bug c/32295] New: An invalid c code causes an ICE in create_tmp_var, at gimplify.c:489 kkojima at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2007-10-10 18:32 ` [Bug c/32295] [4.1 " jsm28 at gcc dot gnu dot org
@ 2008-01-16 21:20 ` pinskia at gcc dot gnu dot org
  2008-07-04 16:10 ` jsm28 at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-01-16 21:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from pinskia at gcc dot gnu dot org  2008-01-16 20:45 -------
*** Bug 34819 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mrs at apple dot com


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


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

* [Bug c/32295] [4.1 Regression] An invalid c code causes an ICE in create_tmp_var, at gimplify.c:489
  2007-06-12  0:29 [Bug c/32295] New: An invalid c code causes an ICE in create_tmp_var, at gimplify.c:489 kkojima at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2008-01-16 21:20 ` pinskia at gcc dot gnu dot org
@ 2008-07-04 16:10 ` jsm28 at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-07-04 16:10 UTC (permalink / raw)
  To: gcc-bugs



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


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
      Known to fail|4.1.2 4.2.0 4.3.0           |4.1.2 4.1.3 4.2.0 4.3.0
      Known to work|3.3.3                       |3.3.3 4.2.3
         Resolution|                            |FIXED
   Target Milestone|4.1.3                       |4.2.3


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


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

end of thread, other threads:[~2008-07-04 16:10 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-12  0:29 [Bug c/32295] New: An invalid c code causes an ICE in create_tmp_var, at gimplify.c:489 kkojima at gcc dot gnu dot org
2007-06-12  1:18 ` [Bug c/32295] " pinskia at gcc dot gnu dot org
2007-06-12  1:20 ` [Bug c/32295] [4.1/4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
2007-06-29 18:43 ` mmitchel at gcc dot gnu dot org
2007-08-23 12:38 ` jakub at gcc dot gnu dot org
2007-09-16 15:09 ` pinskia at gcc dot gnu dot org
2007-09-24 17:36 ` jsm28 at gcc dot gnu dot org
2007-09-25 15:05 ` jsm28 at gcc dot gnu dot org
2007-09-27 12:20 ` [Bug c/32295] [4.1/4.2 " jsm28 at gcc dot gnu dot org
2007-10-10 18:24 ` jsm28 at gcc dot gnu dot org
2007-10-10 18:32 ` [Bug c/32295] [4.1 " jsm28 at gcc dot gnu dot org
2008-01-16 21:20 ` pinskia at gcc dot gnu dot org
2008-07-04 16:10 ` 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).