Commit 794511d2 by Eric Botcazou

alias.h (record_alias_subset): Declare.

	* alias.h (record_alias_subset): Declare.
	* alias.c (record_alias_subset): Make global.
ada/
	* gcc-interface/decl.c (enum alias_set_op): New enumeration.
	(copy_alias_set): Rename into...
	(relate_alias_sets): ...this.  Add third parameter OP.  Retrieve the
	underlying array of unconstrained arrays for the new type as well.
	If the old and new alias sets don't conflict, make one a subset of
	the other as per the OP parameter.
	(gnat_to_gnu_entity): Adjust calls to copy_alias_set.
	<E_Record_Type>: Do not copy the alias set for derived types.
	For all types, make the alias set of derived types a superset of
	that of their parent type.
	(make_aligning_type): Adjust calls to copy_alias_set.
	(make_packable_type): Likewise.
	* gcc-interface/trans.c (gnat_to_gnu)<N_Validate_Unchecked_Conversion>:
	Check for alias set conflict instead of strict equality to issue the
	warning.

From-SVN: r144084
parent 493e377c
2009-02-10 Eric Botcazou <ebotcazou@adacore.com>
* alias.h (record_alias_subset): Declare.
* alias.c (record_alias_subset): Make global.
2009-02-10 Nick Clifton <nickc@redhat.com>
* tree-parloops.c: Change license to GPLv3.
......
2009-02-10 Olivier Hainque <hainque@adacore.com>
Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (enum alias_set_op): New enumeration.
(copy_alias_set): Rename into...
(relate_alias_sets): ...this. Add third parameter OP. Retrieve the
underlying array of unconstrained arrays for the new type as well.
If the old and new alias sets don't conflict, make one a subset of
the other as per the OP parameter.
(gnat_to_gnu_entity): Adjust calls to copy_alias_set.
<E_Record_Type>: Do not copy the alias set for derived types.
For all types, make the alias set of derived types a superset of
that of their parent type.
(make_aligning_type): Adjust calls to copy_alias_set.
(make_packable_type): Likewise.
* gcc-interface/trans.c (gnat_to_gnu)<N_Validate_Unchecked_Conversion>:
Check for alias set conflict instead of strict equality to issue the
warning.
2009-02-09 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_String_Literal_Subtype>:
......@@ -4940,8 +4940,9 @@ gnat_to_gnu (Node_Id gnat_node)
!= TYPE_DUMMY_P (gnu_target_desig_type))
|| (TYPE_DUMMY_P (gnu_source_desig_type)
&& gnu_source_desig_type != gnu_target_desig_type)
|| (get_alias_set (gnu_source_desig_type)
!= get_alias_set (gnu_target_desig_type))))
|| !alias_sets_conflict_p
(get_alias_set (gnu_source_desig_type),
get_alias_set (gnu_target_desig_type))))
{
post_error_ne
("?possible aliasing problem for type&",
......@@ -4973,8 +4974,9 @@ gnat_to_gnu (Node_Id gnat_node)
!= TYPE_DUMMY_P (gnu_target_array_type))
|| (TYPE_DUMMY_P (gnu_source_array_type)
&& gnu_source_array_type != gnu_target_array_type)
|| (get_alias_set (gnu_source_array_type)
!= get_alias_set (gnu_target_array_type))))
|| !alias_sets_conflict_p
(get_alias_set (gnu_source_array_type),
get_alias_set (gnu_target_array_type))))
{
post_error_ne
("?possible aliasing problem for type&",
......
......@@ -167,7 +167,6 @@ static rtx adjust_offset_for_component_ref (tree, rtx);
static int write_dependence_p (const_rtx, const_rtx, int);
static void memory_modified_1 (rtx, const_rtx, void *);
static void record_alias_subset (alias_set_type, alias_set_type);
/* Set up all info needed to perform alias analysis on memory references. */
......@@ -735,7 +734,7 @@ new_alias_set (void)
It is illegal for SUPERSET to be zero; everything is implicitly a
subset of alias set zero. */
static void
void
record_alias_subset (alias_set_type superset, alias_set_type subset)
{
alias_set_entry superset_entry;
......
......@@ -36,6 +36,7 @@ extern alias_set_type get_varargs_alias_set (void);
extern alias_set_type get_frame_alias_set (void);
extern bool component_uses_parent_alias_set (const_tree);
extern bool alias_set_subset_of (alias_set_type, alias_set_type);
extern void record_alias_subset (alias_set_type, alias_set_type);
extern void record_component_aliases (tree);
extern int alias_sets_conflict_p (alias_set_type, alias_set_type);
extern int alias_sets_must_conflict_p (alias_set_type, alias_set_type);
......
2009-02-10 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/aliasing3.adb: New test.
* gnat.dg/aliasing3_pkg.ad[sb]: New helper.
2009-02-10 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/34397
......
-- { dg-do run }
-- { dg-options "-O2 -gnatn" }
with Aliasing3_Pkg; use Aliasing3_Pkg;
procedure Aliasing3 is
begin
Pointer.A(1) := 5;
Test (Block.A);
end;
package body Aliasing3_Pkg is
procedure Test (A : Arr) is
begin
if A(1) /= 5 then
raise Program_Error;
end if;
end;
end Aliasing3_Pkg;
package Aliasing3_Pkg is
type Arr is array (1..3) of Integer;
procedure Test (A : Arr);
pragma Inline (Test);
type My_Arr is new Arr;
type Rec is record
A : My_Arr;
end record;
type Ptr is access all Rec;
Block : aliased Rec;
Pointer : Ptr := Block'Access;
end Aliasing3_Pkg;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment