This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/20188] [4.0 Regression] asm and memory operands does not add a V_MAY_DEF
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Feb 2005 05:15:03 -0000
- Subject: [Bug tree-optimization/20188] [4.0 Regression] asm and memory operands does not add a V_MAY_DEF
- References: <20050224132918.20188.pluto@pld-linux.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-02-25 05:15 -------
I think the patch for PR 19633 caused this bug.
For the code below which is just a modifed version:
void link_error();
struct aa
{
char a[10];
};
void f(char *a)
{
struct aa *a1 = (struct aa *)a;
if (*a == 0)
asm("":"=m"(*a1));
if (*a ==0)
link_error ();
}
int main(void)
{
char a = 0;
f(&a);
}
We get before (20050113):
a1_2, is dereferenced, points-to anything
After:
a1_2, its value escapes, points-to anything
This is wrong, its value does not escape but is dereferenced in the asm.
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |critical
Priority|P2 |P1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20188