------- Comment #2 from rguenth at gcc dot gnu dot org  2008-12-11 13:16 -------
The complication is that we "optimize" the code into a form that no longer
violates aliasing rules which effectively disables the warning that happens
after inlining.  IMHO we can issue alias warnings from the code that
propagates (const struct Func &) &D.1753 into *D.1793_4 (tree forwprop) if
and if only the propagation result is a VIEW_CONVERT_EXPR and its base object
does not contain a pointer dereference.  In turn further propagations of
invariant addresses into that VIEW_CONVERT_EXPR may then raise the warning
instead.

Note that this is really a middle-end issue, IMHO the FE based warnings should
be disabled if optimization is enabled as they warn on conversions and not
pointer dereferences thus giving too many false positives anyway.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu dot
                   |                            |org
           Severity|normal                      |enhancement
             Status|UNCONFIRMED                 |NEW
          Component|c++                         |middle-end
     Ever Confirmed|0                           |1
           Keywords|                            |diagnostic
   Last reconfirmed|0000-00-00 00:00:00         |2008-12-11 13:16:35
               date|                            |


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

Reply via email to