public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/27409]  New: ICE in get_constraint_for_component_ref
@ 2006-05-03 15:46 matz at suse dot de
  2006-05-03 16:05 ` [Bug middle-end/27409] " rguenth at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: matz at suse dot de @ 2006-05-03 15:46 UTC (permalink / raw)
  To: gcc-bugs

The below testcase ICEs in get_constraint_for_component_ref when compiled
with -O1 or beyond on x86_64.  Richard mentions that it also fails with
trunk.

---------------------------------------
/* compile with gcc -c -Os -o foo.o foo.c */

typedef struct {
        struct { } z;
} thang_t;
struct widget {
        struct widget *p, *q;
};
typedef struct thing {
        struct widget   x;
} thing_t;
struct {
        int             a;
        int             b;
        int             c;
        int             d;
        int             e;
        thang_t         f;
        thing_t         g;
} my_struct;
static void foo(thang_t *r)
{ splat(r);}
void function(int blaz)
{ foo(&my_struct.f);}
---------------------------------------


-- 
           Summary: ICE in get_constraint_for_component_ref
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: matz at suse dot de
  GCC host triplet: x86_64-linux


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


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

* [Bug middle-end/27409] ICE in get_constraint_for_component_ref
  2006-05-03 15:46 [Bug middle-end/27409] New: ICE in get_constraint_for_component_ref matz at suse dot de
@ 2006-05-03 16:05 ` rguenth at gcc dot gnu dot org
  2006-05-03 16:06 ` rguenth at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-05-03 16:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2006-05-03 16:05 -------
Confirmed.  We access a zero-sized part of the structure:

    arg 1 <field_decl 0x2a959f2180 f type <record_type 0x2a959dfb00 thang_t>
        BLK file t.c line 16 size <integer_cst 0x2a958ab750 0> unit size
<integer_cst 0x2a95891720 0>
        align 8 offset_align 128
        offset <integer_cst 0x2a958ab0f0 constant invariant 16>
        bit offset <integer_cst 0x2a95891bd0 constant invariant 32> context
<record_type 0x2a959dfe70>
        chain <field_decl 0x2a959f2240 g type <record_type 0x2a959dfdc0
thing_t>
            BLK file t.c line 17
            size <integer_cst 0x2a958ab0c0 constant invariant 128> unit size
<integer_cst 0x2a958ab0f0 16>
            align 64 offset_align 128 offset <integer_cst 0x2a958ab0f0 16>
            bit offset <integer_cst 0x2a95891d80 constant invariant 64> context
<record_type 0x2a959dfe70>>>>

The following testcase also ICEs on 32bit targets:

typedef struct {
        struct { } z;
} thang_t;
struct {
        short           e;
        thang_t         f;
        int g;
} my_struct;
void function(int blaz)
{ thang_t *fp = &my_struct.f; foo(fp);}

the important thing is that there has to be padding after e and the zero-sized
f.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-05-03 16:05:15
               date|                            |


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


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

* [Bug middle-end/27409] ICE in get_constraint_for_component_ref
  2006-05-03 15:46 [Bug middle-end/27409] New: ICE in get_constraint_for_component_ref matz at suse dot de
  2006-05-03 16:05 ` [Bug middle-end/27409] " rguenth at gcc dot gnu dot org
@ 2006-05-03 16:06 ` rguenth at gcc dot gnu dot org
  2006-05-03 16:12 ` [Bug middle-end/27409] [4.1/4.2 Regression] " rguenth at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-05-03 16:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2006-05-03 16:06 -------
I have a fix.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |26678
              nThis|                            |
         AssignedTo|unassigned at gcc dot gnu   |rguenth at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2006-05-03 16:05:15         |2006-05-03 16:06:26
               date|                            |


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


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

* [Bug middle-end/27409] [4.1/4.2 Regression] ICE in get_constraint_for_component_ref
  2006-05-03 15:46 [Bug middle-end/27409] New: ICE in get_constraint_for_component_ref matz at suse dot de
  2006-05-03 16:05 ` [Bug middle-end/27409] " rguenth at gcc dot gnu dot org
  2006-05-03 16:06 ` rguenth at gcc dot gnu dot org
@ 2006-05-03 16:12 ` rguenth at gcc dot gnu dot org
  2006-05-03 16:13 ` rguenth at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-05-03 16:12 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   GCC host triplet|x86_64-linux                |
           Keywords|                            |ice-on-valid-code
      Known to fail|                            |4.2.0 4.1.0
            Summary|ICE in                      |[4.1/4.2 Regression] ICE in
                   |get_constraint_for_component|get_constraint_for_component
                   |_ref                        |_ref
   Target Milestone|---                         |4.1.1


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


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

* [Bug middle-end/27409] [4.1/4.2 Regression] ICE in get_constraint_for_component_ref
  2006-05-03 15:46 [Bug middle-end/27409] New: ICE in get_constraint_for_component_ref matz at suse dot de
                   ` (2 preceding siblings ...)
  2006-05-03 16:12 ` [Bug middle-end/27409] [4.1/4.2 Regression] " rguenth at gcc dot gnu dot org
@ 2006-05-03 16:13 ` rguenth at gcc dot gnu dot org
  2006-05-03 17:53 ` matz at suse dot de
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-05-03 16:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2006-05-03 16:13 -------
Created an attachment (id=11367)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11367&action=view)
patch

Patch to be tested (Micha, can you do this?).


-- 


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


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

* [Bug middle-end/27409] [4.1/4.2 Regression] ICE in get_constraint_for_component_ref
  2006-05-03 15:46 [Bug middle-end/27409] New: ICE in get_constraint_for_component_ref matz at suse dot de
                   ` (3 preceding siblings ...)
  2006-05-03 16:13 ` rguenth at gcc dot gnu dot org
@ 2006-05-03 17:53 ` matz at suse dot de
  2006-05-03 17:54 ` matz at suse dot de
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: matz at suse dot de @ 2006-05-03 17:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from matz at suse dot de  2006-05-03 17:53 -------
Yes.  I'm testing it for trunk and 4.1 on a couple platforms.


-- 


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


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

* [Bug middle-end/27409] [4.1/4.2 Regression] ICE in get_constraint_for_component_ref
  2006-05-03 15:46 [Bug middle-end/27409] New: ICE in get_constraint_for_component_ref matz at suse dot de
                   ` (4 preceding siblings ...)
  2006-05-03 17:53 ` matz at suse dot de
@ 2006-05-03 17:54 ` matz at suse dot de
  2006-05-07 21:04 ` rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: matz at suse dot de @ 2006-05-03 17:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from matz at suse dot de  2006-05-03 17:54 -------
Created an attachment (id=11368)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11368&action=view)
patch relative to 4.1

This is the same patch adjusted for 4.1.


-- 


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


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

* [Bug middle-end/27409] [4.1/4.2 Regression] ICE in get_constraint_for_component_ref
  2006-05-03 15:46 [Bug middle-end/27409] New: ICE in get_constraint_for_component_ref matz at suse dot de
                   ` (5 preceding siblings ...)
  2006-05-03 17:54 ` matz at suse dot de
