public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/28642]  New: ICE  in layout_type, at stor-layout.c:1851
@ 2006-08-07 18:26 apl at alum dot mit dot edu
  2006-08-07 18:27 ` [Bug c++/28642] " apl at alum dot mit dot edu
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: apl at alum dot mit dot edu @ 2006-08-07 18:26 UTC (permalink / raw)
  To: gcc-bugs

attribute((maybe_aliased)) in a union causes ICE


-- 
           Summary: ICE  in layout_type, at stor-layout.c:1851
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: apl at alum dot mit dot edu
 GCC build triplet: i6868-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=28642


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

* [Bug c++/28642] ICE  in layout_type, at stor-layout.c:1851
  2006-08-07 18:26 [Bug c++/28642] New: ICE in layout_type, at stor-layout.c:1851 apl at alum dot mit dot edu
@ 2006-08-07 18:27 ` apl at alum dot mit dot edu
  2006-08-07 18:34 ` apl at alum dot mit dot edu
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: apl at alum dot mit dot edu @ 2006-08-07 18:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from apl at alum dot mit dot edu  2006-08-07 18:27 -------
Created an attachment (id=12040)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12040&action=view)
test case causing ICE

compiled with: g++ -c ice.cxx


-- 


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


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

* [Bug c++/28642] ICE  in layout_type, at stor-layout.c:1851
  2006-08-07 18:26 [Bug c++/28642] New: ICE in layout_type, at stor-layout.c:1851 apl at alum dot mit dot edu
  2006-08-07 18:27 ` [Bug c++/28642] " apl at alum dot mit dot edu
@ 2006-08-07 18:34 ` apl at alum dot mit dot edu
  2006-08-13 16:21 ` [Bug middle-end/28642] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: apl at alum dot mit dot edu @ 2006-08-07 18:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from apl at alum dot mit dot edu  2006-08-07 18:34 -------
Amending the "description"

    attribute ((may_alias)) in a union causes ICE.

I'm using the 7/15/2006 snapshot of 4.2

I realize that unions are implicitly 'aliased', but in fact this problem was
encountered while I was trying to debug a more complex situation.  I have a
template class that tries to deposit smaller addressable units into a larger
POD type.  The alias analysis code in gcc3.4 thru 4.2 optimizes this code in
ways that
produce "wrong results".  I've tried a number of workarounds, including use of
volatile asm instructions to deal with that without any success - and since I'm
in the realm of undefined behavior, I don't expect anything from GCC
developers.

But, regardless of the optimization issues, an ICE on what should be legal code
is something that needs fixing...


-- 

apl at alum dot mit dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |3.4.3 4.2.0


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


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

* [Bug middle-end/28642] [4.0/4.1/4.2 Regression] ICE  in layout_type, at stor-layout.c:1851
  2006-08-07 18:26 [Bug c++/28642] New: ICE in layout_type, at stor-layout.c:1851 apl at alum dot mit dot edu
  2006-08-07 18:27 ` [Bug c++/28642] " apl at alum dot mit dot edu
  2006-08-07 18:34 ` apl at alum dot mit dot edu
@ 2006-08-13 16:21 ` pinskia at gcc dot gnu dot org
  2006-08-20 22:33 ` mmitchel at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-08-13 16:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-08-13 16:21 -------
Confirmed, 3.2.3 did not ICE, though it did just ignore may_alias after warning
about it.  I am going to mark this a regression as the ICE is a regression for
the code.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
          Component|c++                         |middle-end
     Ever Confirmed|0                           |1
  GCC build triplet|i6868-pc-linux-gnu          |
   GCC host triplet|i686-pc-linux-gnu           |
 GCC target triplet|i686-pc-linux-gnu           |
      Known to fail|3.4.3 4.2.0                 |3.4.3 4.2.0 3.3.3
   Last reconfirmed|0000-00-00 00:00:00         |2006-08-13 16:21:01
               date|                            |
            Summary|ICE  in layout_type, at     |[4.0/4.1/4.2 Regression] ICE
                   |stor-layout.c:1851          |in layout_type, at stor-
                   |                            |layout.c:1851
   Target Milestone|---                         |4.0.4


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


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

