public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/36666] [4.4 Regression] ICE in process_constraint, at tree-ssa-structalias.c:2573
  2008-06-29 13:34 [Bug tree-optimization/36666] New: [4.4 Regression] ICE in process_constraint, at tree-ssa-structalias.c:2573 rguenth at gcc dot gnu dot org
@ 2008-06-29 13:34 ` rguenth at gcc dot gnu dot org
  2008-06-29 14:19 ` rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-06-29 13:34 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-06-29 13:33:40
               date|                            |
   Target Milestone|---                         |4.4.0


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


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

* [Bug tree-optimization/36666]  New: [4.4 Regression] ICE in process_constraint, at tree-ssa-structalias.c:2573
@ 2008-06-29 13:34 rguenth at gcc dot gnu dot org
  2008-06-29 13:34 ` [Bug tree-optimization/36666] " rguenth at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-06-29 13:34 UTC (permalink / raw)
  To: gcc-bugs

Testcase, reduced from ia64 ada bootstrap failure:

struct Foo {
  int *p;
  struct X {
    int a,b,c,d,e,*f;
  } x;
} *init, *init2;

struct X __attribute__((const)) foo(struct X);

void bar (void)
{
  init->x = foo (init2->x);
}

mine.


-- 
           Summary: [4.4 Regression] ICE in process_constraint, at tree-ssa-
                    structalias.c:2573
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: rguenth at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org


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


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

* [Bug tree-optimization/36666] [4.4 Regression] ICE in process_constraint, at tree-ssa-structalias.c:2573
  2008-06-29 13:34 [Bug tree-optimization/36666] New: [4.4 Regression] ICE in process_constraint, at tree-ssa-structalias.c:2573 rguenth at gcc dot gnu dot org
  2008-06-29 13:34 ` [Bug tree-optimization/36666] " rguenth at gcc dot gnu dot org
@ 2008-06-29 14:19 ` rguenth at gcc dot gnu dot org
  2008-06-29 15:24 ` dberlin at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-06-29 14:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2008-06-29 14:19 -------
The solution is to remove the assert, but there is more latent bugs I just
discovered while looking at this.


-- 


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


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

* [Bug tree-optimization/36666] [4.4 Regression] ICE in process_constraint, at tree-ssa-structalias.c:2573
  2008-06-29 13:34 [Bug tree-optimization/36666] New: [4.4 Regression] ICE in process_constraint, at tree-ssa-structalias.c:2573 rguenth at gcc dot gnu dot org
  2008-06-29 13:34 ` [Bug tree-optimization/36666] " rguenth at gcc dot gnu dot org
  2008-06-29 14:19 ` rguenth at gcc dot gnu dot org
@ 2008-06-29 15:24 ` dberlin at gcc dot gnu dot org
  2008-06-29 15:32 ` rguenther at suse dot de
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dberlin at gcc dot gnu dot org @ 2008-06-29 15:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from dberlin at gcc dot gnu dot org  2008-06-29 15:23 -------
You can't remove the assert, the assert is there because things will be broken
if it hasn't been handed off to do_structure_copy.


-- 


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


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

* [Bug tree-optimization/36666] [4.4 Regression] ICE in process_constraint, at tree-ssa-structalias.c:2573
  2008-06-29 13:34 [Bug tree-optimization/36666] New: [4.4 Regression] ICE in process_constraint, at tree-ssa-structalias.c:2573 rguenth at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-06-29 15:24 ` dberlin at gcc dot gnu dot org
@ 2008-06-29 15:32 ` rguenther at suse dot de
  2008-07-01 11:06 ` rguenth at gcc dot gnu dot org
  2008-07-01 11:06 ` rguenth at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenther at suse dot de @ 2008-06-29 15:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenther at suse dot de  2008-06-29 15:31 -------
Subject: Re:  [4.4 Regression] ICE in
 process_constraint, at tree-ssa-structalias.c:2573

On Sun, 29 Jun 2008, dberlin at gcc dot gnu dot org wrote:

> ------- Comment #2 from dberlin at gcc dot gnu dot org  2008-06-29 15:23 -------
> You can't remove the assert, the assert is there because things will be broken
> if it hasn't been handed off to do_structure_copy.

