[Bug target/80367] internal compiler error: in print_reg, at config/i386/i386.c:16549

2017-06-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80367

Jakub Jelinek  changed:

   What|Removed |Added

 CC||lindsay at arista dot com

--- Comment #10 from Jakub Jelinek  ---
*** Bug 81100 has been marked as a duplicate of this bug. ***

[Bug target/80367] internal compiler error: in print_reg, at config/i386/i386.c:16549

2017-04-10 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80367

--- Comment #9 from Uroš Bizjak  ---
In PR 79804, I have a patch that makes ICE more informative, but the frame reg
problem elimination remains to be solved in LRA.

[Bug target/80367] internal compiler error: in print_reg, at config/i386/i386.c:16549

2017-04-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80367

Jakub Jelinek  changed:

   What|Removed |Added

 CC||uros at gcc dot gnu.org,
   ||vmakarov at gcc dot gnu.org

--- Comment #8 from Jakub Jelinek  ---
Doesn't ICE on x86_64-linux (-m64 nor -m32), but I can reproduce the ICE in a
cross to x86_64-mingw32, only -m32 is needed.  The ICE is because LRA does not
eliminate frame regs because "esp" is clobbered by the asm (normally they would
be eliminated to sp+offset).

[Bug target/80367] internal compiler error: in print_reg, at config/i386/i386.c:16549

2017-04-10 Thread jwjagersma at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80367

--- Comment #7 from jwjagersma at gmail dot com ---
Created attachment 41167
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41167=edit
test case

Here is a reduced test case that causes a similar (likely the same?) ICE on
i686-w64-mingw32. The line number in print_reg is different, but then this is a
different gcc version (6.3.0).
Interestingly, compiling with -O3 here prints a more sensible error message.

$ g++ -masm=intel -march=pentium3 -mstackrealign -O3 ice_print_reg.cpp
ice_print_reg.cpp: In function 'int main()':
ice_print_reg.cpp:19:30: error: 'asm' operand has impossible constraints
 : "esi", "esp", "cc");
  ^

$ g++ -masm=intel -march=pentium3 -mstackrealign ice_print_reg.cpp
ice_print_reg.cpp: In function 'int main()':
ice_print_reg.cpp:20:1: internal compiler error: in print_reg, at
config/i386/i386.c:16601
 }
 ^

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

ice_print_reg.cpp:20:1: internal compiler error: Aborted

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
g++.exe: internal compiler error: Aborted (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.

$ g++ -v
Using built-in specs.
COLLECT_GCC=D:\msys64\mingw32\bin\g++.exe
COLLECT_LTO_WRAPPER=D:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/6.3.0/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: ../gcc-6.3.0/configure --prefix=/mingw32
--with-local-prefix=/mingw32/local --build=i686-w64-mingw32
--host=i686-w64-mingw32 --target=i686-w64-mingw32
--with-native-system-header-dir=/mingw32/i686-w64-mingw32/include
--libexecdir=/mingw32/lib --enable-bootstrap --with-arch=i686
--with-tune=generic --enable-languages=c,lto,c++,objc,obj-c++,fortran,ada
--enable-shared --enable-static --enable-libatomic --enable-threads=posix
--enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-time=yes
--disable-libstdcxx-pch --disable-libstdcxx-debug --disable-isl-version-check
--enable-lto --enable-libgomp --disable-multilib --enable-checking=release
--disable-rpath --disable-win32-registry --disable-nls --disable-werror
--disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw32
--with-mpfr=/mingw32 --with-mpc=/mingw32 --with-isl=/mingw32
--with-pkgversion='Rev2, Built by MSYS2 project'
--with-bugurl=https://sourceforge.net/projects/msys2 --with-gnu-as
--with-gnu-ld --disable-sjlj-exceptions --with-dwarf2
Thread model: posix
gcc version 6.3.0 (Rev2, Built by MSYS2 project)

[Bug target/80367] internal compiler error: in print_reg, at config/i386/i386.c:16549

2017-04-10 Thread jwjagersma at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80367

--- Comment #6 from jwjagersma at gmail dot com ---
So "esp" is not a valid register to clobber? I thought it would only make the
compiler use ebp instead to reference stack memory operands. After all
esp-relative operands wouldn't be valid after a push/pop in inline asm.

Also, I identified the minimum compiler flags required to reproduce this issue:

$ /usr/local/djgpp/bin/i586-pc-msdosdjgpp-g++ -march=pentium3 -masm=intel
-mstackrealign -O3 vbe.ii
src/vbe.cpp: In member function 'virtual void
jw::video::vbe2::set_palette(const px32*, const px32*, std::size_t, bool)':
src/vbe.cpp:647:9: internal compiler error: in print_reg, at
config/i386/i386.c:16549

[Bug target/80367] internal compiler error: in print_reg, at config/i386/i386.c:16549

2017-04-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80367

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #5 from Jakub Jelinek  ---
Inline asm clobbering "esp" is of course invalid, what the compiler could do
with that?  The inline asm needs to have the same stack pointer on entry and
exit, for anything more magic than that you need to use separate asm functions,
you can't have it inline.
That said, if there is ICE, we should error out on that instead.  Can't
reproduce myself on x86_64-liux, because the source is too djgpp specific.

[Bug target/80367] internal compiler error: in print_reg, at config/i386/i386.c:16549

2017-04-09 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80367

Richard Biener  changed:

   What|Removed |Added

 Status|WAITING |UNCONFIRMED
 Ever confirmed|1   |0

[Bug target/80367] internal compiler error: in print_reg, at config/i386/i386.c:16549

2017-04-08 Thread jwjagersma at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80367

--- Comment #4 from jwjagersma at gmail dot com ---
I fixed my code by changing the first two asm inputs to memory operands
(should've done that anyway since I'm potentially modifying ds, so that could
have caused issues at runtime). No longer triggers an ICE now, but still I
don't think that should've happened in the first place with "rm" constraints.
I'm guessing it ran out of registers maybe? But then that should've caused an
"impossible constraints" error instead.

[Bug target/80367] internal compiler error: in print_reg, at config/i386/i386.c:16549

2017-04-08 Thread jwjagersma at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80367

--- Comment #3 from jwjagersma at gmail dot com ---
Here's an interesting observation: The ICE doesn't occur when I remove the
"esp" clobber from inline asm in vbe2::set_palette() (vbe.cpp:621,
vbe.ii:66207). But that's obviously not a solution since it produces wrong
code.

[Bug target/80367] internal compiler error: in print_reg, at config/i386/i386.c:16549

2017-04-08 Thread jwjagersma at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80367

--- Comment #2 from jwjagersma at gmail dot com ---
Created attachment 41161
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41161=edit
vbe.ii gzipped

[Bug target/80367] internal compiler error: in print_reg, at config/i386/i386.c:16549

2017-04-08 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80367

Markus Trippelsdorf  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2017-04-08
 CC||trippels at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Markus Trippelsdorf  ---
Please attach vbe.ii.