[PATCH] Warn on use of vector initializers in ARM BE mode

James Molloy james.molloy at arm.com
Thu Jun 19 05:34:20 PDT 2014


Hi Tim,

OK, so I see X alternatives:
  1. Patch stays as-is and has a specific flag to turn it off, instead of just being in -Wgnu.
  2. The warning is only emitted in big-endian mode (Alp doesn't like this) - this would reduce the noise down to the set of users who should at least take note of it.
  3. Rewrite the patch to try and instead look at *uses* of vectors inside NEON intrinsic functions. The idea being that it would fire if a global or local vector which has a vector initializer is used in a NEON intrinsic.
     I don't really like this one, because it's trivially easy to break it by even adding a temporary:
       Uint32x2_t x = {1, 2}; auto y = x; vadd...(y,y);
  4. Abandon patch, all ye who enter here.

What do you think?

Cheers,

James

> -----Original Message-----
> From: Tim Northover [mailto:t.p.northover at gmail.com]
> Sent: 19 June 2014 13:21
> To: James Molloy
> Cc: Alp Toker; Clang Commits
> Subject: Re: [PATCH] Warn on use of vector initializers in ARM BE mode
> 
> Hi James,
> 
> > Tim, you're right. However Alp I think has the solution - if we only
> fire when a NEON vector type is used, it restricts to only types that are
> defined in arm_neon.h.
> 
> It's certainly a big step in the right direction, but I don't think it
> solves the issue completely. #including arm_neon.h is an obvious way
> to get the vector types even if you have no intention of using the
> intrinsics (it's even mentioned in the AAPCS). The NEON vector types
> are also the only way to get ABI conformance in Clang (i.e. correct
> name mangling), so you might well use them even without arm_neon.h.
> 
> I can still see the argument for having the warning (though I'm not
> entirely sure I'm convinced by it), but at the very least I think
> those issues mean it should be controllable (-Wno-whatever).
> 
> Cheers.
> 
> Tim.








More information about the cfe-commits mailing list