On Tue, 26 Jul 2011, Georg-Johann Lay wrote: > I once ran into trouble because there seems to be no clear > separation between undefinedness in C and undefinedness in RTL > > Starting thread from here, > http://gcc.gnu.org/ml/gcc-help/2010-06/msg00191.html > > the treads comes to this > http://gcc.gnu.org/ml/gcc-help/2010-06/msg00198.html > > which includes a snip that shows that some RTL passes > optimize on assumptions of undefinedness of C. > I.e. undefinedness is propagated from C trough SSA until RTL.
That seems like a bug. Flags such flag_wrapv relate to semantics of C and GIMPLE, not to RTL; (abs) RTL should always be wrapping. (For shifts, SHIFT_COUNT_TRUNCATED describes the semantics of RTL. For clz and ctz, CLZ_DEFINED_VALUE_AT_ZERO and CTZ_DEFINED_VALUE_AT_ZERO describe the semantics. All these target macros only describe RTL, not C source or GIMPLE. PR 30484 discusses how one might fix INT_MIN / -1 and INT_MIN % -1 for -fwrapv.) -- Joseph S. Myers jos...@codesourcery.com