Bug 21242 - [4.1 Regression] wrong array copy code (ACATS c52102b c52102d)
Summary: [4.1 Regression] wrong array copy code (ACATS c52102b c52102d)
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: 4.1.0
Assignee: Not yet assigned to anyone
URL:
Keywords: alias, wrong-code
Depends on:
Blocks:
 
Reported: 2005-04-27 06:04 UTC by Laurent GUERBY
Modified: 2005-07-12 15:07 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-06-26 19:03:16


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent GUERBY 2005-04-27 06:04:31 UTC
These started failing immediately after 4.1.0 was able to bootstrap Ada
on x86_64-linux, that is to say between

LAST_UPDATED: Sun Apr  3 16:59:59 UTC 2005
LAST_UPDATED: Fri Apr 15 18:15:00 UTC 2005

Part of array copying generated code must be wrong in some way to get those test
failing.

,.,. C41203A ACATS 2.5 05-04-27 01:33:50
---- C41203A CHECK THAT THE NAME PART OF A SLICE MAY BE OF CERTAIN FORMS
                AND THAT THE APPROPRIATE SLICE IS ACCESSED (FOR STATIC
                INDICES).
   * C41203A WRONG TARGET FOR (IN) OUT PARAMETER - N1.
   * C41203A WRONG TARGET FOR (IN) OUT PARAMETER - N2.
   * C41203A WRONG TARGET FOR (IN) OUT PARAMETER - F2.
   * C41203A WRONG TARGET FOR (IN) OUT PARAMETER - N3.
   * C41203A WRONG TARGET FOR (IN) OUT PARAMETER - N4.
   * C41203A WRONG TARGET FOR (IN) OUT PARAMETER - C41203A.N1.
**** C41203A FAILED ****************************.

,.,. C41203B ACATS 2.5 05-04-27 01:33:53
---- C41203B CHECK THAT THE NAME PART OF A SLICE MAY BE OF CERTAIN FORMS
                AND THAT THE APPROPRIATE SLICE IS ACCESSED (FOR DYNAMIC 
                INDICES).
   * C41203B WRONG TARGET FOR (IN) OUT PARAMETER - N1.
   * C41203B WRONG TARGET FOR (IN) OUT PARAMETER - N2.
   * C41203B WRONG TARGET FOR (IN) OUT PARAMETER - F2.
   * C41203B WRONG TARGET FOR (IN) OUT PARAMETER - N3.
   * C41203B WRONG TARGET FOR (IN) OUT PARAMETER - N4.
   * C41203B WRONG TARGET FOR (IN) OUT PARAMETER - C41203B.N1.
**** C41203B FAILED ****************************.

,.,. C52102B ACATS 2.5 05-04-27 01:36:33
---- C52102B CHECK THAT THE ASSIGNMENT OF OVERLAPPING SOURCE AND TARGET 
                VARIABLES (INCLUDING ARRAYS AND SLICES IN VARIOUS
                COMBINATIONS) SATISFIES THE SEMANTICS OF "COPY"
                ASSIGNMENT (PART 2: DYNAMIC BOUNDS).
   * C52102B WRONG VALUES  -  I1.
   * C52102B WRONG VALUES  -  I2.
   * C52102B WRONG VALUES  -  I3.
   * C52102B WRONG VALUES  -  I4.
   * C52102B WRONG VALUES  -  B3.
   * C52102B WRONG VALUES  -  B4.
**** C52102B FAILED ****************************.

,.,. C52102D ACATS 2.5 05-04-27 01:36:37
---- C52102D CHECK THAT THE ASSIGNMENT OF OVERLAPPING SOURCE AND TARGET 
                VARIABLES (INCLUDING ARRAYS AND SLICES IN VARIOUS
                COMBINATIONS) SATISFIES THE SEMANTICS OF "COPY"
                ASSIGNMENT WHEN INITIAL ASSIGNMENT VALUES ARE DYNAMIC 
                (PART 2: DYNAMIC BOUNDS).
   * C52102D WRONG VALUES  -  I1.
   * C52102D WRONG VALUES  -  I2.
   * C52102D WRONG VALUES  -  I3.
   * C52102D WRONG VALUES  -  I4.
   * C52102D WRONG VALUES  -  B3.
   * C52102D WRONG VALUES  -  B4.
