This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/52657] New: [4.7/4.8 regression] error on asm during GMP build
- From: "ebotcazou at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 21 Mar 2012 16:53:54 +0000
- Subject: [Bug rtl-optimization/52657] New: [4.7/4.8 regression] error on asm during GMP build
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52657
Bug #: 52657
Summary: [4.7/4.8 regression] error on asm during GMP build
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: rtl-optimization
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: ebotcazou@gcc.gnu.org
Target: ia64-*-linux
Created attachment 26944
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26944
Reduced testcase
GMP cannot be compiled anymore on IA-64/Linux, the error being:
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I. -I.. -D__GMP_WITHIN_GMP -I..
-DOPERATION_redc_2 -O2 -pedantic -c
redc_2.c -o redc_2.o
redc_2.c: In function '__gmpn_redc_2':
redc_2.c:87:7: error: 'asm' operand requires impossible reload
redc_2.c:87:7: error: 'asm' operand requires impossible reload
redc_2.c:87:7: error: 'asm' operand requires impossible reload
redc_2.c:87:7: error: 'asm' operand requires impossible reload
make[2]: *** [redc_2.lo] Error 1
The error is issued by this very old piece of code in reload_as_needed:
/* If this was an ASM, make sure that all the reload insns
we have generated are valid. If not, give an error
and delete them. */
if (asm_noperands (PATTERN (insn)) >= 0)
for (p = NEXT_INSN (prev); p != next; p = NEXT_INSN (p))
if (p != insn && INSN_P (p)
&& GET_CODE (PATTERN (p)) != USE
&& (recog_memoized (p) < 0
|| (extract_insn (p), ! constrain_operands (1))))
{
error_for_asm (insn,
"%<asm%> operand requires "
"impossible reload");
delete_insn (p);
}
Now it seems to overlook the case where the reload insns contain pseudos that
didn't get hard regs and thus have equivalent memory references. They will be
replaced by these memory references only _after_ reload_as_needed has run.
Commenting out the piece code generates correct assembly AFAICS and the GMP
testsuite is clean. But it seems quite astonishing that this issue has never
surfaced until now (the code was added by Richard Kenner almost 20 years ago).