public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/25682]  New: ICE when using (int)(&((S*)0)->field) as array size
@ 2006-01-05 21:39 gcc-bugzilla at gcc dot gnu dot org
  2006-01-05 22:36 ` [Bug c/25682] [4.0/4.1/4.2 Regression] " steven at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2006-01-05 21:39 UTC (permalink / raw)
  To: gcc-bugs


        A 'field offset' macro which has worked so far (up to gcc-3.4.3) now
        causes an ICE.

Environment:
System: Linux suse2 2.4.19-64GB-SMP #1 SMP Mon Oct 21 18:48:05 UTC 2002 i686
unknown
Architecture: i686


host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc-4.0.2/configure --prefix=/usr/local/gnu/gcc/4.0.2
--enable-languages=c,c++

How-To-Repeat:
        Compile the program below with 'gcc -c':
/****/
typedef struct {
        char name;
} S;
void f()
{
        char a[(int)&(((S*)8)->name)];
} 
/****/
        The compiler output is:
bug.c: In function 'f':
bug.c:5: internal compiler error: in tree_low_cst, at tree.c:3850


------- Comment #1 from yuvalk at mainsoft dot com  2006-01-05 21:39 -------
Fix:
        Use the GCC offsetof macro from stddef.h


-- 
           Summary: ICE when using (int)(&((S*)0)->field) as array size
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: yuvalk at mainsoft dot com
 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=25682



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

end of thread, other threads:[~2006-02-28 12:44 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-05 21:39 [Bug c/25682] New: ICE when using (int)(&((S*)0)->field) as array size gcc-bugzilla at gcc dot gnu dot org
2006-01-05 22:36 ` [Bug c/25682] [4.0/4.1/4.2 Regression] " steven at gcc dot gnu dot org
2006-01-05 22:42 ` pinskia at gcc dot gnu dot org
2006-01-07 16:01 ` [Bug c/25682] [4.0/4.1/4.2 Regression] ICE when using old sytle offsetof (with non zero start) " pinskia at gcc dot gnu dot org
2006-01-14  6:04 ` pinskia at gcc dot gnu dot org
2006-01-15 22:27 ` mmitchel at gcc dot gnu dot org
2006-01-16 12:46 ` jakub at gcc dot gnu dot org
2006-01-16 19:28 ` janis at gcc dot gnu dot org
2006-01-17  9:58 ` jakub at gcc dot gnu dot org
2006-01-17 10:00 ` jakub at gcc dot gnu dot org
2006-02-27 20:25 ` [Bug c/25682] [4.0 " mmitchel at gcc dot gnu dot org
2006-02-28 11:38 ` jakub at gcc dot gnu dot org
2006-02-28 12:45 ` 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).