[Bug target/68661] New: __attribute__ ((no_caller_saved_registers)) trashes stack
hjl.tools at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Dec 2 18:09:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68661
Bug ID: 68661
Summary: __attribute__ ((no_caller_saved_registers)) trashes
stack
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: hjl.tools at gmail dot com
CC: vaalfreja at gmail dot com
Target Milestone: ---
[hjl@gnu-6 no-caller-saved-2]$ cat x.i
extern void bar0 (int, int) __attribute__ ((no_caller_saved_registers));
void
foo (void)
{
bar0 (1, 2);
}
[hjl@gnu-6 no-caller-saved-2]$ cat main.i
void
__attribute__ ((no_caller_saved_registers))
bar0 (int i, int j)
{
if (i != 1)
__builtin_abort ();
if (j != 2)
__builtin_abort ();
}
extern void foo (void);
int
main ()
{
foo ();
return 0;
}
[hjl@gnu-6 no-caller-saved-2]$ make
/export/build/gnu/gcc-x32/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc-x32/build-x86_64-linux/gcc/ -Og -g -m32 -S -o x.s x.i
/export/build/gnu/gcc-x32/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc-x32/build-x86_64-linux/gcc/ -Og -g -m32 -S -o main.s
main.i
/export/build/gnu/gcc-x32/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc-x32/build-x86_64-linux/gcc/ -Og -g -m32 -o x x.s main.s
./x
Makefile:12: recipe for target 'all' failed
make: *** [all] Aborted
[hjl@gnu-6 no-caller-saved-2]$
More information about the Gcc-bugs
mailing list