This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/60206] IVOPT has no idea of inline asm
- From: "wmi at google dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 10 Mar 2014 21:00:12 +0000
- Subject: [Bug tree-optimization/60206] IVOPT has no idea of inline asm
- Auto-submitted: auto-generated
- References: <bug-60206-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60206
--- Comment #7 from wmi at google dot com ---
After looking into the problem more, I found IVOPT may not be the root cause.
Even if IVOPT create a memory operand using two registers, if only the
following optimizations doesn't propagate the memory operand to an asm_operand,
the problem will not happen.
So I created another smallcase 2.c for which gcc at the head of trunk will
report the same error. -fno-ivopts will not help here.
gcc -v
Target: x86_64-unknown-linux-gnu
Configured with: ../src/configure
--prefix=/usr/local/google/home/wmi/workarea/gcc-r208410/build/install
Thread model: posix
gcc version 4.9.0 20140307 (experimental) (GCC)
gcc -O2 -fno-omit-frame-pointer -m32 -S 2.c
2.c: In function âfooâ:
2.c:25:1: error: âasmâ operand has impossible constraints
__asm__ (
^
The problem will disappear after I use -fno-tree-ter and -fdisable-rtl-combine.
These two phases could propagate a memory reference using a register into an
asm operand with constraint "g", which make the registers used in asm stmt
increase.
For TER, TER of loads into input arguments is allowed. For combine,
insn_invalid_p() will only check whether an asm operand will satisfy its
constraint. However, neither TER nor combine check whether the propagation
could make the registers in asm stmt exceed available register number.