------- Comment #1 from abel at gcc dot gnu dot org  2009-08-12 07:40 -------
Confirmed on trunk.  As we discussed on IRC, the below obvious patch makes
nonoverlapping_component_refs_p punt when !flag_strict_aliasing and thus fixes
the testcase.  I have looked at the other rtl alias oracle functions used in
*_dependence, and it seems that they are safe.  E.g.,
fixed_scalar_and_varying_struct_p already punts when fno-strict-aliasing, and
the other stuff mainly deals with base+offset disambiguations.

(Interestingly enough, I couldn't make a test case in which incorrect PRE or
CSE (not DSE) would happen, as these probably don't look through stores.  On
some platforms though, the scheduler will likely fail.)

I will post the patch after bootstrap+regtest. 


Index: alias.c
===================================================================
*** alias.c     (revision 150675)
--- alias.c     (working copy)
*************** nonoverlapping_component_refs_p (const_t
*** 1980,1985 ****
--- 1980,1988 ----
  {
    const_tree fieldx, fieldy, typex, typey, orig_y;

+   if (!flag_strict_aliasing)
+     return false;
+
    do
      {
        /* The comparison has to be done at a common type, since we don't


-- 

abel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |abel at gcc dot gnu dot org
         AssignedTo|unassigned at gcc dot gnu   |abel at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-08-12 07:40:55
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41033

Reply via email to