This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/33330] [4.3 Regression] Wrong alias for accessing scalar through array
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Sep 2007 10:06:13 -0000
- Subject: [Bug middle-end/33330] [4.3 Regression] Wrong alias for accessing scalar through array
- References: <bug-33330-12313@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from rguenth at gcc dot gnu dot org 2007-09-07 10:06 -------
The problem is that DCE2 deletes the my_char = 121; store because aliasing
thinks the array reference doesn't alias the scalar:
;; Function sub0 (sub0)
sub0 ()
{
char[1:1] & my_char_ref;
char D.874;
char my_char;
<bb 2>:
# my_char_4 = VDEF <my_char_3(D)>
my_char = 121;
my_char_ref_1 = (char[1:1] &) &my_char;
# VUSE <NMT.30_5(D)>
D.874_2 = (*my_char_ref_1)[1]{lb: 1 sz: 1};
if (D.874_2 != 121)
goto <bb 3>;
else
goto <bb 4>;
<bb 3>:
_gfortran_abort ();
<bb 4>:
return;
}
aliasing has similar problems where references are not combined completely
in some places like
my_char_ref_1 = (char[1:1] &) &my_char;
# VUSE <NMT.30_5(D)>
D.874_2 = (*my_char_ref_1)[1]{lb: 1 sz: 1};
we might be able to work around this by properly doing the propagation.
Finally a nice small testcase though ;)
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dberlin at gcc dot gnu dot
| |org, rguenth at gcc dot gnu
| |dot org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Keywords| |alias, wrong-code
Last reconfirmed|0000-00-00 00:00:00 |2007-09-07 10:06:13
date| |
Summary|[gfortran] inlining problem |[4.3 Regression] Wrong alias
| |for accessing scalar through
| |array
Target Milestone|--- |4.3.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33330