[Bug c/53060] Typo in build_binary_op for scalar-vector ops
marc.glisse at normalesup dot org
gcc-bugzilla@gcc.gnu.org
Sat Apr 21 15:01:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53060
--- Comment #2 from Marc Glisse <marc.glisse at normalesup dot org> 2012-04-21 14:59:54 UTC ---
(In reply to comment #1)
> * gcc.dg/scal-to-vec2.c: New test.
This one runs the problematic code, but since this is a compile-only test, it
can't detect a problem. A variant that does fail:
extern void abort (void);
int f(void) { return 2; }
unsigned int g(void) { return 5; }
unsigned int h = 1;
typedef unsigned int vec __attribute__((vector_size(16)));
vec i = { 1, 2, 3, 4};
vec fv1(void) { return i + (h ? f() : g()); }
vec fv2(void) { return (h ? f() : g()) + i; }
int main(){
vec j = fv1();
if (j[0] != 3) abort();
}
(it works ok with fv2)
More information about the Gcc-bugs
mailing list