Roger Sayle - [Alpha PATCH] Fix gcc.c-torture/compile/20061005-1.c ICE (original) (raw)

This is the mail archive of the gcc-patches@gcc.gnu.orgmailing 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]

The following patch to the alpha backend resolves twelve unexpected failures in the gcc testsuite on alphaev67-dec-osf5.1. The cause of the failures is the ICE:

testsuite/gcc.c-torture/compile/20061005-1.c: In function 'testc2': testsuite/gcc.c-torture/compile/20061005-1.c:23: error: unrecognizable insn: (insn 11 10 12 3 (set (reg:DI 74) (ashift:DI (zero_extend:DI (const_int -3 [0xfffffffffffffffd])) (ashift:DI (reg/f:DI 69) (const_int 3 [0x3])))) -1 (nil) (nil)) testsuite/gcc.c-torture/compile/20061005-1.c:23: internal compiler error: in extract_insn, at recog.c:2108

This pattern is the result of the initial RTL expansion of the __sync_val_compare_and_swap built-in, which places the constant -3 in the above pattern, whose constraints only allow a register in that context.

I'm not familiar with the synchronization primitives of the alpha, there may be a better insn for handling immediate constants, but the patch below resolves these failures by tweaking alpha.c's emit_insxl to call force_reg on the operand that needs to be in a register for these patterns.

The following patch has been tested on alphaev67-dec-osf5.1 with a full "make bootstrap", all default languages except Java, and regression tested with a top-level "make -k check" with no new failures.

Ok for mainline?

2007-02-08 Roger Sayle roger@eyesopen.com

    * config/alpha/alpha.c (emit_insxl): Force the first operand of
    the insbl or inswl pattern into a register.

Roger

Attachment:patcha.txt
Description: Text document


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