First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 15482
Product:  
Component:  
Status: NEW
Resolution:
Assigned To: Not yet assigned to anyone <unassigned@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: Paul Brook <pbrook@gcc.gnu.org>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
test.c powerpc testcase text/plain 2004-05-16 22:56 195 bytes Edit
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 15482 depends on: Show dependency tree
Show dependency graph
Bug 15482 blocks:

Additional Comments:





Mark bug as waiting for feedback
Mark bug as suspended




View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: 2005-12-24 20:44 Opened: 2004-05-16 22:53
Compiling the following code with arm-none-elf-gcc -O2 -fno-apcs-frame gives  
"can't find a register in class `GENERAL_REGS' while reloading `asm'"  
  
void bar(int, int, int, int);  
int x;  
int foo (int a1, int a2, int a3)  
{  
  int b;  
  __asm volatile("mov %0, #0":"=r" (b)::  
  /* Clobber everything except the first 3 argument registers.  */  
      , "r3", "r4", "r5", "r6", "r7"  
      , "r8", "r9", "sl","ip", "lr", "fp");  
  x = b;  
  bar(a1, a2, a3);  
}  
  
Similar examples can probably be constructed on other targets that pass  
function args in registers.

------- Comment #1 From Paul Brook 2004-05-16 22:56 -------
Created an attachment (id=6314) [edit]
powerpc testcase

------- Comment #2 From Andrew Pinski 2004-05-16 23:06 -------
Confirmed, it should store the arguments on the stack but for some reason they
are not which causes 
the ICE.

------- Comment #3 From Paul Brook 2004-05-16 23:15 -------
Similar failure mode to this: 
http://gcc.gnu.org/ml/gcc-patches/2004-04/msg00427.html 

------- Comment #4 From Dominique d'Humieres 2008-01-11 09:35 -------
I see the same problem at any level of optimization I have tried on
i686-apple-darwin9 for the test case gcc.target/i386/asm-3.c:

[ibook-dhum] f90/bug% /opt/gcc/gcc4.3w/bin/gcc -O0
/opt/gcc/_gcc_clean/gcc/testsuite/gcc.target/i386/asm-3.c
/opt/gcc/_gcc_clean/gcc/testsuite/gcc.target/i386/asm-3.c: In function 'main':
/opt/gcc/_gcc_clean/gcc/testsuite/gcc.target/i386/asm-3.c:19: error: can't find
a register in class 'GENERAL_REGS' while reloading 'asm'
/opt/gcc/_gcc_clean/gcc/testsuite/gcc.target/i386/asm-3.c:19: error: 'asm'
operand has impossible constraints

The failure was present for rev. 130218 (see
http://gcc.gnu.org/ml/gcc-testresults/2007-11/msg00861.html).

------- Comment #5 From Uros Bizjak 2008-02-12 21:11 -------
(In reply to comment #4)
> I see the same problem at any level of optimization I have tried on
> i686-apple-darwin9 for the test case gcc.target/i386/asm-3.c:
> 
> [ibook-dhum] f90/bug% /opt/gcc/gcc4.3w/bin/gcc -O0
> /opt/gcc/_gcc_clean/gcc/testsuite/gcc.target/i386/asm-3.c
> /opt/gcc/_gcc_clean/gcc/testsuite/gcc.target/i386/asm-3.c: In function 'main':
> /opt/gcc/_gcc_clean/gcc/testsuite/gcc.target/i386/asm-3.c:19: error: can't find
> a register in class 'GENERAL_REGS' while reloading 'asm'
> /opt/gcc/_gcc_clean/gcc/testsuite/gcc.target/i386/asm-3.c:19: error: 'asm'
> operand has impossible constraints
> 
> The failure was present for rev. 130218 (see
> http://gcc.gnu.org/ml/gcc-testresults/2007-11/msg00861.html).
> 

This test can't run on 32bit x86 PIC targets due to register starvation.
dg-skip-if directive was fixed to include all PIC targets with !nonpic target
selector.

First Last Prev Next    No search results available      Search page      Enter new bug