public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/22098] New: [4.0/4.1 Regression] ICE in compound literal gimplification
@ 2005-06-16 21:33 jsm28 at gcc dot gnu dot org
  2005-06-16 21:36 ` [Bug c/22098] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2005-06-16 21:33 UTC (permalink / raw)
  To: gcc-bugs

extern void abort (void);
extern void exit (int);
typedef __SIZE_TYPE__ size_t;
int
main (void)
{
  int a = 0;
  int *p;
  size_t b;
  b = (size_t)(p = &(int []){0, 1, 2}[1]);
  if (*p != 1 || *(int *)b != 1)
    abort ();
  exit (0);
}

ICEs on mainline and 4.0 branch but not 3.4.4.  The problem is the compound
literal address is considered TREE_CONSTANT which allows it to be duplicated by
fold, but gimplifying the same compound literal more than once yields an ICE.

I'll suggest an approach for a fix in a followup to
<http://gcc.gnu.org/ml/gcc-patches/2005-06/msg01448.html>.

t.c: In function 'main':
t.c:10: internal compiler error: in gimple_add_tmp_var, at gimplify.c:532
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

-- 
           Summary: [4.0/4.1 Regression] ICE in compound literal
                    gimplification
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jsm28 at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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

end of thread, other threads:[~2005-07-08 14:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-16 21:33 [Bug c/22098] New: [4.0/4.1 Regression] ICE in compound literal gimplification jsm28 at gcc dot gnu dot org
2005-06-16 21:36 ` [Bug c/22098] " pinskia at gcc dot gnu dot org
2005-06-16 21:43 ` pinskia at gcc dot gnu dot org
2005-06-16 22:04 ` bangerth at dealii dot org
2005-06-30 15:00 ` jsm28 at gcc dot gnu dot org
2005-07-05 17:50 ` cvs-commit at gcc dot gnu dot org
2005-07-05 19:50 ` [Bug c/22098] [4.0 " pinskia at gcc dot gnu dot org
2005-07-08 13:09 ` cvs-commit at gcc dot gnu dot org
2005-07-08 14:48 ` pinskia at gcc dot gnu dot org
2005-07-08 14:49 ` 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).