This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Ada/4.1] Fix PR ada/18819 on s390x
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Ulrich Weigand <uweigand at de dot ibm dot com>
- Date: Tue, 24 Jan 2006 23:13:21 +0100
- Subject: [Ada/4.1] Fix PR ada/18819 on s390x
Ulrich reported the following failure on s390x for 4.1:
FAIL: cdd2a01
FAIL: cdd2a02
The analysis (RTL level by Ulrich, tree level by me) is in the audit trail of
the PR. The problem boils down to a violation of type-based aliasing because
of a questionable construct generated by the front-end. The fix has been in
the front-end for ages but inhibited up to now.
Bootstrapped/regtested on x86_64-suse-linux. Ulrich, could you confirm that
it eliminates the problem on your favorite 64-bit platform? TIA.
OK for 4.1 branch? [I'm hurrying this because of the upcoming release.]
2006-01-24 Eric Botcazou <ebotcazou@adacore.com>
PR ada/18819
* exp_util.adb (Remove_Side_Effects): Lift enclosing type conversion nodes
for elementary types in all cases.
--
Eric Botcazou
Index: exp_util.adb
===================================================================
--- exp_util.adb (revision 109721)
+++ exp_util.adb (working copy)
@@ -4077,14 +4077,7 @@ package body Exp_Util is
-- is a view conversion to a smaller object, where gigi can end up
-- creating its own temporary of the wrong size.
- -- ??? this transformation is inhibited for elementary types that are
- -- not involved in a change of representation because it causes
- -- regressions that are not fully understood yet.
-
- elsif Nkind (Exp) = N_Type_Conversion
- and then (not Is_Elementary_Type (Underlying_Type (Exp_Type))
- or else Nkind (Parent (Exp)) = N_Assignment_Statement)
- then
+ elsif Nkind (Exp) = N_Type_Conversion then
Remove_Side_Effects (Expression (Exp), Name_Req, Variable_Ref);
Scope_Suppress := Svg_Suppress;
return;