@ 2006-05-07 21:04 ` rguenth at gcc dot gnu dot org
  2006-05-08  6:53 ` [Bug middle-end/27409] [4.1 " pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-05-07 21:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from rguenth at gcc dot gnu dot org  2006-05-07 21:04 -------
Subject: Bug 27409

Author: rguenth
Date: Sun May  7 21:03:55 2006
New Revision: 113607

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113607
Log:
2006-05-07  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/27409
        * tree-ssa-structalias.c (get_constraint_for_component_ref):
        Do not try to find zero-sized subvars.

        * gcc.dg/torture/pr27409.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/torture/pr27409.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-structalias.c


-- 


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


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

* [Bug middle-end/27409] [4.1 Regression] ICE in get_constraint_for_component_ref
  2006-05-03 15:46 [Bug middle-end/27409] New: ICE in get_constraint_for_component_ref matz at suse dot de
                   ` (6 preceding siblings ...)
  2006-05-07 21:04 ` rguenth at gcc dot gnu dot org
@ 2006-05-08  6:53 ` pinskia at gcc dot gnu dot org
  2006-05-09 14:33 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-05-08  6:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pinskia at gcc dot gnu dot org  2006-05-08 06:52 -------
Fixed at least on the mainline.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|4.2.0 4.1.0                 |4.1.0
      Known to work|                            |4.2.0 4.0.3
            Summary|[4.1/4.2 Regression] ICE in |[4.1 Regression] ICE in
                   |get_constraint_for_component|get_constraint_for_component
                   |_ref                        |_ref


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


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

* [Bug middle-end/27409] [4.1 Regression] ICE in get_constraint_for_component_ref
  2006-05-03 15:46 [Bug middle-end/27409] New: ICE in get_constraint_for_component_ref matz at suse dot de
                   ` (7 preceding siblings ...)
  2006-05-08  6:53 ` [Bug middle-end/27409] [4.1 " pinskia at gcc dot gnu dot org
@ 2006-05-09 14:33 ` rguenth at gcc dot gnu dot org
  2006-05-09 14:33 ` rguenth at gcc dot gnu dot org
  2006-05-15 19:32 ` patchapp at dberlin dot org
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-05-09 14:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from rguenth at gcc dot gnu dot org  2006-05-09 14:33 -------
Fixed.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

* [Bug middle-end/27409] [4.1 Regression] ICE in get_constraint_for_component_ref
  2006-05-03 15:46 [Bug middle-end/27409] New: ICE in get_constraint_for_component_ref matz at suse dot de
                   ` (8 preceding siblings ...)
  2006-05-09 14:33 ` rguenth at gcc dot gnu dot org
@ 2006-05-09 14:33 ` rguenth at gcc dot gnu dot org
  2006-05-15 19:32 ` patchapp at dberlin dot org
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-05-09 14:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from rguenth at gcc dot gnu dot org  2006-05-09 14:33 -------
Subject: Bug 27409

Author: rguenth
Date: Tue May  9 14:33:26 2006
New Revision: 113652

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113652
Log:
2006-05-09  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/27409
        * tree-ssa-structalias.c (get_constraint_for_component_ref):
        Do not try to find zero-sized subvars.

        * gcc.dg/torture/pr27409.c: New testcase.

Added:
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/torture/pr27409.c
Modified:
    branches/gcc-4_1-branch/gcc/ChangeLog
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_1-branch/gcc/tree-ssa-structalias.c


-- 


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


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

* [Bug middle-end/27409] [4.1 Regression] ICE in get_constraint_for_component_ref
  2006-05-03 15:46 [Bug middle-end/27409] New: ICE in get_constraint_for_component_ref matz at suse dot de
                   ` (9 preceding siblings ...)
  2006-05-09 14:33 ` rguenth at gcc dot gnu dot org
@ 2006-05-15 19:32 ` patchapp at dberlin dot org
  10 siblings, 0 replies; 12+ messages in thread
From: patchapp at dberlin dot org @ 2006-05-15 19:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from patchapp at dberlin dot org  2006-05-15 19:32 -------
Subject: Bug number PR27409

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2006-05/msg00153.html


-- 


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


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

end of thread, other threads:[~2006-05-15 19:32 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-03 15:46 [Bug middle-end/27409] New: ICE in get_constraint_for_component_ref matz at suse dot de
2006-05-03 16:05 ` [Bug middle-end/27409] " rguenth at gcc dot gnu dot org
2006-05-03 16:06 ` rguenth at gcc dot gnu dot org
2006-05-03 16:12 ` [Bug middle-end/27409] [4.1/4.2 Regression] " rguenth at gcc dot gnu dot org
2006-05-03 16:13 ` rguenth at gcc dot gnu dot org
2006-05-03 17:53 ` matz at suse dot de
2006-05-03 17:54 ` matz at suse dot de
2006-05-07 21:04 ` rguenth at gcc dot gnu dot org
2006-05-08  6:53 ` [Bug middle-end/27409] [4.1 " pinskia at gcc dot gnu dot org
2006-05-09 14:33 ` rguenth at gcc dot gnu dot org
2006-05-09 14:33 ` rguenth at gcc dot gnu dot org
2006-05-15 19:32 ` patchapp at dberlin 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).