Bug 32337 - [4.3 Regression] Error: Register number out of range 0..1
Summary: [4.3 Regression] Error: Register number out of range 0..1
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.3.0
: P1 normal
Target Milestone: 4.3.0
Assignee: Jakub Jelinek
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: assemble-failure
Depends on:
Blocks:
 
Reported: 2007-06-14 10:39 UTC by Martin Michlmayr
Modified: 2007-09-17 22:30 UTC (History)
6 users (show)

See Also:
Host:
Target: ia64-linux-gnu
Build:
Known to work: 4.2.0
Known to fail: 4.3.0
Last reconfirmed: 2007-07-07 12:45:05


Attachments
gcc43-pr32337.patch (1.16 KB, patch)
2007-07-04 16:35 UTC, Jakub Jelinek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Michlmayr 2007-06-14 10:39:37 UTC
I'm getting the following assembler error with current gcc 4.3.  This
worked with 20070604 and is probably due to the dataflow merge.


tbm@coconut0:~$ /usr/lib/gcc-snapshot/bin/gcc -c -O1 ccmalloc-callchain.c
ccmalloc-callchain.c: In function 'backtrace':
ccmalloc-callchain.c:14: warning: unsupported argument to '__builtin_return_address'
/tmp/ccMB3CzF.s: Assembler messages:
/tmp/ccMB3CzF.s:10: Warning: Second operand of .save contradicts .prologue
/tmp/ccMB3CzF.s:17: Error: Register number out of range 0..1
/tmp/ccMB3CzF.s:17: Warning: Use of 'mov' violates WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 33
/tmp/ccMB3CzF.s:17: Warning: Only the first path encountering the conflict is reported
/tmp/ccMB3CzF.s:14: Warning: This is the location of the conflicting usage
/tmp/ccMB3CzF.s:39: Error: Register number out of range 0..1
/tmp/ccMB3CzF.s:60: Error: Register number out of range 0..1


Testcase:


typedef struct __jmp_buf_tag
{
}
jmp_buf[1];
static jmp_buf backtrace_jump;
static char *
return_address (unsigned i)
{
  switch (i)
    {
    case 0:
      return (char *) __builtin_return_address (0);
    case 1:
      return (char *) __builtin_return_address (1);
    }
}
backtrace (int skip)
{
  if (_setjmp (backtrace_jump) == 0)
    {
      int i = ++skip;
      while (1)
        {
          char *pc = return_address (i++);
          if (!pc)
            break;
        }
    }
}
Comment 1 Jakub Jelinek 2007-07-04 16:35:28 UTC
Created attachment 13846 [details]
gcc43-pr32337.patch

The problem seems to be caused by the addition of the emitted_frame_related_regs
array, there are several issues I found (see this patch) and in the end
two of the 3 saved registers (RP, PFS, FP) were saved in the same register,
which caused severe havoc.
I'll try to bootstrap/regtest this on ia64-linux, so far I have only tested
that it cures the testcase.