**** C52102D FAILED ****************************.

,.,. C62002A ACATS 2.5 05-04-27 01:37:15
---- C62002A CHECK THAT COMPONENTS OF ACCESS IN PARAMETERS MAY BE USED
                IN ASSIGNMENT CONTEXTS.
   * C62002A ASSIGNMENT TO COMPONENT OF ARRAY ACCESS PARAMETER FAILED.
**** C62002A FAILED ****************************.
Comment 1 Laurent GUERBY 2005-06-11 23:16:49 UTC
C52102B and C52102D still failing as of 4.1.0 Fri Jun 10 20:07:24 UTC 2005 on
x86_64-linux.

C41203A C41203B C62002A are no longer failing.
Comment 2 Laurent GUERBY 2005-06-19 11:14:07 UTC
On x86_64 and x86-linux as of LAST_UPDATED: Sun Jun 19 07:48:06 UTC 2005, still
failing. More information:

Works at -O0, -O1, fails at -O2 but
works at -O2 -fno-tree-dce
Comment 3 Laurent GUERBY 2005-06-19 11:46:56 UTC
Here is a reduced test case, works at -0O, fails at -O1 works at -O1
-fno-tree-dce. First .tNN to be different is p.adb.t24.forwprop1.

--
procedure P is
   function F return Integer is
   begin
      return 1;
   end F;
   A : array (-F .. 1) of Boolean;
begin
   A := (False,True,False);
   A(-1 .. 0)  :=  A (0 .. 1);
   if A /= (True, False, False) then
      raise Program_Error;
   end if;
end P;
Comment 4 Andrew Pinski 2005-06-19 12:33:58 UTC
Huh:
  #   VUSE <D.486_68>;
  #   VUSE <C.26_118>;
  (*a.3_27)[-1 ...]{lb: -1 sz: 1} = D.486;

Why is there no V_MUST_DEF/V_MAY_DEF in there?

This is an aliasing bug.
Comment 5 Laurent GUERBY 2005-06-19 13:25:29 UTC
Note that with the following patch on the reduced testcase (supressing the
anonymous array) it works:

-   A : array (-F .. 1) of Boolean;
+   type BA is array (Integer range <>) of Boolean;
+   A : BA (-F .. 1);
Comment 6 Andrew Pinski 2005-06-19 13:46:50 UTC
Confirmed.
Comment 7 Laurent GUERBY 2005-07-12 08:26:32 UTC
Fixed between:

LAST_UPDATED: Sat Jul  9 23:06:33 UTC 2005
LAST_UPDATED: Mon Jul 11 22:29:49 UTC 2005 

on x86-linux and x86_64-linux (don't know what patch though).
Comment 8 Andrew Pinski 2005-07-12 15:07:29 UTC
(In reply to comment #7)
> Fixed between:
> 
> LAST_UPDATED: Sat Jul  9 23:06:33 UTC 2005
> LAST_UPDATED: Mon Jul 11 22:29:49 UTC 2005 

Known to be fixed before that:
LAST_UPDATED: Sun Jul 10 00:31:54 UTC 2005

It was most likely fixed by:
2005-07-09  Diego Novillo  <dnovillo@redhat.com>

        * Makefile.in (tree-ssa-alias.o): Depend on tree-ssa-structalias.h
        * tree-cfg.c (CHECK_OP): Only test for is_gimple_val.
        * tree-dfa.c (dump_subvars_for): New.
        (debug_subvars_for): New.
        (dump_variable): Show subvariables if VAR has them.
        * tree-flow-inline.h (get_subvar_at): New.
        (overlap_subvar): Change offset and size to unsigned HOST_WIDE_INT.
        * tree-flow.h (struct ptr_info_def): Remove field pt_malloc.
        Update all users.
        (struct subvar): Change fields offset and size to unsigned
        HOST_WIDE_INT.
        (dump_subvars_for): Declare.
        (debug_subvars_for): Declare.
        (get_subvar_at): Declare.