Commit afa8f0fb by Andrew Pinski

re PR rtl-optimization/28812 (RTL aliasing vs may_alias and structs)

2006-11-11  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR rtl-opt/28812
        * alias.c (fixed_scalar_and_varying_struct_p): Don't return a
        non null value if the struct memory access is in the 0th
        aliasing set.

2006-11-11  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR rtl-opt/28812
        * gcc.c-torture/execute/mayalias-3.c: New test.

From-SVN: r118716
parent a607b34f
2006-11-11 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR rtl-opt/28812
* alias.c (fixed_scalar_and_varying_struct_p): Don't return a
non null value if the struct memory access is in the 0th
aliasing set.
2006-11-12 Jie Zhang <jie.zhang@analog.com> 2006-11-12 Jie Zhang <jie.zhang@analog.com>
Revert Revert
......
...@@ -1857,13 +1857,15 @@ fixed_scalar_and_varying_struct_p (rtx mem1, rtx mem2, rtx mem1_addr, ...@@ -1857,13 +1857,15 @@ fixed_scalar_and_varying_struct_p (rtx mem1, rtx mem2, rtx mem1_addr,
if (! flag_strict_aliasing) if (! flag_strict_aliasing)
return NULL_RTX; return NULL_RTX;
if (MEM_SCALAR_P (mem1) && MEM_IN_STRUCT_P (mem2) if (MEM_ALIAS_SET (mem2)
&& MEM_SCALAR_P (mem1) && MEM_IN_STRUCT_P (mem2)
&& !varies_p (mem1_addr, 1) && varies_p (mem2_addr, 1)) && !varies_p (mem1_addr, 1) && varies_p (mem2_addr, 1))
/* MEM1 is a scalar at a fixed address; MEM2 is a struct at a /* MEM1 is a scalar at a fixed address; MEM2 is a struct at a
varying address. */ varying address. */
return mem1; return mem1;
if (MEM_IN_STRUCT_P (mem1) && MEM_SCALAR_P (mem2) if (MEM_ALIAS_SET (mem1)
&& MEM_IN_STRUCT_P (mem1) && MEM_SCALAR_P (mem2)
&& varies_p (mem1_addr, 1) && !varies_p (mem2_addr, 1)) && varies_p (mem1_addr, 1) && !varies_p (mem2_addr, 1))
/* MEM2 is a scalar at a fixed address; MEM1 is a struct at a /* MEM2 is a scalar at a fixed address; MEM1 is a struct at a
varying address. */ varying address. */
......
2006-11-11 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR rtl-opt/28812
* gcc.c-torture/execute/mayalias-3.c: New test.
2006-11-11 Richard Sandiford <richard@codesourcery.com> 2006-11-11 Richard Sandiford <richard@codesourcery.com>
PR middle-end/27528 PR middle-end/27528
...@@ -12,8 +17,8 @@ ...@@ -12,8 +17,8 @@
2006-11-10 Paul Thomas <pault@gcc.gnu.org> 2006-11-10 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29758 PR fortran/29758
* gfortran.dg/reshape_source_size_1.f90: New test. * gfortran.dg/reshape_source_size_1.f90: New test.
2006-11-10 Paul Thomas <pault@gcc.gnu.org> 2006-11-10 Paul Thomas <pault@gcc.gnu.org>
...@@ -23,7 +28,7 @@ ...@@ -23,7 +28,7 @@
2006-11-10 Uros Bizjak <ubizjak@gmail.com> 2006-11-10 Uros Bizjak <ubizjak@gmail.com>
PR target/29777 PR target/29777
* lib/target-supports.exp (vect_widen_mult_hi_to_si): Add i?86-*-* * lib/target-supports.exp (vect_widen_mult_hi_to_si): Add i?86-*-*
and x86_64-*-* targets. and x86_64-*-* targets.
2006-11-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2006-11-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
struct S { short x; };
typedef struct S __attribute__((__may_alias__)) test;
test *p;
int g(int *a)
{
p = (test*)a;
}
int f()
{
int a;
g(&a);
a = 10;
test s={1};
*p=s;
return a;
}
int main() {
if (f() == 10)
__builtin_abort();
return 0;
}
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