Well...  not.  1) we don't have subfields here, 2) the constraint is
supposed to do what it says - what the lhs points to should point to
what the rhs points to.

The remaining bug, in the case we have subfields, is that 
get_constraint_for for struct-valued references gets us just a single
constraint for the first field it finds.

The bug is from handle_const_call:

   /* May return arguments.  */
   FOR_EACH_CALL_EXPR_ARG (arg, iter, call)
     if (could_have_pointers (arg))
       {
         VEC(ce_s, heap) *argc = NULL;
         struct constraint_expr *argp;
         int i;
         get_constraint_for (arg, &argc);
         for (i = 0; VEC_iterate (ce_s, argc, i, argp); i++)
           for (j = 0; VEC_iterate (ce_s, lhsc, j, lhsp); j++)
             process_constraint (new_constraint (*lhsp, *argp));
         VEC_free (ce_s, heap, argc);
       }

for subfields I expected that (for example for two) we end up with
the following constraints generated in this loop

  x->a = y->a
  x->b = y->a
  x->a = y->b
  x->b = y->b

which is _not_ a structure copy!  But of course in the end it only generates

  x->a = y->a

oops.

IMHO get_constraint_for for a struct-valued reference needs to fill the
array with all subvars the reference touches.  The do_structure_copy
handling is a special case that handles "real" assignments.

In the above light the assert is bogus, because it expects all
(struct) assignments coming from real instructions.

But maybe I'm missing sth? ;)

Richard.


-- 


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


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

* [Bug tree-optimization/36666] [4.4 Regression] ICE in process_constraint, at tree-ssa-structalias.c:2573
  2008-06-29 13:34 [Bug tree-optimization/36666] New: [4.4 Regression] ICE in process_constraint, at tree-ssa-structalias.c:2573 rguenth at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2008-07-01 11:06 ` rguenth at gcc dot gnu dot org
@ 2008-07-01 11:06 ` rguenth at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-07-01 11:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2008-07-01 11:05 -------
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=36666


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

* [Bug tree-optimization/36666] [4.4 Regression] ICE in process_constraint, at tree-ssa-structalias.c:2573
  2008-06-29 13:34 [Bug tree-optimization/36666] New: [4.4 Regression] ICE in process_constraint, at tree-ssa-structalias.c:2573 rguenth at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2008-06-29 15:32 ` rguenther at suse dot de
@ 2008-07-01 11:06 ` rguenth at gcc dot gnu dot org
  2008-07-01 11:06 ` rguenth at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-07-01 11:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rguenth at gcc dot gnu dot org  2008-07-01 11:06 -------
Subject: Bug 36666

Author: rguenth
Date: Tue Jul  1 11:05:17 2008
New Revision: 137315

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

        PR tree-optimization/36666
        * tree-ssa-structalias.c (get_constraint_for_1): Declare.
        (get_constraint_exp_from_ssa_var): Split into ...
        (get_constraint_exp_for_temp): ... this ...
        (get_constraint_for_ssa_var): ... and that.
        Return constraint expressions for all touched sub-fields
        if the results address is not taken.
        (process_constraint): Remove assertion that aggregate
        assignments do not happen at this place.
        (get_constraint_for_component_ref): Add address_p argument.
        Return constraint expressions for all touched sub-fields
        if the results address is not taken.
        (do_deref): Use get_constraint_exp_for_temp.
        (get_constraint_for_1): Rename from ...
        (get_constraint_for): ... this.  Add the old function as
        wrapper.
        (do_structure_copy): Use get_constraint_for_1.

        * gcc.c-torture/compile/pr36666.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr36666.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-structalias.c


-- 


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


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

end of thread, other threads:[~2008-07-01 11:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-29 13:34 [Bug tree-optimization/36666] New: [4.4 Regression] ICE in process_constraint, at tree-ssa-structalias.c:2573 rguenth at gcc dot gnu dot org
2008-06-29 13:34 ` [Bug tree-optimization/36666] " rguenth at gcc dot gnu dot org
2008-06-29 14:19 ` rguenth at gcc dot gnu dot org
2008-06-29 15:24 ` dberlin at gcc dot gnu dot org
2008-06-29 15:32 ` rguenther at suse dot de
2008-07-01 11:06 ` rguenth at gcc dot gnu dot org
2008-07-01 11:06 ` rguenth 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).