This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/82221] internal compiler error: in print_reg, at config/i386/i386.c:17656
- From: "hjl.tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 15 Sep 2017 17:09:17 +0000
- Subject: [Bug target/82221] internal compiler error: in print_reg, at config/i386/i386.c:17656
- Auto-submitted: auto-generated
- References: <bug-82221-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82221
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hjl.tools at gmail dot com,
| |ubizjak at gmail dot com
--- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> ---
The problem is
static inline
__attribute__((always_inline))
unsigned long long paravirt_read_pmc(int counter)
{
return ({ u64 __ret; unsigned long __eax = __eax, __edx = __edx;
{ asm volatile("# foo" : "=a" (__eax), "=d" (__edx)
: "a" ((unsigned long)(counter))
: "memory", "cc", "sp" );
^^^^^^^ with
-mpreferred-stack-boundary=2
__ret = (u64)((((u64)__edx) << 32) | __eax);
}
__ret;
});
}
On one hand, GCC needs BP register to align the stack for
static inline
__attribute__((always_inline,unused))
__attribute__((no_instrument_function))
long long bar(atomic64_t *v, long long o, long long n)
{
return ((__typeof__(*(&v->counter)))__bar((&v->counter), (unsigned long
long)(o
), (unsigned long long)(n)));
}
On the other hand, GCC needs BP register to preserve SP since asm statement
in paravirt_read_pmc clobbers SP. I think it is a user error. But GCC should
provide a better error message.