[llvm] r213061 - Silence a warning in conditional expression.

David Blaikie dblaikie at gmail.com
Tue Jul 15 09:28:52 PDT 2014


On Tue, Jul 15, 2014 at 9:14 AM, Andrea Di Biagio
<andrea.dibiagio at gmail.com> wrote:
> Hi David,
>
> On Tue, Jul 15, 2014 at 5:05 PM, David Blaikie <dblaikie at gmail.com> wrote:
>> Which warning did this cause? Might be worth filing a bug on Clang to
>> implement it.
>
> here is the warning I found:
>
> llvm/lib/Target/X86/X86FastISel.cpp: In member function ‘virtual bool
> {anonymous}::X86FastISel::FastLowerCall(llvm::FastISel::CallLoweringInfo&)’:
> llvm/lib/Target/X86/X86FastISel.cpp:2922:64: warning: enumeral and
> non-enumeral type in conditional expression [enabled by default]

Richard Trieu - this might be a worthwhile warning to add to Clang.
But maybe not - I'm unsure.

But the general philosophy is that we should either implement (or at
least /desire/ to implement, even if we don't have the time) the
warning in clang, or disable GCC's warning in the LLVM build system.

>      unsigned CallOpc = Is64Bit ? X86::CALL64r : CallOpc = X86::CALL32r;
>                                                                 ^
> llvm/lib/Target/X86/X86FastISel.cpp:2922:64: warning: operation on
> ‘CallOpc’ may be undefined [-Wsequence-point]

Hey Richard Smith - you implemented Clang's version of
-Wsequence-point. Is this a false negative in Clang's that it doesn't
diagnose this? I don't think it is. I assume it's a false positive in
GCC, but I could be wrong...

>
>
> Using GCC 4.8.1
>
> Target: x86_64-linux-gnu
> gcc version 4.8.1 (Ubuntu/Linaro 4.8.1-10ubuntu9)
>
>
>>
>> On Tue, Jul 15, 2014 at 3:53 AM, Andrea Di Biagio
>> <Andrea_DiBiagio at sn.scee.net> wrote:
>>> Author: adibiagio
>>> Date: Tue Jul 15 05:53:44 2014
>>> New Revision: 213061
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=213061&view=rev
>>> Log:
>>> Silence a warning in conditional expression.
>>>
>>> Fixes a gcc warning caused by a typo. A redundant assignment operation was
>>> accidentally used as the third operand of a conditional expression.
>>> No functional change intended.
>>>
>>>
>>> Modified:
>>>     llvm/trunk/lib/Target/X86/X86FastISel.cpp
>>>
>>> Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=213061&r1=213060&r2=213061&view=diff
>>> ==============================================================================
>>> --- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original)
>>> +++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Tue Jul 15 05:53:44 2014
>>> @@ -2919,7 +2919,7 @@ bool X86FastISel::FastLowerCall(CallLowe
>>>    MachineInstrBuilder MIB;
>>>    if (CalleeOp) {
>>>      // Register-indirect call.
>>> -    unsigned CallOpc = Is64Bit ? X86::CALL64r : CallOpc = X86::CALL32r;
>>> +    unsigned CallOpc = Is64Bit ? X86::CALL64r : X86::CALL32r;
>>>      MIB = BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(CallOpc))
>>>        .addReg(CalleeOp);
>>>    } else {
>>>
>>>
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list