public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/52657] New: [4.7/4.8 regression] error on asm during GMP build
@ 2012-03-21 17:01 ebotcazou at gcc dot gnu.org
  2012-03-21 17:09 ` [Bug rtl-optimization/52657] " ubizjak at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2012-03-21 17:01 UTC (permalink / raw)
  To: gcc-bugs

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).


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-04-06 15:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-21 17:01 [Bug rtl-optimization/52657] New: [4.7/4.8 regression] error on asm during GMP build ebotcazou at gcc dot gnu.org
2012-03-21 17:09 ` [Bug rtl-optimization/52657] " ubizjak at gmail dot com
2012-03-21 17:11 ` ebotcazou at gcc dot gnu.org
2012-04-06 14:19 ` jdemeyer at cage dot ugent.be
2012-04-06 14:25 ` jdemeyer at cage dot ugent.be
2012-04-06 15:42 ` ebotcazou at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).