[PATCH][PowerPC] Fix BlockAddress access on ppc64

Hal Finkel hfinkel at anl.gov
Thu Oct 30 13:27:32 PDT 2014


----- Original Message -----
> From: "Ulrich Weigand" <Ulrich.Weigand at de.ibm.com>
> To: "Commit Messages and Patches for LLVM" <llvm-commits at cs.uiuc.edu>
> Cc: "Anton Blanchard" <anton at samba.org>, "Hal J. Finkel" <hfinkel at anl.gov>
> Sent: Thursday, October 30, 2014 1:13:46 PM
> Subject: [PATCH][PowerPC] Fix BlockAddress access on ppc64
> 
> 
> 
> Hello,
> 
> Anton noticed that code using the GCC extension to take the address
> of a
> block label (which is used e.g. in Linux kernel code):
> 
>   __label__ here;
> here:
>   printf ("current address: %p\n", &&here);
> 
> is miscompiled on ppc64 since it directly accesses the label value
> via @l /
> @ha, which fails if the code is linked to an address > 2GB.
> 
> The attached patch fixes this by loading such values from the TOC, as
> is
> done for any other global symbol.
> (See attached file: diff-llvm-ppc64-blockaddress)
> 
> OK for mainline?

LGTM, thanks!

 -Hal

> 
> 
> Mit freundlichen Gruessen / Best Regards
> 
> Ulrich Weigand
> 
> --
>   Dr. Ulrich Weigand | Phone: +49-7031/16-3727
>   STSM, GNU/Linux compilers and toolchain
>   IBM Deutschland Research & Development GmbH
>   Vorsitzende des Aufsichtsrats: Martina Koederitz |
>   Geschäftsführung: Dirk
> Wittkopp
>   Sitz der Gesellschaft: Böblingen | Registergericht: Amtsgericht
> Stuttgart, HRB 243294

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory




More information about the llvm-commits mailing list