* [Bug middle-end/28642] [4.0/4.1/4.2 Regression] ICE  in layout_type, at stor-layout.c:1851
  2006-08-07 18:26 [Bug c++/28642] New: ICE in layout_type, at stor-layout.c:1851 apl at alum dot mit dot edu
                   ` (2 preceding siblings ...)
  2006-08-13 16:21 ` [Bug middle-end/28642] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
@ 2006-08-20 22:33 ` mmitchel at gcc dot gnu dot org
  2006-08-23 20:43 ` [Bug c++/28642] " jakub at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-08-20 22:33 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=28642


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

* [Bug c++/28642] [4.0/4.1/4.2 Regression] ICE  in layout_type, at stor-layout.c:1851
  2006-08-07 18:26 [Bug c++/28642] New: ICE in layout_type, at stor-layout.c:1851 apl at alum dot mit dot edu
                   ` (3 preceding siblings ...)
  2006-08-20 22:33 ` mmitchel at gcc dot gnu dot org
@ 2006-08-23 20:43 ` jakub at gcc dot gnu dot org
  2006-10-08 20:21 ` [Bug c++/28642] [4.0/4.1/4.2 Regression] ICE in layout_type with may_alias reichelt at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu dot org @ 2006-08-23 20:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jakub at gcc dot gnu dot org  2006-08-23 20:43 -------
This seems to be a C++ FE bug:
debug_tree (*decl)
 <field_decl 0xf7bc65b0 whole
    type <template_type_parm 0xf7bc63f0 IT type_0 type_6 VOID
        align 8 symtab 0 alias set -1
       index 0 level 1 orig_level 1
        chain <type_decl 0xf7daeb00 IT>>
    VOID file a.C line 3
    align 1 offset_align 1>
shouldn't be passed to decl_attributes in generic code.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|middle-end                  |c++


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


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

* [Bug c++/28642] [4.0/4.1/4.2 Regression] ICE in layout_type with may_alias
  2006-08-07 18:26 [Bug c++/28642] New: ICE in layout_type, at stor-layout.c:1851 apl at alum dot mit dot edu
                   ` (4 preceding siblings ...)
  2006-08-23 20:43 ` [Bug c++/28642] " jakub at gcc dot gnu dot org
@ 2006-10-08 20:21 ` reichelt at gcc dot gnu dot org
  2006-10-08 20:54 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-10-08 20:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from reichelt at gcc dot gnu dot org  2006-10-08 20:21 -------
Even shorter testcase:

=======================================
template<typename T> struct A
{
  T t __attribute__ ((__may_alias__));
};
=======================================


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |reichelt at gcc dot gnu dot
                   |                            |org
           Keywords|                            |monitored
            Summary|[4.0/4.1/4.2 Regression] ICE|[4.0/4.1/4.2 Regression] ICE
                   |in layout_type with         |in layout_type with
                   |may_alias                   |may_alias


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


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

* [Bug c++/28642] [4.0/4.1/4.2 Regression] ICE in layout_type with may_alias
  2006-08-07 18:26 [Bug c++/28642] New: ICE in layout_type, at stor-layout.c:1851 apl at alum dot mit dot edu
                   ` (5 preceding siblings ...)
  2006-10-08 20:21 ` [Bug c++/28642] [4.0/4.1/4.2 Regression] ICE in layout_type with may_alias reichelt at gcc dot gnu dot org
@ 2006-10-08 20:54 ` pinskia at gcc dot gnu dot org
  2007-02-03 18:43 ` [Bug c++/28642] [4.0/4.1/4.2/4.3 Regression] ICE in layout_type with may_alias and templates gdr at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-10-08 20:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pinskia at gcc dot gnu dot org  2006-10-08 20:54 -------
When I looked at this for work, this is a hard one to fix correctly.  We could
ignore may_alias on template arguments but that will really fix the problem. 
What we need to do is to record the attribute when processing templates and
then process them while instaintating them.  If I get some next week I might
get around to do for work and once the copyright assignment problem gets
cleared up, I will post it.


-- 


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


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

* [Bug c++/28642] [4.0/4.1/4.2/4.3 Regression] ICE in layout_type with may_alias and templates
  2006-08-07 18:26 [Bug c++/28642] New: ICE in layout_type, at stor-layout.c:1851 apl at alum dot mit dot edu
                   ` (6 preceding siblings ...)
  2006-10-08 20:54 ` pinskia at gcc dot gnu dot org
@ 2007-02-03 18:43 ` gdr at gcc dot gnu dot org
  2007-02-03 20:43 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: gdr at gcc dot gnu dot org @ 2007-02-03 18:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from gdr at gcc dot gnu dot org  2007-02-03 18:43 -------
