* Re: Error: macro requires $at register while noat in effect [not found] <199709111242.PAA23522@blinky.bfr.co.il> @ 1997-09-11 18:38 ` Richard Henderson 0 siblings, 0 replies; 4+ messages in thread From: Richard Henderson @ 1997-09-11 18:38 UTC (permalink / raw) > My code is straight C. It doesn't have any assembler in it. Sure enough. Here's a patch. r~ --- config/alpha/alpha.c.orig Thu Sep 11 11:26:12 1997 +++ config/alpha/alpha.c Thu Sep 11 11:28:46 1997 @@ -1553,7 +1553,7 @@ output_prolog (file, size) int int_reg_save_area_size = 0; rtx insn; unsigned reg_mask = 0; - int i; + int i, sa_reg; /* There seems to be no good hook to reset per-function flags. Do so here. */ @@ -1708,11 +1708,29 @@ output_prolog (file, size) frame_size, current_function_pretend_args_size); } + /* Cope with very large offsets to the register save area. */ + sa_reg = 30; + if (reg_offset + sa_size > 0x8000) + { + int low = ((reg_offset & 0xffff) ^ 0x8000) - 0x8000; + if (low + sa_size <= 0x8000) + { + add_long_const (file, reg_offset - low, 30, 24, 24); + reg_offset = low; + } + else + { + add_long_const (file, reg_offset, 30, 24, 24); + reg_offset = 0; + } + sa_reg = 24; + } + /* Save register 26 if any other register needs to be saved. */ if (sa_size != 0) { reg_mask |= 1 << 26; - fprintf (file, "\tstq $26,%d($30)\n", reg_offset); + fprintf (file, "\tstq $26,%d($%d)\n", reg_offset, sa_reg); reg_offset += 8; int_reg_save_area_size += 8; } @@ -1722,7 +1740,7 @@ output_prolog (file, size) if (! fixed_regs[i] && ! call_used_regs[i] && regs_ever_live[i] && i != 26) { reg_mask |= 1 << i; - fprintf (file, "\tstq $%d,%d($30)\n", i, reg_offset); + fprintf (file, "\tstq $%d,%d($%d)\n", i, reg_offset, sa_reg); reg_offset += 8; int_reg_save_area_size += 8; } @@ -1742,7 +1760,7 @@ output_prolog (file, size) && regs_ever_live[i + 32]) { reg_mask |= 1 << i; - fprintf (file, "\tstt $f%d,%d($30)\n", i, reg_offset); + fprintf (file, "\tstt $f%d,%d($%d)\n", i, reg_offset, sa_reg); reg_offset += 8; } @@ -1790,6 +1808,7 @@ output_epilog (file, size) if (insn == 0 || GET_CODE (insn) != BARRIER) { int fp_offset = 0; + int sa_reg; final_prescan_insn (NULL_RTX, NULL_RTX, 0); @@ -1797,11 +1816,29 @@ output_epilog (file, size) if (frame_pointer_needed) fprintf (file, "\tbis $15,$15,$30\n"); + /* Cope with large offsets to the register save area. */ + sa_reg = 30; + if (reg_offset + sa_size > 0x8000) + { + int low = ((reg_offset & 0xffff) ^ 0x8000) - 0x8000; + if (low + sa_size <= 0x8000) + { + add_long_const (file, reg_offset - low, 30, 24, 24); + reg_offset = low; + } + else + { + add_long_const (file, reg_offset, 30, 24, 24); + reg_offset = 0; + } + sa_reg = 24; + } + /* Restore all the registers, starting with the return address register. */ if (sa_size != 0) { - fprintf (file, "\tldq $26,%d($30)\n", reg_offset); + fprintf (file, "\tldq $26,%d($%d)\n", reg_offset, sa_reg); reg_offset += 8; } @@ -1816,7 +1853,7 @@ output_epilog (file, size) if (i == HARD_FRAME_POINTER_REGNUM && frame_pointer_needed) fp_offset = reg_offset; else - fprintf (file, "\tldq $%d,%d($30)\n", i, reg_offset); + fprintf (file, "\tldq $%d,%d($%d)\n", i, reg_offset, sa_reg); reg_offset += 8; } @@ -1824,7 +1861,7 @@ output_epilog (file, size) if (! fixed_regs[i + 32] && ! call_used_regs[i + 32] && regs_ever_live[i + 32]) { - fprintf (file, "\tldt $f%d,%d($30)\n", i, reg_offset); + fprintf (file, "\tldt $f%d,%d($%d)\n", i, reg_offset, sa_reg); reg_offset += 8; } @@ -1839,7 +1876,7 @@ output_epilog (file, size) now. This must be done in one instruction immediately before the SP update. */ if (restore_fp && fp_offset) - fprintf (file, "\tldq $15,%d($30)\n", fp_offset); + fprintf (file, "\tldq $15,%d($%d)\n", fp_offset, sa_reg); /* Now update the stack pointer, if needed. Only one instruction must modify the stack pointer. It must be the last instruction in the -- To unsubscribe: send e-mail to axp-list-request@redhat.com with 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <199709110542.WAA05294@dot.cygnus.com>]
* Re: Error: macro requires $at register while noat in effect [not found] <199709110542.WAA05294@dot.cygnus.com> @ 1997-09-11 12:42 ` Harvey J. Stein 0 siblings, 0 replies; 4+ messages in thread From: Harvey J. Stein @ 1997-09-11 12:42 UTC (permalink / raw) Richard Henderson writes: > > I'm trying to port a project from linux/ix86 to linux/axp, and on two > > of the C source files, I'm seeing the error message: > > > > Error: macro requires $at register while noat in effect > > > > when trying to compile. > > It means that someone used an assembler macro that requires a temporary > register ($at). Gcc has no wish to give up control of a register to > macros it does not use and so issues ".set noat" at the top of the file. > > The only way you could be seeing this is if the program contains inline > assembly and someone is using such a macro. My code is straight C. It doesn't have any assembler in it. -- Harvey J. Stein Berger Financial Research hjstein@bfr.co.il -- To unsubscribe: send e-mail to axp-list-request@redhat.com with 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <199709102254.BAA08044@blinky.bfr.co.il>]
* Re: Error: macro requires $at register while noat in effect [not found] <199709102254.BAA08044@blinky.bfr.co.il> @ 1997-09-11 5:42 ` Richard Henderson 0 siblings, 0 replies; 4+ messages in thread From: Richard Henderson @ 1997-09-11 5:42 UTC (permalink / raw) > I'm trying to port a project from linux/ix86 to linux/axp, and on two > of the C source files, I'm seeing the error message: > > Error: macro requires $at register while noat in effect > > when trying to compile. It means that someone used an assembler macro that requires a temporary register ($at). Gcc has no wish to give up control of a register to macros it does not use and so issues ".set noat" at the top of the file. The only way you could be seeing this is if the program contains inline assembly and someone is using such a macro. r~ -- To unsubscribe: send e-mail to axp-list-request@redhat.com with 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com ^ permalink raw reply [flat|nested] 4+ messages in thread
* Error: macro requires $at register while noat in effect @ 1997-09-10 22:54 Harvey J. Stein 0 siblings, 0 replies; 4+ messages in thread From: Harvey J. Stein @ 1997-09-10 22:54 UTC (permalink / raw) I'm trying to port a project from linux/ix86 to linux/axp, and on two of the C source files, I'm seeing the error message: Error: macro requires $at register while noat in effect when trying to compile. Here's an example: gcc -g -I /home/hjstein/pascal/cmo_pascal/../p2c-1.21current/home -c foo.c foo.c: In function `cmo_fast_collateral': foo.c:1123: warning: cast to pointer from integer of different size foo.c: In function `cmo_evolve_collat_fast': foo.c:1438: warning: passing arg 2 of `copy_cmo_element' makes integer from pointer without a cast /tmp/cca04057.s: Assembler messages: /tmp/cca04057.s:9099: Error: macro requires $at register while noat in effect /tmp/cca04057.s:9100: Error: macro requires $at register while noat in effect /tmp/cca04057.s:9101: Error: macro requires $at register while noat in effect /tmp/cca04057.s:9102: Error: macro requires $at register while noat in effect /tmp/cca04057.s:9103: Error: macro requires $at register while noat in effect /tmp/cca04057.s:9104: Error: macro requires $at register while noat in effect /tmp/cca04057.s:9105: Error: macro requires $at register while noat in effect /tmp/cca04057.s:9106: Error: macro requires $at register while noat in effect /tmp/cca04057.s:12010: Error: macro requires $at register while noat in effect /tmp/cca04057.s:12011: Error: macro requires $at register while noat in effect The other 100 files seem to compile ok. I saw a message from about a year ago on axp-linux where someone asked for the assembler output which was producing messages like these and said he'd look into it, but I dind't find any followup messages. Has anyone seen this before? What does it mean? How do I fix/work around it? Thanks, -- Harvey J. Stein Berger Financial Research hjstein@bfr.co.il -- To unsubscribe: send e-mail to axp-list-request@redhat.com with 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~1997-09-11 18:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <199709111242.PAA23522@blinky.bfr.co.il>
1997-09-11 18:38 ` Error: macro requires $at register while noat in effect Richard Henderson
[not found] <199709110542.WAA05294@dot.cygnus.com>
1997-09-11 12:42 ` Harvey J. Stein
[not found] <199709102254.BAA08044@blinky.bfr.co.il>
1997-09-11 5:42 ` Richard Henderson
1997-09-10 22:54 Harvey J. Stein
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox