[Bug ada/19865] [4.0 Regression] ice / gnat bug detected.

2005-02-14 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-15 
02:39 ---
(In reply to comment #8)
 Did you mean MOVE_RATIO?
Yes.  A value of 2 should be able to reproduce it.  If we have any bigger 
value, the gimplifier will not 
produce the CONST_DECL which we will SRA on it.

Here is the smallest testcase which I could get:
package body PR19865 is
   type Integer_List is array (Positive range ) of Integer;
   type Integer_List_Access is access all Integer_List;

   No_Argument : aliased Integer_List := (1 .. 0 = 0);
   package Cache_Args is
  Table : aliased Integer_List_Access := null;
   end Cache_Args;
   
   procedure Build_Dynamic_Library (Options : Integer_List);
   procedure Test is
  Lib_Opts : Integer_List_Access := No_Argument'Unrestricted_Access;
   begin
  for Index in 1 .. 1 loop
Cache_Args.Table(Index) := 0;
  end loop;
  Build_Dynamic_Library (Lib_Opts.all);
   end Test;
   
   procedure Build_Dynamic_Library (Options : Integer_List) is
   begin
  null;
   end Build_Dynamic_Library;
end PR19865;
package PR19865 is
   procedure Test;
end PR19865;

Write it out to a file called t.ada and run gnatchop on it.

-- 


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


[Bug ada/19865] [4.0 Regression] ice / gnat bug detected.

2005-02-14 Thread bosch at gcc dot gnu dot org

--- Additional Comments From bosch at gcc dot gnu dot org  2005-02-14 20:11 
---
This happens after in verify-ssa after running the kill_redundant_phi_nodes 
pass. It would be great if 
someone with a better understanding of this pass could take a look at this bug.

-- 
   What|Removed |Added

 CC||bosch at gnat dot com
   Last reconfirmed|2005-02-09 19:47:29 |2005-02-14 20:11:08
   date||


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


[Bug ada/19865] [4.0 Regression] ice / gnat bug detected.

2005-02-14 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-14 
20:48 ---
(In reply to comment #3)
 This happens after in verify-ssa after running the kill_redundant_phi_nodes 
 pass. It would be great if 
 someone with a better understanding of this pass could take a look at this 
 bug.

Just a note for future people when looking over this bug, most of the 
discussion of this bug and how to 
fix this is in PR 19853.

-- 


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


[Bug ada/19865] [4.0 Regression] ice / gnat bug detected.

2005-02-14 Thread dnovillo at gcc dot gnu dot org


-- 
Bug 19865 depends on bug 19853, which changed state.

Bug 19853 Summary: [4.0 Regression] incorrect vops after exposing a new global 
variable
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19853

   What|Old Value   |New Value

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED

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


[Bug ada/19865] [4.0 Regression] ice / gnat bug detected.

2005-02-14 Thread dnovillo at gcc dot gnu dot org

--- Additional Comments From dnovillo at gcc dot gnu dot org  2005-02-14 
21:08 ---

Thanks for the test case.

-- 
   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |dnovillo at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED


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


[Bug ada/19865] [4.0 Regression] ice / gnat bug detected.

2005-02-14 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-14 
21:27 ---
(In reply to comment #5)
 The error occurs when building this with
   gnat1 -Ipath-to-srcdir/gcc/ada -O2 pr19865.adb
 (I've tested a gnat1 configured for s390-ibm-linux.)

And I can reproduce this with the reduced testcase on  powerpc-darwin also. 

You most likely can reproduce it on i686-pc-linux-gnu when you change the 
MOVE_COST to be 
something lower.

-- 
   What|Removed |Added

 CC||pinskia at gcc dot gnu dot
   ||org


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


[Bug ada/19865] [4.0 Regression] ice / gnat bug detected.

2005-02-14 Thread dnovillo at gcc dot gnu dot org

--- Additional Comments From dnovillo at gcc dot gnu dot org  2005-02-14 
22:06 ---
(In reply to comment #7)
 (In reply to comment #5)
  The error occurs when building this with
gnat1 -Ipath-to-srcdir/gcc/ada -O2 pr19865.adb
  (I've tested a gnat1 configured for s390-ibm-linux.)
 
 And I can reproduce this with the reduced testcase on  powerpc-darwin also. 
 
 You most likely can reproduce it on i686-pc-linux-gnu when you change the
MOVE_COST to be 
 something lower.

Did you mean MOVE_RATIO?

In any case.  I can't reproduce this test case on x86 with various combinations
of --param sra-max-structure-size and --param sra-field-structure-ratio=100.  I
get clean bootstraps with Ada too.

I'll see if my ppc has Ada installed.  In the meantime, could you show me the IL
snippets where we fail and what SRA did in that function?  The test case is
still rather large.


Thanks.  Diego.



-- 


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


[Bug ada/19865] [4.0 Regression] ice / gnat bug detected.

2005-02-14 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-14 
22:10 ---
From PR 18706 when I was looking into the bootstrap bug before

I think this is the same failure as the current bootstrap problem on 
ppc-darwin.
For the bootstrap problem we have the following CONST_DECL:
  static struct gnat__strings__string_access C.828 = {.P_ARRAY=(character[(long 
int) 
PLACEHOLDER_EXPR struct gnat__strings__string_access.P_BOUNDS-LB0:(long int) 
PLACEHOLDER_EXPR struct gnat__strings__string_access.P_BOUNDS-UB0] *) , 
.P_BOUNDS={.LB0=1, .UB0=0}};

Notice how we take the address of a CONSTRUCTOR this is wrong and we should 
never do that.

-- 
   What|Removed |Added

OtherBugsDependingO||18706
  nThis||


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


[Bug ada/19865] [4.0 Regression] ice / gnat bug detected.

2005-02-14 Thread dnovillo at redhat dot com

--- Additional Comments From dnovillo at redhat dot com  2005-02-14 22:13 
---
Subject: Re:  [4.0 Regression] ice / gnat bug detected.

pinskia at gcc dot gnu dot org wrote:
 --- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-14 
 22:10 ---
 From PR 18706 when I was looking into the bootstrap bug before
 
 I think this is the same failure as the current bootstrap problem on 
 ppc-darwin.
 For the bootstrap problem we have the following CONST_DECL:
   static struct gnat__strings__string_access C.828 = 
 {.P_ARRAY=(character[(long int) 
 PLACEHOLDER_EXPR struct gnat__strings__string_access.P_BOUNDS-LB0:(long 
 int) 
 PLACEHOLDER_EXPR struct gnat__strings__string_access.P_BOUNDS-UB0] *) , 
 .P_BOUNDS={.LB0=1, .UB0=0}};
 
 Notice how we take the address of a CONSTRUCTOR this is wrong and we should 
 never do that.
 
That tells me nothing.  Show me the failure and the spot where we fail. 
  You don't seem to be sure of what the problem is.


Diego.


-- 


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


[Bug ada/19865] [4.0 Regression] ice / gnat bug detected.

2005-02-14 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-14 
22:34 ---
(In reply to comment #10)
 Subject: Re:  [4.0 Regression] ice / gnat bug detected.

SRA turns:
bb 0:
  D.570 = C.8;
into 
  D.851_33 = pr19865__no_argument + 8B;
  SR.48_32 = (struct pr19865__string_access[(long int) PLACEHOLDER_EXPR struct 
pr19865__string_list_access.P_BOUNDS-LB0:(long int) PLACEHOLDER_EXPR struct 
pr19865__string_list_access.P_BOUNDS-UB0] *) D.851_33;
  SR.49_10 = C.56;

And adds:
  static struct pr19865__string_list___XUB C.56 = {.LB0=1, .UB0=0};

Where C.8 was:
  static struct pr19865__string_list_access C.8 = {.P_ARRAY=(struct 
pr19865__string_access[(long int) 
PLACEHOLDER_EXPR struct pr19865__string_list_access.P_BOUNDS-LB0:(long int) 
PLACEHOLDER_EXPR struct pr19865__string_list_access.P_BOUNDS-UB0] *) (struct 
pr19865__string_access[1:0] *) ((void *) pr19865__no_argument + 8B), 
.P_BOUNDS={.LB0=1, 
.UB0=0}};

Is that what you want?

-- 


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


[Bug ada/19865] [4.0 Regression] ice / gnat bug detected.

2005-02-14 Thread uweigand at gcc dot gnu dot org

--- Additional Comments From uweigand at gcc dot gnu dot org  2005-02-14 
22:50 ---
(In reply to comment #5)

 The error occurs when building this with
   gnat1 -Ipath-to-srcdir/gcc/ada -O2 pr19865.adb
 (I've tested a gnat1 configured for s390-ibm-linux.)

I'm sorry, I have mixed up the include statements here.
Using this line, I do not get an ICE either.  I do get 
the ICE when using instead
  gnat1 -Ipath-to-builddir/gcc/ada/rts -O2 pr19865.adb
(after I've built the Ada runtime library, of course).

This different include apparently causes gnat1 to use a
different method of exception handling, which is enough
of a difference to cause the ICE to vanish.


As to what causes the bug, as Andrew said the SRA pass
introduces a new temporary C.56 (in my case C.58), and
like in the other test case, the red-phi pass generates
a virtual operand (a VUSE in this case) for an unrenamed
C.58 in a function call:
L4:;
  #   VUSE C.8_13;
  #   VUSE pr19865__no_argument_101;
  #   VUSE pr19865__cache_args__last_valX_102;
  #   VUSE pr19865__cache_args__tableX_103;
  #   VUSE FRAME.13_163;
  #   VUSE C.7_51;
  #   VUSE TMT.42_164;
  #   VUSE TMT.43_165;
  #   VUSE TMT.45_166;
  #   VUSE C.58;
  __gnat_rcheck_05 (pr19865.adb, 37);


This subsequently aborts.

-- 


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


[Bug ada/19865] [4.0 Regression] ice / gnat bug detected.

2005-02-09 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-09 
19:47 ---
Confirmed.

-- 
   What|Removed |Added

  BugsThisDependsOn||19853
 Status|UNCONFIRMED |NEW
 Ever Confirmed||1
   Keywords||ice-on-valid-code
   Last reconfirmed|-00-00 00:00:00 |2005-02-09 19:47:29
   date||
Summary|ice / gnat bug detected.|[4.0 Regression] ice / gnat
   ||bug detected.


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


[Bug ada/19865] [4.0 Regression] ice / gnat bug detected.

2005-02-09 Thread awreynolds at mac dot com

--- Additional Comments From awreynolds at mac dot com  2005-02-10 03:49 
---
This also occurs on powerpc-apple-darwin and has been for at least a week.

-- 


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