michael@0: dnl This Source Code Form is subject to the terms of the Mozilla Public michael@0: dnl License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: dnl file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: dnl Check if the compiler is gcc and has PR49911. If so michael@0: dnl disable vrp. michael@0: michael@0: AC_DEFUN([MOZ_GCC_PR49911], michael@0: [ michael@0: if test "$GNU_CC"; then michael@0: michael@0: AC_MSG_CHECKING(for gcc PR49911) michael@0: ac_have_gcc_pr49911="no" michael@0: AC_LANG_SAVE michael@0: AC_LANG_CPLUSPLUS michael@0: michael@0: _SAVE_CXXFLAGS=$CXXFLAGS michael@0: CXXFLAGS="-O2" michael@0: AC_TRY_RUN([ michael@0: extern "C" void abort(void); michael@0: typedef enum { michael@0: eax, ecx, edx, ebx, esp, ebp, michael@0: esi, edi } michael@0: RegisterID; michael@0: union StateRemat { michael@0: RegisterID reg_; michael@0: int offset_; michael@0: }; michael@0: static StateRemat FromRegister(RegisterID reg) { michael@0: StateRemat sr; michael@0: sr.reg_ = reg; michael@0: return sr; michael@0: } michael@0: static StateRemat FromAddress3(int address) { michael@0: StateRemat sr; michael@0: sr.offset_ = address; michael@0: if (address < 46 && address >= 0) { michael@0: abort(); michael@0: } michael@0: return sr; michael@0: } michael@0: struct FrameState { michael@0: StateRemat dataRematInfo2(bool y, int z) { michael@0: if (y) return FromRegister(RegisterID(1)); michael@0: return FromAddress3(z); michael@0: } michael@0: }; michael@0: FrameState frame; michael@0: StateRemat x; michael@0: __attribute__((noinline)) void jsop_setelem(bool y, int z) { michael@0: x = frame.dataRematInfo2(y, z); michael@0: } michael@0: int main(void) { michael@0: jsop_setelem(0, 47); michael@0: } michael@0: ], true, michael@0: ac_have_gcc_pr49911="yes", michael@0: true) michael@0: CXXFLAGS="$_SAVE_CXXFLAGS" michael@0: michael@0: AC_LANG_RESTORE michael@0: michael@0: if test "$ac_have_gcc_pr49911" = "yes"; then michael@0: AC_MSG_RESULT(yes) michael@0: CFLAGS="$CFLAGS -fno-tree-vrp" michael@0: CXXFLAGS="$CXXFLAGS -fno-tree-vrp" michael@0: else michael@0: AC_MSG_RESULT(no) michael@0: fi michael@0: fi michael@0: ])