[Bug tree-optimization/62006] Bad code generation with -O3 (possibly due to -ftree-partial-pre)

tkoeppe at google dot com gcc-bugzilla@gcc.gnu.org
Mon Aug 4 13:48:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62006

--- Comment #11 from Thomas Köppe <tkoeppe at google dot com> ---
Created attachment 33240
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33240&action=edit
Further fixing: Uses uintptr_ts for the difference

On Jonathan's suggestion I changed the distance computation to go through a
uintptr_t conversion.

Jonathan suggested compiling with -fno-elide-constructors, and indeed the
attached code breaks when that option is passed. As you said, the UB caused by
the distance computations of automatic objects seems to be the stumbling point.


More information about the Gcc-bugs mailing list