This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Do not build libsanitizer also for powerpc*-*-linux*
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Yury Gribov <y dot gribov at samsung dot com>
- Cc: Peter Bergner <bergner at vnet dot ibm dot com>, Thomas Schwinge <thomas at codesourcery dot com>, Arseny Solokha <asolokha at gmx dot com>, dodji at redhat dot com, kcc at google dot com, dvyukov at google dot com, gcc-patches at gcc dot gnu dot org
- Date: Mon, 2 Jun 2014 09:56:37 +0200
- Subject: Re: [PATCH] Do not build libsanitizer also for powerpc*-*-linux*
- Authentication-results: sourceware.org; auth=none
- References: <1401100995 dot 27542 dot ezmlm at gcc dot gnu dot org> <53831D22 dot 30108 at gmx dot com> <87egzeqrrt dot fsf at kepler dot schwinge dot homeip dot net> <1401390478 dot 7849 dot 39 dot camel at otta> <1401455362 dot 7849 dot 42 dot camel at otta> <20140530134933 dot GZ10386 at tucnak dot redhat dot com> <538C1813 dot 8070602 at samsung dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Jun 02, 2014 at 10:22:11AM +0400, Yury Gribov wrote:
> Looks like now function does not return anything for ARM case? I'd
> say we should replace this pc = ... with return like all other
> cases, the code is just asking for trouble.
But it should be
return (pc & ~(uptr)1) - 1;
right?
> --- libsanitizer/sanitizer_common/sanitizer_stacktrace.cc (revision 209878)
> +++ libsanitizer/sanitizer_common/sanitizer_stacktrace.cc (revision 209879)
> @@ -18,11 +18,13 @@
> namespace __sanitizer {
>
> uptr StackTrace::GetPreviousInstructionPc(uptr pc) {
> -#ifdef __arm__
> +#if defined(__arm__)
> // Cancel Thumb bit.
> pc = pc & (~1);
> -#endif
> -#if defined(__sparc__)
> +#elif defined(__powerpc__) || defined(__powerpc64__)
> + // PCs are always 4 byte aligned.
> + return pc - 4;
> +#elif defined(__sparc__)
> return pc - 8;
> #else
> return pc - 1;
Jakub