[Beignet] *** SPAM LEVEL 4.054 *** Re: [PATCH] Pass user options to clang.

Zhigang Gong zhigang.gong at linux.intel.com
Wed May 29 19:20:17 PDT 2013


Hi,

I can't reproduce this hang. And I recheck the patch and found one potential
problem:

-  static void buildModuleFromSource(const char* input, const char* output)
{
+  static void buildModuleFromSource(const char* input, const char* output,
std::string options) {
     // Arguments to pass to the clang frontend
     vector<const char *> args;
+    bool bOpt = true;
+
+    vector<std::string> useless; //hold substrings to avoid c_str free
+    uint32_t start = 0, end = 0;
+    /* clang unsupport options:
+       -cl-denorms-are-zero, -cl-strict-aliasing
+       -cl-no-signed-zeros, -cl-fp32-correctly-rounded-divide-sqrt
+       all support options, refer to clang/include/clang/Driver/Options.inc
+       Maybe can filter these options to avoid warning
+    */
+    while (end != std::string::npos) {
+      end = options.find(' ', start);
For the last argument which is not ended by a space, then the end should be
a npos which is -1.
Then it may cause problem. Yang Rong, could you confirm and fix this
potential problem?
+      std::string str = options.substr(start, end - start);
+      if(str.size() == 0)
+        continue;
+      if(str == "-cl-opt-disable") bOpt = false;
+      useless.push_back(str);
+      args.push_back(str.c_str());
+      start = end + 1;
+    }
+

> -----Original Message-----
> From: beignet-bounces+zhigang.gong=linux.intel.com at lists.freedesktop.org
>
[mailto:beignet-bounces+zhigang.gong=linux.intel.com at lists.freedesktop.org]
> On Behalf Of Simon Richter
> Sent: Wednesday, May 29, 2013 5:49 PM
> To: beignet at lists.freedesktop.org
> Subject: [Beignet] *** SPAM LEVEL 4.054 *** Re: [PATCH] Pass user options
to
> clang.
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi,
> 
> On 29.05.2013 05:20, Yang Rong wrote:
> 
> > clang do not support all options in opencl. clang unsupport
> > options: -cl-denorms-are-zero, -cl-strict-aliasing
> > -cl-no-signed-zeros, -cl-fp32-correctly-rounded-divide-sqrt all
> > support options, refer to clang/include/clang/Driver/Options.inc
> > Can ignore these options to avoid warning.
> 
> Starting from this commit, the "compiler_clod" test (i.e. the first
> test) hangs with 100% CPU.
> 
>    Simon
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.12 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iJwEAQECAAYFAlGlzxkACgkQ0sfeulffv7vYqQQAifBRUmvmMdq9XF/6qJZ4+Pa/
> kRqqvjukrxscJb8GuToFCcarpvh5Vq+qnDwngRMMf9oD3thTus/p3W4OBTThz5vK
> UuQ2jRR0AyRtbFYVrdQy8g6M6UEPZ60wZMvlXluclNw2nE6sf2zIG8TZw+cDhM
> Gb
> 0Q0fbad+Q8Diqy2jY08=
> =KEYY
> -----END PGP SIGNATURE-----
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet



More information about the Beignet mailing list