[llvm] r182832 - Temporary fix to get rid of gcc warning.

David Blaikie dblaikie at gmail.com
Wed May 29 09:59:23 PDT 2013


On Wed, May 29, 2013 at 12:32 AM, Patrik Hagglund <
patrik.h.hagglund at ericsson.com> wrote:

> Author: patha
> Date: Wed May 29 02:32:08 2013
> New Revision: 182832
>
> URL: http://llvm.org/viewvc/llvm-project?rev=182832&view=rev
> Log:
> Temporary fix to get rid of gcc warning.
>

Generally we prefer to simply disable or fix bad warnings rather than
workaround them in code. (which usually amounts to disabling GCC warnings
and fixing Clang warnings)

Which warning was the problem here & can we just disable it? Does Clang
have an equivalent (& better/correct/not-false-positive-on-this-code)
warning?


>
> Modified:
>     llvm/trunk/lib/Target/R600/AMDGPUSubtarget.cpp
>
> Modified: llvm/trunk/lib/Target/R600/AMDGPUSubtarget.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/AMDGPUSubtarget.cpp?rev=182832&r1=182831&r2=182832&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Target/R600/AMDGPUSubtarget.cpp (original)
> +++ llvm/trunk/lib/Target/R600/AMDGPUSubtarget.cpp Wed May 29 02:32:08 2013
> @@ -37,7 +37,16 @@ AMDGPUSubtarget::AMDGPUSubtarget(StringR
>    ParseSubtargetFeatures(GPU, FS);
>    DevName = GPU;
>    Device = AMDGPUDeviceInfo::getDeviceFromName(DevName, this, Is64bit);
> -  TexVTXClauseSize = (Device->getGeneration() >=
> AMDGPUDeviceInfo::HD4XXX)?16:8;
> +
> +  // FIXME: The code in the comment below was the original code. But the
> +  // condition is always true, generating a warning when compiled with
> +  // gcc. Vincent Lejeune indicated in a mail to llvm-commits 2013-05-23
> that he
> +  // will look into this. The code 'TexVTXClauseSize = 16' is just a
> temporary
> +  // equivalent replacement, to get rid of the compiler warning.
> +
> +  // TexVTXClauseSize = (Device->getGeneration() >=
> AMDGPUDeviceInfo::HD4XXX)?16:8;
> +
> +  TexVTXClauseSize = 16;
>  }
>
>  AMDGPUSubtarget::~AMDGPUSubtarget() {
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130529/745a2252/attachment.html>


More information about the llvm-commits mailing list