Won't fix in GCC-4.0.x.  Adjustine milestone.


-- 

gdr at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.4                       |4.1.3


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


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

* [Bug c++/28642] [4.0/4.1/4.2/4.3 Regression] ICE in layout_type with may_alias and templates
  2006-08-07 18:26 [Bug c++/28642] New: ICE in layout_type, at stor-layout.c:1851 apl at alum dot mit dot edu
                   ` (7 preceding siblings ...)
  2007-02-03 18:43 ` [Bug c++/28642] [4.0/4.1/4.2/4.3 Regression] ICE in layout_type with may_alias and templates gdr at gcc dot gnu dot org
@ 2007-02-03 20:43 ` pinskia at gcc dot gnu dot org
  2007-02-14  9:16 ` mmitchel at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-02-03 20:43 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.1.3                       |4.1.2


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


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

* [Bug c++/28642] [4.0/4.1/4.2/4.3 Regression] ICE in layout_type with may_alias and templates
  2006-08-07 18:26 [Bug c++/28642] New: ICE in layout_type, at stor-layout.c:1851 apl at alum dot mit dot edu
                   ` (8 preceding siblings ...)
  2007-02-03 20:43 ` pinskia at gcc dot gnu dot org
@ 2007-02-14  9:16 ` mmitchel at gcc dot gnu dot org
  2007-09-24 10:53 ` [Bug c++/28642] [4.0/4.1/4.2 " reichelt at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-02-14  9:16 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.1.2                       |4.1.3


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


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

* [Bug c++/28642] [4.0/4.1/4.2 Regression] ICE in layout_type with may_alias and templates
  2006-08-07 18:26 [Bug c++/28642] New: ICE in layout_type, at stor-layout.c:1851 apl at alum dot mit dot edu
                   ` (9 preceding siblings ...)
  2007-02-14  9:16 ` mmitchel at gcc dot gnu dot org
@ 2007-09-24 10:53 ` reichelt at gcc dot gnu dot org
  2007-09-24 13:53 ` jason at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2007-09-24 10:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from reichelt at gcc dot gnu dot org  2007-09-24 10:53 -------
Fixed on mainline.
Probably by the fix for PR 19407.

Jason, would you mind backporting your patch to the branches?


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu dot org
      Known to work|                            |4.3.0
            Summary|[4.0/4.1/4.2/4.3 Regression]|[4.0/4.1/4.2 Regression] ICE
                   |ICE in layout_type with     |in layout_type with
                   |may_alias and templates     |may_alias and templates


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


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

* [Bug c++/28642] [4.0/4.1/4.2 Regression] ICE in layout_type with may_alias and templates
  2006-08-07 18:26 [Bug c++/28642] New: ICE in layout_type, at stor-layout.c:1851 apl at alum dot mit dot edu
                   ` (10 preceding siblings ...)
  2007-09-24 10:53 ` [Bug c++/28642] [4.0/4.1/4.2 " reichelt at gcc dot gnu dot org
@ 2007-09-24 13:53 ` jason at gcc dot gnu dot org
  2008-07-04 21:27 ` [Bug c++/28642] [4.2 " jsm28 at gcc dot gnu dot org
  2009-03-30 17:03 ` jsm28 at gcc dot gnu dot org
  13 siblings, 0 replies; 15+ messages in thread
From: jason at gcc dot gnu dot org @ 2007-09-24 13:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from jason at gcc dot gnu dot org  2007-09-24 13:53 -------
I'm reluctant to backport the changes to 4.2 now because they're fairly
intrusive; I'm not sufficiently confident yet that the change in typedef
handling won't introduce other problems.


-- 


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


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

* [Bug c++/28642] [4.2 Regression] ICE in layout_type with may_alias and templates
  2006-08-07 18:26 [Bug c++/28642] New: ICE in layout_type, at stor-layout.c:1851 apl at alum dot mit dot edu
                   ` (11 preceding siblings ...)
  2007-09-24 13:53 ` jason at gcc dot gnu dot org
@ 2008-07-04 21:27 ` jsm28 at gcc dot gnu dot org
  2009-03-30 17:03 ` jsm28 at gcc dot gnu dot org
  13 siblings, 0 replies; 15+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-07-04 21:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from jsm28 at gcc dot gnu dot org  2008-07-04 21:26 -------
Closing 4.1 branch.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.1/4.2 Regression] ICE in |[4.2 Regression] ICE in
                   |layout_type with may_alias  |layout_type with may_alias
                   |and templates               |and templates
   Target Milestone|4.1.3                       |4.2.5


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


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

* [Bug c++/28642] [4.2 Regression] ICE in layout_type with may_alias and templates
  2006-08-07 18:26 [Bug c++/28642] New: ICE in layout_type, at stor-layout.c:1851 apl at alum dot mit dot edu
                   ` (12 preceding siblings ...)
  2008-07-04 21:27 ` [Bug c++/28642] [4.2 " jsm28 at gcc dot gnu dot org
@ 2009-03-30 17:03 ` jsm28 at gcc dot gnu dot org
  13 siblings, 0 replies; 15+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-03-30 17:03 UTC (permalink / raw)
  To: gcc-bugs



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


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
      Known to fail|3.4.3 4.0.4 4.2.0 3.3.3     |3.4.3 4.0.4 4.2.0 3.3.3
                   |                            |4.2.5
         Resolution|                            |FIXED
   Target Milestone|4.2.5                       |4.3.0


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


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

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

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-07 18:26 [Bug c++/28642] New: ICE in layout_type, at stor-layout.c:1851 apl at alum dot mit dot edu
2006-08-07 18:27 ` [Bug c++/28642] " apl at alum dot mit dot edu
2006-08-07 18:34 ` apl at alum dot mit dot edu
2006-08-13 16:21 ` [Bug middle-end/28642] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
2006-08-20 22:33 ` mmitchel at gcc dot gnu dot org
2006-08-23 20:43 ` [Bug c++/28642] " jakub at gcc dot gnu dot org
2006-10-08 20:21 ` [Bug c++/28642] [4.0/4.1/4.2 Regression] ICE in layout_type with may_alias reichelt at gcc dot gnu dot org
2006-10-08 20:54 ` pinskia at gcc dot gnu dot org
2007-02-03 18:43 ` [Bug c++/28642] [4.0/4.1/4.2/4.3 Regression] ICE in layout_type with may_alias and templates gdr at gcc dot gnu dot org
2007-02-03 20:43 ` pinskia at gcc dot gnu dot org
2007-02-14  9:16 ` mmitchel at gcc dot gnu dot org
2007-09-24 10:53 ` [Bug c++/28642] [4.0/4.1/4.2 " reichelt at gcc dot gnu dot org
2007-09-24 13:53 ` jason at gcc dot gnu dot org
2008-07-04 21:27 ` [Bug c++/28642] [4.2 " jsm28 at gcc dot gnu dot org
2009-03-30 17:03 ` 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).