This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug inline-asm/14683] New: ICE when using a 'char' with 'S' or 'D' register constraints


This is x86, on Debian with gcc 3.3.3.  The attached test program reports an ICE
in reload_cse_simplify_operands, at reload1.c:8353.  Must be compiled with -O2.

This looks similar to bug 13960 (though that was PPC).

The test works with gcc-3.2, gcc-3.1 and gcc-2.95 installed on my machine.



//  * Compile with -O2 and get:
// 
// gcc-asm-bug.c: In function `test':
// gcc-asm-bug.c:14: error: unrecognizable insn:
// (insn:HI 9 18 11 0 0x40159370 (parallel [
//             (asm_operands/v ("movl %%eax, %%eax
// ") ("") 0 [
//                     (reg:QI 1 dl)
//                 ]
//                  [
//                     (asm_input:QI ("S"))
//                 ] ("gcc-asm-bug.c") 8)
//             (clobber (reg:QI 19 dirflag))
//             (clobber (reg:QI 18 fpsr))
//             (clobber (reg:QI 17 flags))
//         ]) -1 (nil)
//     (nil))
// gcc-asm-bug.c:14: internal compiler error: in reload_cse_simplify_operands,
at reload1.c:8353

static void test(void)
{
	char x; // Must be 'char' ('short' and 'int' works.)
	__asm__ volatile (
		"movl %%eax, %%eax\n"   /* this doesn't matter, just not empty. */
		: /*output:*/         
		: /*input:*/          
		"S" (x) /* Must be 'S' or 'D' ('r','a','b','c','d' all work). */ 
		);
}

There are lots of better ways to write the above asm, but this is just a
much-reduced test case...  OTOH, Simply casting x to (int) in the constraint
fixes the problem.

-- 
           Summary: ICE when using a 'char' with 'S' or 'D' register
                    constraints
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: inline-asm
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pat dot gccbugzilla at tullmann dot org
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14683


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]