r185584 - Check LongDoubleFormat instead of just Width as this is PowerPC specific.
David Blaikie
dblaikie at gmail.com
Thu Jul 4 10:34:55 PDT 2013
On Thu, Jul 4, 2013 at 9:54 AM, Roman Divacky <rdivacky at freebsd.org> wrote:
> On Thu, Jul 04, 2013 at 09:50:55AM -0700, David Blaikie wrote:
>> On Wed, Jul 3, 2013 at 2:08 PM, Roman Divacky <rdivacky at freebsd.org> wrote:
>> > Author: rdivacky
>> > Date: Wed Jul 3 16:08:41 2013
>> > New Revision: 185584
>> >
>> > URL: http://llvm.org/viewvc/llvm-project?rev=185584&view=rev
>> > Log:
>> > Check LongDoubleFormat instead of just Width as this is PowerPC specific.
>>
>> Test case?
>
> It was just a modification of r185578 based on input from Eli Friedman.
Sure, but it was a modification based on a case/example he gave where
the original code would produce the wrong answer (on X86-64), if I
understand his comment correctly. So there should be a test case that
can be written that would demonstrate how the original code was buggy
(by failing) & how this change fixes it (by now passing).
>
>> >
>> > Modified:
>> > cfe/trunk/lib/Sema/SemaDeclAttr.cpp
>> >
>> > Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
>> > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=185584&r1=185583&r2=185584&view=diff
>> > ==============================================================================
>> > --- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
>> > +++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Wed Jul 3 16:08:41 2013
>> > @@ -3730,7 +3730,8 @@ static void handleModeAttr(Sema &S, Decl
>> > NewTy = S.Context.LongDoubleTy;
>> > break;
>> > case 128:
>> > - if (!IntegerMode && S.Context.getTargetInfo().getLongDoubleWidth() != 128) {
>> > + if (!IntegerMode && &S.Context.getTargetInfo().getLongDoubleFormat() !=
>> > + &llvm::APFloat::PPCDoubleDouble) {
>> > S.Diag(Attr.getLoc(), diag::err_unsupported_machine_mode) << Name;
>> > return;
>> > }
>> >
>> >
>> > _______________________________________________
>> > cfe-commits mailing list
>> > cfe-commits at cs.uiuc.edu
>> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list